Serialbox  2.2.0
Data serialization library and tools for C/C++, Python and Fortran
Savepoint methods
SERIALBOX_API serialboxSavepoint_tserialboxSavepointCreate (const char *name)
 Construct a Savepoint. More...
 
SERIALBOX_API serialboxSavepoint_tserialboxSavepointCreateFromSavepoint (const serialboxSavepoint_t *other)
 Copy construct the Savepoint. More...
 
SERIALBOX_API void serialboxSavepointDestroy (serialboxSavepoint_t *savepoint)
 Destroy the savepoint and deallocate all memory. More...
 
SERIALBOX_API const char * serialboxSavepointGetName (const serialboxSavepoint_t *savepoint)
 Get the name of the Savepoint. More...
 
SERIALBOX_API int serialboxSavepointEqual (const serialboxSavepoint_t *s1, const serialboxSavepoint_t *s2)
 Check if Savepoint s1 is equal to savepoint s2 More...
 
SERIALBOX_API char * serialboxSavepointToString (const serialboxSavepoint_t *savepoint)
 Convert to string. More...
 
SERIALBOX_API size_t serialboxSavepointHash (const serialboxSavepoint_t *savepoint)
 Compute hash of the Savepoint. More...
 
SERIALBOX_API serialboxMetainfo_tserialboxSavepointGetMetainfo (serialboxSavepoint_t *savepoint)
 Allocate a new serialboxMetainfo_t which maps to the meta-information of the Savepoint. More...
 

Detailed Description

Function Documentation

◆ serialboxSavepointCreate()

SERIALBOX_API serialboxSavepoint_t* serialboxSavepointCreate ( const char *  name)

Construct a Savepoint.

Parameters
nameName of the Savepoint
Returns
pointer to the newly constructed Savepoint or NULL if an error occurred

Definition at line 24 of file Savepoint.cpp.

◆ serialboxSavepointCreateFromSavepoint()

SERIALBOX_API serialboxSavepoint_t* serialboxSavepointCreateFromSavepoint ( const serialboxSavepoint_t other)

Copy construct the Savepoint.

Parameters
otherSavepoint to copy from
Returns
pointer to the newly constructed Savepoint or NULL if an error occurred

Definition at line 37 of file Savepoint.cpp.

◆ serialboxSavepointDestroy()

SERIALBOX_API void serialboxSavepointDestroy ( serialboxSavepoint_t savepoint)

Destroy the savepoint and deallocate all memory.

Parameters
savepointSavepoint to use

Definition at line 49 of file Savepoint.cpp.

◆ serialboxSavepointEqual()

SERIALBOX_API int serialboxSavepointEqual ( const serialboxSavepoint_t s1,
const serialboxSavepoint_t s2 
)

Check if Savepoint s1 is equal to savepoint s2

Parameters
s1First Savepoint to use
s2Second Savepoint to use
Returns
1 if s1 == s2, 0 otherwise

Definition at line 67 of file Savepoint.cpp.

◆ serialboxSavepointGetMetainfo()

SERIALBOX_API serialboxMetainfo_t* serialboxSavepointGetMetainfo ( serialboxSavepoint_t savepoint)

Allocate a new serialboxMetainfo_t which maps to the meta-information of the Savepoint.

Parameters
savepointSavepoint to use
Returns
meta-information of the Savepoint

Definition at line 87 of file Savepoint.cpp.

◆ serialboxSavepointGetName()

SERIALBOX_API const char* serialboxSavepointGetName ( const serialboxSavepoint_t savepoint)

Get the name of the Savepoint.

Parameters
savepointSavepoint to use
Returns
name of the Savepoint

Definition at line 62 of file Savepoint.cpp.

◆ serialboxSavepointHash()

SERIALBOX_API size_t serialboxSavepointHash ( const serialboxSavepoint_t savepoint)

Compute hash of the Savepoint.

Savepoints are hashed on their name (std::string). Although, the name of a savepoint is not unique, it is a reasoanble compromise as we assume there are only O(1) savepoints sharing the same name.

The function will allocate a sufficiently large char buffer (using malloc()) which needs be freed by the user using free().

Parameters
savepointSavepoint to use
Returns
Hash of the string

Definition at line 78 of file Savepoint.cpp.

◆ serialboxSavepointToString()

SERIALBOX_API char* serialboxSavepointToString ( const serialboxSavepoint_t savepoint)

Convert to string.

The function will allocate a sufficiently large char buffer (using malloc()) which needs be freed by the user using free().

Parameters
savepointSavepoint to use
Returns
String representation of the Savepoint

Definition at line 73 of file Savepoint.cpp.