mirror of
https://github.com/cmosher01/v6502cpp.git
synced 2025-04-09 07:39:15 +00:00
refactor: extract setpSeg typedef to own header
This commit is contained in:
parent
da174b54cd
commit
84715444c9
@ -9,7 +9,9 @@
|
||||
#define CIRCUIT_H
|
||||
|
||||
#include <set>
|
||||
#include "trans.h"
|
||||
#include "setpSeg.h"
|
||||
|
||||
class Segment;
|
||||
|
||||
/*
|
||||
* Builds a circuit, given one segment in that circuit.
|
||||
|
@ -7,6 +7,7 @@
|
||||
|
||||
#include "Common.h"
|
||||
#include "SegmentCache.h"
|
||||
#include "trans.h"
|
||||
|
||||
Common Common::create(const SegmentCache& segs) {
|
||||
return Common(
|
||||
|
3
Common.h
3
Common.h
@ -8,9 +8,10 @@
|
||||
#ifndef COMMON_H
|
||||
#define COMMON_H
|
||||
|
||||
#include "trans.h"
|
||||
#include "setpSeg.h"
|
||||
|
||||
class SegmentCache;
|
||||
class Segment;
|
||||
|
||||
class Common {
|
||||
public:
|
||||
|
@ -18,7 +18,7 @@
|
||||
|
||||
|
||||
#define TRACEREG 1
|
||||
#define TRACESEG 1
|
||||
//#define TRACESEG 1
|
||||
|
||||
|
||||
|
||||
|
@ -6,6 +6,7 @@
|
||||
*/
|
||||
|
||||
#include "SegmentCache.h"
|
||||
#include "trans.h"
|
||||
#include <memory>
|
||||
#include <string>
|
||||
#include <map>
|
||||
@ -42,3 +43,11 @@ Segment* SegmentCache::get(const std::string& id) const {
|
||||
|
||||
return this->cache.at(id).get();
|
||||
}
|
||||
|
||||
setpSeg SegmentCache::all() const {
|
||||
setpSeg s;
|
||||
for (auto i : this->cache) {
|
||||
s.insert(i.second.get());
|
||||
}
|
||||
return s;
|
||||
}
|
||||
|
@ -8,13 +8,14 @@
|
||||
#ifndef SEGMENTCACHE_H
|
||||
#define SEGMENTCACHE_H
|
||||
|
||||
#include "trans.h"
|
||||
#include "setpSeg.h"
|
||||
#include <memory>
|
||||
#include <string>
|
||||
#include <map>
|
||||
#include <set>
|
||||
|
||||
class Common;
|
||||
class Segment;
|
||||
|
||||
class SegmentCache {
|
||||
public:
|
||||
@ -27,13 +28,7 @@ public:
|
||||
|
||||
Segment* getOrAdd(const std::string& id);
|
||||
|
||||
setpSeg all() const {
|
||||
setpSeg s;
|
||||
for (auto i : this->cache) {
|
||||
s.insert(i.second.get());
|
||||
}
|
||||
return s;
|
||||
}
|
||||
setpSeg all() const;
|
||||
|
||||
|
||||
std::map<const std::string, std::shared_ptr<Segment > >::const_iterator begin() const {
|
||||
|
@ -9,7 +9,10 @@
|
||||
#define STATECALCULATOR_H
|
||||
|
||||
#include <set>
|
||||
#include "trans.h"
|
||||
#include "setpSeg.h"
|
||||
|
||||
class Segment;
|
||||
class Trans;
|
||||
|
||||
class StateCalculator {
|
||||
public:
|
||||
|
@ -7,6 +7,7 @@
|
||||
|
||||
#include "Trace.h"
|
||||
#include "SegmentCache.h"
|
||||
#include "trans.h"
|
||||
#include "Common.h"
|
||||
#include <iostream>
|
||||
#include <iomanip>
|
||||
|
18
setpSeg.h
Normal file
18
setpSeg.h
Normal file
@ -0,0 +1,18 @@
|
||||
/*
|
||||
* File: setpSeg.h
|
||||
* Author: Christopher
|
||||
*
|
||||
* Created on December 15, 2013, 12:16 AM
|
||||
*/
|
||||
|
||||
#ifndef SETPSEG_H
|
||||
#define SETPSEG_H
|
||||
|
||||
#include "ptr_less.h"
|
||||
#include <set>
|
||||
class Segment;
|
||||
|
||||
typedef std::set<Segment*,ptr_less<Segment>> setpSeg;
|
||||
|
||||
#endif /* SETPSEG_H */
|
||||
|
Loading…
x
Reference in New Issue
Block a user