Libgetar C++ API¶
GTAR¶
-
class GTAR¶
Accessor interface for a trajectory archive.
Public Functions
-
GTAR(const std::string &filename, const OpenMode mode)¶
Constructor. Opens the file at filename in the given mode. The format of the file depends on the extension of filename.
-
void close()¶
Manually close the opened archive (it automatically closes itself upon destruction)
-
void writeString(const std::string &path, const std::string &contents, CompressMode mode)¶
Write a string to the given location.
-
void writeBytes(const std::string &path, const std::vector<char> &contents, CompressMode mode)¶
Write a bytestring to the given location.
-
void writePtr(const std::string &path, const void *contents, const size_t byteLength, CompressMode mode)¶
Write the contents of a pointer to the given location.
-
template<typename iter, typename T>
void writeIndividual(const std::string &path, const iter &start, const iter &end, CompressMode mode)¶ Write an individual binary property to the specified location, converting to little endian if necessary.
-
template<typename T>
void writeUniform(const std::string &path, const T &val)¶ Write a uniform binary property to the specified location, converting to little endian if necessary.
Read an individual binary property to the specified location, converting from little endian if necessary.
Read a uniform binary property to the specified location, converting from little endian if necessary.
-
SharedArray<char> readBytes(const std::string &path)¶
Read a bytestring from the specified location.
-
class BulkWriter¶
Public Functions
-
BulkWriter(GTAR &archive)¶
Create a new BulkWriter on an archive. Only one should exist for any archive at a time.
-
~BulkWriter()¶
Clean up the BulkWriter data. Causes all writes to be performed.
-
void writeString(const std::string &path, const std::string &contents, CompressMode mode)¶
Write a string to the given location.
-
void writeBytes(const std::string &path, const std::vector<char> &contents, CompressMode mode)¶
Write a bytestring to the given location.
-
void writePtr(const std::string &path, const void *contents, const size_t byteLength, CompressMode mode)¶
Write the contents of a pointer to the given location.
-
BulkWriter(GTAR &archive)¶
-
GTAR(const std::string &filename, const OpenMode mode)¶
Record¶
-
class Record¶
Simple class for a record which can be stored in an archive.
Public Functions
-
Record()¶
Default constructor: initialize all strings to empty, behavior to Constant, format to UInt8, and resolution to Text
-
Record(const std::string &path)¶
Create a record from a path (inside the archive), parsing the path into the various fields
-
Record(const std::string &group, const std::string &name, const std::string &index, Behavior behavior, Format format, Resolution resolution)¶
Create a record directly from the full set of elements.
-
std::string nullifyIndex()¶
Set our index to the empty string.
-
Record withNullifiedIndex() const¶
Return a copy of this object, but with an empty string for its index
-
std::string getPath() const¶
Construct a path (for inside an archive) from this object’s various fields
-
std::string getGroup() const¶
Get the stored group field.
-
std::string getName() const¶
Get the stored name field.
-
std::string getIndex() const¶
Get the stored index field.
-
Resolution getResolution() const¶
Get the stored resolution field.
-
Record()¶
Enums: Behavior, Format, Resolution¶
-
enum gtar::Behavior¶
Time behavior of properties.
Values:
-
enumerator Constant¶
-
enumerator Discrete¶
-
enumerator Continuous¶
-
enumerator Constant¶