15 #include "serialbox-c/Savepoint.h" 16 #include "serialbox-c/Utility.h" 27 savepoint->impl =
new Savepoint(name);
28 savepoint->ownsData = 1;
38 const Savepoint* sp = toConstSavepoint(other);
41 savepoint->impl =
new Savepoint(*sp);
42 savepoint->ownsData = 1;
51 Savepoint* sp = toSavepoint(savepoint);
52 if(savepoint->ownsData)
63 const Savepoint* sp = toConstSavepoint(savepoint);
64 return sp->name().c_str();
68 const Savepoint* sp1 = toConstSavepoint(s1);
69 const Savepoint* sp2 = toConstSavepoint(s2);
70 return ((*sp1) == (*sp2));
74 const Savepoint* sp = toConstSavepoint(savepoint);
75 return allocateAndCopyString(sp->toString());
79 const Savepoint* sp = toConstSavepoint(savepoint);
80 return std::hash<Savepoint>()(*sp);
88 Savepoint* sp = toSavepoint(savepoint);
90 metaInfo->impl = sp->metaInfoPtr().get();
91 metaInfo->ownsData = 0;
const char * serialboxSavepointGetName(const serialboxSavepoint_t *savepoint)
Get the name of the Savepoint.
int serialboxSavepointEqual(const serialboxSavepoint_t *s1, const serialboxSavepoint_t *s2)
Check if Savepoint s1 is equal to savepoint s2
void serialboxSavepointDestroy(serialboxSavepoint_t *savepoint)
Destroy the savepoint and deallocate all memory.
serialboxSavepoint_t * serialboxSavepointCreate(const char *name)
Construct a Savepoint.
void serialboxFatalError(const char *reason)
Report a fatal error.
serialboxMetainfo_t * serialboxSavepointGetMetainfo(serialboxSavepoint_t *savepoint)
Allocate a new serialboxMetainfo_t which maps to the meta-information of the Savepoint.
serialboxSavepoint_t * serialboxSavepointCreateFromSavepoint(const serialboxSavepoint_t *other)
Copy construct the Savepoint.
char * serialboxSavepointToString(const serialboxSavepoint_t *savepoint)
Convert to string.
size_t serialboxSavepointHash(const serialboxSavepoint_t *savepoint)
Compute hash of the Savepoint.