1 #ifndef REVERSEMANGER_HH
2 #define REVERSEMANGER_HH
19 class EventDistributor;
47 ReverseChunk(ReverseChunk&& rhs);
48 ReverseChunk& operator=(ReverseChunk&& rhs);
58 typedef std::map<unsigned, ReverseChunk> Chunks;
59 typedef std::vector<std::shared_ptr<StateChange>> Events;
61 struct ReverseHistory {
62 void swap(ReverseHistory& other);
70 bool isCollecting()
const;
76 void goBack(
const std::vector<TclObject>& tokens);
77 void goTo(
const std::vector<TclObject>& tokens);
78 void saveReplay(
const std::vector<TclObject>& tokens,
TclObject& result);
79 void loadReplay(
const std::vector<TclObject>& tokens,
TclObject& result);
85 ReverseHistory& history,
bool sameTimeLine);
86 void transferHistory(ReverseHistory& oldHistory,
87 unsigned oldEventCount);
91 void replayNextEvent();
92 template<
unsigned N>
void dropOldSnapshots(
unsigned count);
98 virtual int signalEvent(
const std::shared_ptr<const Event>& event);
101 virtual void signalStateChange(
const std::shared_ptr<StateChange>& event);
103 virtual bool isReplaying()
const;
107 const std::unique_ptr<ReverseCmd> reverseCmd;
110 ReverseHistory history;
111 unsigned replayIndex;
113 bool pendingTakeSnapshot;
115 unsigned reRecordCount;