HOPS
HOPS class reference
|
Class MHO_BinaryFileInterface. More...
#include <MHO_BinaryFileInterface.hh>
Public Member Functions | |
MHO_BinaryFileInterface () | |
virtual | ~MHO_BinaryFileInterface () |
void | Close () |
Closes file and key/index streamers if open. More... | |
bool | ExtractFileObjectKeys (const std::string &filename, std::vector< MHO_FileKey > &keys) |
reads an object file and extracts the object file keys while skipping over the object data (cannot be actively streaming to another open file when called) More... | |
bool | ExtractFileObjectKeysAndOffsets (const std::string &filename, std::vector< MHO_FileKey > &keys, std::vector< std::size_t > &byte_offsets) |
pulls out the object keys and the bytes offsets to the key entry of each object from the start of the file (skipping over object data) More... | |
bool | ExtractIndexFileObjectKeys (const std::string &index_filename, std::vector< MHO_FileKey > &keys) |
reads an index file and extracts the object file keys (cannot be actively streaming to another open file when called) More... | |
bool | IsOpenForRead () |
Checks if the object streamer is open for reading. More... | |
bool | IsOpenForWrite () |
Checks if both object and key streamers are open for writing when fCollectKeys is true, otherwise checks only the object streamer. More... | |
bool | OpenToAppend (const std::string &obj_filename, const std::string &index_filename="") |
Opens a file for appending objects and optionally streams keys to an index file. More... | |
bool | OpenToRead (const std::string &filename) |
Opens a file for reading and checks if it's open. More... | |
bool | OpenToReadAtOffset (const std::string &filename, uint64_t offset_bytes) |
Opens a file for reading at a specified byte offset. More... | |
bool | OpenToWrite (const std::string &obj_filename, const std::string &index_filename="") |
Opens a file for writing and optionally opens an index file if provided. More... | |
template<class XReadType > | |
bool | Read (XReadType &obj, MHO_FileKey &obj_key) |
Reads the object (XReadType) specified by the object file key from the file. More... | |
template<class XWriteType > | |
bool | Write (const XWriteType &obj, const char *shortname) |
Writes an object (must inherit from MHO_Serializable) to a file (with optional shortname string - overloaded for char array name). Checks if both object and key streamers are open for write if fCollectKeys is true, otherwise checks only object streamer. More... | |
template<class XWriteType > | |
bool | Write (const XWriteType &obj, const std::string &shortname="") |
Writes an object (must inherit from MHO_Serializable) to a file (with optional shortname string). Checks if both object and key streamers are open for write if fCollectKeys is true, otherwise checks only object streamer. More... | |
Class MHO_BinaryFileInterface.
|
inline |
|
inlinevirtual |
|
inline |
Closes file and key/index streamers if open.
|
inline |
reads an object file and extracts the object file keys while skipping over the object data (cannot be actively streaming to another open file when called)
filename | (const std::string&) |
keys | (std::vector< MHO_FileKey >&) |
|
inline |
pulls out the object keys and the bytes offsets to the key entry of each object from the start of the file (skipping over object data)
filename | (const std::string&) |
keys | (std::vector< MHO_FileKey >&) |
byte_offsets | (std::vector< std::size_t >&) |
|
inline |
reads an index file and extracts the object file keys (cannot be actively streaming to another open file when called)
index_filename | (const std::string&) |
keys | (std::vector< MHO_FileKey >&) |
|
inline |
Checks if the object streamer is open for reading.
|
inline |
Checks if both object and key streamers are open for writing when fCollectKeys is true, otherwise checks only the object streamer.
|
inline |
Opens a file for appending objects and optionally streams keys to an index file.
obj_filename | Filename of the object file to open for appending |
index_filename | Optional filename of the index file for streaming keys |
|
inline |
Opens a file for reading and checks if it's open.
filename | The name of the file to be opened for reading. |
|
inline |
Opens a file for reading at a specified byte offset.
filename | The name of the file to open and read from. |
offset_bytes | (uint64_t) |
|
inline |
Opens a file for writing and optionally opens an index file if provided.
obj_filename | The filename to write object data to. |
index_filename | Optional filename to write key/index data to. |
|
inline |
Reads the object (XReadType) specified by the object file key from the file.
obj | reference to the object to be filled with data (XReadType&) |
the | File key which points to the object to be read |
|
inline |
Writes an object (must inherit from MHO_Serializable) to a file (with optional shortname string - overloaded for char array name). Checks if both object and key streamers are open for write if fCollectKeys is true, otherwise checks only object streamer.
the | object to be written of type (const XWriteType &) |
shortname | - optional discriptive char array (C-string) |
|
inline |
Writes an object (must inherit from MHO_Serializable) to a file (with optional shortname string). Checks if both object and key streamers are open for write if fCollectKeys is true, otherwise checks only object streamer.
the | object to be written of type (const XWriteType &) |
shortname | - optional discriptive string |