HOPS
HOPS class reference
|
Class MHO_ContainerFileInterface - a MHO_ContainerDictionary which can read/write objects to file. More...
#include <MHO_ContainerFileInterface.hh>
Public Member Functions | |
MHO_ContainerFileInterface () | |
virtual | ~MHO_ContainerFileInterface () |
void | ConvertObjectInStoreToJSON (MHO_ContainerStore &store, const MHO_UUID &obj_uuid, mho_json &json_obj, int level_of_detail=eJSONBasic) |
Converts a specific object in store to JSON representation at given detail level. More... | |
void | ConvertObjectInStoreToJSONAndRaw (MHO_ContainerStore &store, const MHO_UUID &obj_uuid, mho_json &json_obj, std::size_t &rank, const char *&raw_data, std::size_t &raw_data_byte_size, std::string &raw_data_descriptor, int level_of_detail=eJSONBasic) |
Converts an object in store to JSON and raw data, providing access to raw bytes for hops2flat. More... | |
void | ConvertStoreToJSON (MHO_ContainerStore &store, mho_json &json_obj, int level_of_detail=eJSONBasic) |
Converts a container store to JSON representation with specified detail level. More... | |
void | PopulateStoreFromFile (MHO_ContainerStore &store, bool do_clear_store=false) |
Populates a store from a file, optionally clearing it first. More... | |
void | SetFilename (std::string filename) |
Setter for filename. More... | |
void | SetIndexFileName (std::string index_filename) |
Setter for index file name. More... | |
void | WriteStoreToFile (MHO_ContainerStore &store) |
Writes object in a MHO_ContainerStore to file using MHO_BinaryFileInterface and factory map. More... | |
![]() | |
MHO_ContainerDictionary () | |
virtual | ~MHO_ContainerDictionary () |
![]() | |
MHO_ClassIdentityMap () | |
virtual | ~MHO_ClassIdentityMap () |
template<typename XClassType > | |
void | AddClassType () |
Function AddClassType, adds a class of a particular type to the identity map. More... | |
template<typename XClassType > | |
void | AddClassType (const XClassType &obj) |
Function AddClassType, overload provided for passing object reference. More... | |
MHO_Serializable * | GenerateContainerFromUUID (const MHO_UUID &uuid) |
Generates a container from a UUID and returns a ptr to MHO_Serializable if found in factory map. More... | |
template<typename XClassType > | |
std::string | GetClassNameFromObject (const XClassType &obj) |
Getter for class name from object. More... | |
std::string | GetClassNameFromUUID (const MHO_UUID &uuid) const |
Getter for class name from uuid. More... | |
template<typename XClassType > | |
MHO_UUID | GetUUIDFor () const |
Getter for uuid for a class type. More... | |
MHO_UUID | GetUUIDFromClassName (const std::string &name) const |
Getter for uuid from class name. More... | |
bool | IsTypePresent (const MHO_UUID &uuid) const |
Checks if a UUID is present in the class name map. More... | |
Additional Inherited Members | |
![]() | |
void | AddToMap (const MHO_UUID &type_uuid, const std::string &name) |
Adds an entry to the UUID-name map and its reverse map. More... | |
![]() | |
std::map< std::string, MHO_UUID > | fClassName2UUID |
std::map< MHO_UUID, MHO_SerializableObjectFactory * > | fFactoryMap |
std::map< MHO_UUID, MHO_JSONConverter * > | fJSONConverterMap |
MHO_MD5HashGenerator | fMD5Generator |
std::map< MHO_UUID, std::string > | fUUID2ClassName |
Class MHO_ContainerFileInterface - a MHO_ContainerDictionary which can read/write objects to file.
hops::MHO_ContainerFileInterface::MHO_ContainerFileInterface | ( | ) |
|
virtual |
void hops::MHO_ContainerFileInterface::ConvertObjectInStoreToJSON | ( | MHO_ContainerStore & | store, |
const MHO_UUID & | obj_uuid, | ||
mho_json & | json_obj, | ||
int | level_of_detail = eJSONBasic |
||
) |
Converts a specific object in store to JSON representation at given detail level.
store | Reference to MHO_ContainerStore for accessing objects and types. |
obj_uuid | UUID of the object to convert to JSON. |
json_obj | Reference to mho_json where converted object will be stored. |
level_of_detail | Detail level for converting the object. |
void hops::MHO_ContainerFileInterface::ConvertObjectInStoreToJSONAndRaw | ( | MHO_ContainerStore & | store, |
const MHO_UUID & | obj_uuid, | ||
mho_json & | json_obj, | ||
std::size_t & | rank, | ||
const char *& | raw_data, | ||
std::size_t & | raw_data_byte_size, | ||
std::string & | raw_data_descriptor, | ||
int | level_of_detail = eJSONBasic |
||
) |
Converts an object in store to JSON and raw data, providing access to raw bytes for hops2flat.
store | Reference to MHO_ContainerStore for accessing objects |
obj_uuid | UUID of the object to convert |
json_obj | Output mho_json object containing converted JSON representation |
rank | Output rank of the converted object (specialization for RANK-0) |
raw_data | Output pointer to raw data bytes (null if not available) |
raw_data_byte_size | Output size of raw data in bytes |
raw_data_descriptor | Output string describing raw data |
level_of_detail | Input level of detail for conversion |
void hops::MHO_ContainerFileInterface::ConvertStoreToJSON | ( | MHO_ContainerStore & | store, |
mho_json & | json_obj, | ||
int | level_of_detail = eJSONBasic |
||
) |
Converts a container store to JSON representation with specified detail level.
store | Reference to MHO_ContainerStore object containing data to convert. |
json_obj | Reference to mho_json object that will hold the converted JSON data. |
level_of_detail | Integer specifying the level of detail for the JSON conversion. |
void hops::MHO_ContainerFileInterface::PopulateStoreFromFile | ( | MHO_ContainerStore & | store, |
bool | do_clear_store = false |
||
) |
Populates a store from a file, optionally clearing it first.
currently this function reads the file keys and then the all the file objects note: we may want to split this functionality so we can inspect the file first and then only read the objects of interest
store | Reference to MHO_ContainerStore object |
do_clear_store | Boolean flag indicating whether to clear the store before populating |
void hops::MHO_ContainerFileInterface::SetFilename | ( | std::string | filename | ) |
Setter for filename.
filename | New filename to set as a std::string |
void hops::MHO_ContainerFileInterface::SetIndexFileName | ( | std::string | index_filename | ) |
Setter for index file name.
index file is optional, if we don't have an index file, the regular file will be read in 2-passes, first to extract the keys, then to extract the objects likewise, when writing a store to file, if there is no index file specified, none will be created
index_filename | The new index file name to set |
void hops::MHO_ContainerFileInterface::WriteStoreToFile | ( | MHO_ContainerStore & | store | ) |
Writes object in a MHO_ContainerStore to file using MHO_BinaryFileInterface and factory map.
store | Reference to MHO_ContainerStore containing objects to write. |