more documentation
[c11tester.git] / snapshot-interface.h
index 0c2478ee67abb38b817106a876899803fa458771..1c4c32b0339c574bc7bde31096a78c2fec3a5932 100644 (file)
@@ -1,12 +1,42 @@
+/** @file snapshot-interface.h
+ *  @brief C++ layer on top of snapshotting system.
+ */
+
+
 #ifndef __SNAPINTERFACE_H
 #define __SNAPINTERFACE_H
-#include "snapshot.h"
 #include "mymemory.h"
-#include <vector>
-#include <utility>
-#include <string>
-typedef std::basic_string< char, std::char_traits< char >, MyAlloc< char > > MyString;
-namespace snapshot_utils{
-       std::vector< std::pair< void *, size_t >, MyAlloc< std::pair< void *, size_t > > > ReturnGlobalSegmentsToSnapshot();
+
+typedef unsigned int snapshot_id;
+
+typedef void (*VoidFuncPtr)();
+void initSnapShotLibrary(unsigned int numbackingpages,
+               unsigned int numsnapshots, unsigned int nummemoryregions,
+               unsigned int numheappages, VoidFuncPtr entryPoint);
+void finalize();
+
+void SnapshotGlobalSegments();
+
+struct stackEntry {
+  struct stackEntry *next;
+  snapshot_id snapshotid;
+  int index;
 };
+
+class SnapshotStack {
+ public:
+  MEMALLOC
+  SnapshotStack( );
+  ~SnapshotStack();
+  int backTrackBeforeStep(int seq_index);
+  void snapshotStep(int seq_index);
+
+ private: 
+  struct stackEntry * stack;
+};
+
+/* Not sure what it even means to have more than one snapshot object,
+   so let's just make a global reference to it.*/
+
+extern SnapshotStack * snapshotObject;
 #endif