initial
[prop.git] / include / AD / persist / po_impl.h
blob9a3c7376cf5b7f0f1216396a1898fcdefeabab77
1 #ifndef postream_implementation_h
2 #define postream_implementation_h
3 #include <stdlib.h>
4 #include <string.h>
5 #include <AD/hash/lhash2.h> // linear probing hash table
6 #include <AD/contain/variset.h> // variable length integer set
8 //////////////////////////////////////////////////////////////////////////////
9 // The object log is implemented simply as a hash table.
11 // Object log maps object pointers to
13 //////////////////////////////////////////////////////////////////////////////
14 class PObjectOrdering {
15 public:
16 inline static unsigned int hash (P_ObjectAddr obj)
17 { return (unsigned int)obj; }
18 inline static Bool equal (P_ObjectAddr a, P_ObjectAddr b)
19 { return a == b; }
22 class PObjectLog {
23 void operator = (const PObjectLog&);
24 PObjectLog(const PObjectLog&);
25 public:
26 struct PObjectInfo {
27 const PObject * obj;
28 P_OBJECT_MARKER marker;
29 inline PObjectInfo() {}
30 inline PObjectInfo(const PObject * p, P_OBJECT_MARKER m)
31 : obj(p), marker(m) {}
33 LHashTable2<P_ObjectAddr, PObjectLog::PObjectInfo, PObjectOrdering> markers;
34 VarIntSet object_types;
35 PObjectLog(int n);
36 ~PObjectLog();
37 void clean();
40 #endif