diff --git a/Circuit.h b/Circuit.h index 1657aa2..d99013a 100644 --- a/Circuit.h +++ b/Circuit.h @@ -9,7 +9,9 @@ #define CIRCUIT_H #include -#include "trans.h" +#include "setpSeg.h" + +class Segment; /* * Builds a circuit, given one segment in that circuit. diff --git a/Common.cpp b/Common.cpp index 24f29ad..15a6724 100644 --- a/Common.cpp +++ b/Common.cpp @@ -7,6 +7,7 @@ #include "Common.h" #include "SegmentCache.h" +#include "trans.h" Common Common::create(const SegmentCache& segs) { return Common( diff --git a/Common.h b/Common.h index ba3efb4..7e34ce9 100644 --- a/Common.h +++ b/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: diff --git a/Cpu6502.cpp b/Cpu6502.cpp index cc70829..b8c29d6 100644 --- a/Cpu6502.cpp +++ b/Cpu6502.cpp @@ -18,7 +18,7 @@ #define TRACEREG 1 -#define TRACESEG 1 +//#define TRACESEG 1 diff --git a/SegmentCache.cpp b/SegmentCache.cpp index 10d9439..f444819 100644 --- a/SegmentCache.cpp +++ b/SegmentCache.cpp @@ -6,6 +6,7 @@ */ #include "SegmentCache.h" +#include "trans.h" #include #include #include @@ -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; +} diff --git a/SegmentCache.h b/SegmentCache.h index a704e22..f05a409 100644 --- a/SegmentCache.h +++ b/SegmentCache.h @@ -8,13 +8,14 @@ #ifndef SEGMENTCACHE_H #define SEGMENTCACHE_H -#include "trans.h" +#include "setpSeg.h" #include #include #include #include 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_iterator begin() const { diff --git a/StateCalculator.h b/StateCalculator.h index 3337ecf..2e864b2 100644 --- a/StateCalculator.h +++ b/StateCalculator.h @@ -9,7 +9,10 @@ #define STATECALCULATOR_H #include -#include "trans.h" +#include "setpSeg.h" + +class Segment; +class Trans; class StateCalculator { public: diff --git a/Trace.cpp b/Trace.cpp index 263186a..15cf148 100644 --- a/Trace.cpp +++ b/Trace.cpp @@ -7,6 +7,7 @@ #include "Trace.h" #include "SegmentCache.h" +#include "trans.h" #include "Common.h" #include #include diff --git a/setpSeg.h b/setpSeg.h new file mode 100644 index 0000000..eb9e705 --- /dev/null +++ b/setpSeg.h @@ -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 +class Segment; + +typedef std::set> setpSeg; + +#endif /* SETPSEG_H */ + diff --git a/trans.h b/trans.h index 4d7c896..b4950ab 100644 --- a/trans.h +++ b/trans.h @@ -8,7 +8,7 @@ #ifndef TRANS_H #define TRANS_H -#include "ptr_less.h" +#include "setpSeg.h" #include #include @@ -62,7 +62,6 @@ private: Segment& operator=(const Segment&) = delete; }; -typedef std::set> setpSeg;