![]() |
Multilevel Deduplication Engine (MDE)
|
Classes | |
| struct | DefaultValueSerializer |
| Default serialization behavior. If the type of the property in MDE is something that can be directly serialized to JSON (like numbers, strings), or has a serializer routine already written for it (see nlohmann/json documentation), this struct will do so. More... | |
| struct | SerializationError |
| struct | ValueSerializer |
| Struct for serializing/deserializing values in MDE. More... | |
Typedefs | |
| using | JSON = nlohmann::json |
Functions | |
| template<typename MapT > | |
| JSON | binary_operation_map_to_json (const MapT &map) |
| Converts OperationNode -> integer maps to JSON. | |
| template<typename MapT > | |
| void | binary_operation_map_from_json (MapT &map, const JSON &obj) |
| Inserts data from the JSON representation to the equivalent C++ data strucure for the OperationNode -> integer map. | |
| template<typename MapT > | |
| JSON | unary_operation_map_to_json (const MapT &map) |
| Converts an integer -> integer map to JSON. | |
| template<typename MapT > | |
| void | unary_operation_map_from_json (MapT &map, const JSON &obj) |
| Inserts data from the JSON representation to the equivalent C++ data strucure for the integer -> integer map. | |
| template<typename StoreT , typename Serializer > | |
| JSON | storage_array_to_json (const StoreT &store, Serializer &serializer) |
| Converts a storage array to its JSON representation. | |
| template<typename MDET , typename Serializer > | |
| void | register_storage_from_json (MDET &mde, const JSON &obj, Serializer &serializer) |
Inserts data from the JSON representation to the equivalent C++ data strucure for a PropertySetStorage. It needs direct access to the MDE object to use register_set. | |
| template<typename Serializer , typename StoreT > | |
| JSON | storage_array_to_json_nested (const StoreT &store, Serializer &serializer) |
| Converts an MDE storage array to JSON in the nested case. | |
| template<typename Tuple , std::size_t... Is> | |
| Tuple | json_list_to_tuple_internal (const JSON &l, std::index_sequence< Is... >) |
| template<typename Tuple > | |
| Tuple | json_list_to_tuple (const JSON &l) |
| template<typename Serializer , typename MDET > | |
| void | register_storage_from_json_nested (MDET &mde, const JSON &obj, Serializer &serializer) |
Inserts data from the JSON representation to the equivalent C++ data strucure for a PropertySetStorage in the nested case. It needs direct access to the MDE object to use register_set. | |
| template<typename MDET > | |
| void | mde_to_json_internal (MDET &root, JSON &obj, HashSet< void * > &visited, String &path) |
| template<typename MDET > | |
| JSON | mde_to_json (MDET &root) |
| Converts an MDE and its referenced child MDEs to JSON. The individual MDEs are identified using paths starting from the root MDE (the one supplied as a parameter). A depth-first search is performed without any traversals to already visited references. A JSON object is then created using the string paths as the keys referring to each MDE. | |
| template<typename MDET > | |
| void | mde_from_json_internal (MDET &root, const JSON &obj, HashSet< void * > &visited, String &path) |
| template<typename MDET > | |
| void | mde_from_json (MDET &root, const JSON &obj) |
| Loads all data from the supplied JSON object into MDE. | |
| String | json_to_string (const JSON &obj) |
| Returns a string representation of the supplied JSON object. | |
| Vector< uint8_t > | json_to_bson (const JSON &obj) |
| bool | json_to_file (const JSON &obj, const String &file_path) |
| Writes a JSON object to a file. | |
| bool | json_to_file_bson (const JSON &obj, const String &file_path) |
| JSON | load_json_file (const String &file_path) |
| JSON | load_bson_file (const String &file_path) |
| template<typename MDET > | |
| bool | save (const MDET &mde, const String &file_path) |
| template<typename MDET > | |
| bool | save_bson (const MDET &mde, const String &file_path) |
| template<typename MDET > | |
| void | load (MDET &mde, const String &file_path) |
| template<typename MDET > | |
| void | load_bson (MDET &mde, const String &file_path) |
| using mde::slz::JSON = typedef nlohmann::json |
Definition at line 24 of file mde_serialization.hpp.
Inserts data from the JSON representation to the equivalent C++ data strucure for the OperationNode -> integer map.
| [in] | map | a BinaryOperationMap or analogue. |
| [in] | obj | The JSON object. |
Definition at line 87 of file mde_serialization.hpp.
Converts OperationNode -> integer maps to JSON.
| [in] | map | a BinaryOperationMap or analogue. |
Definition at line 70 of file mde_serialization.hpp.
Definition at line 241 of file mde_serialization.hpp.
Definition at line 236 of file mde_serialization.hpp.
Definition at line 390 of file mde_serialization.hpp.
Referenced by json_to_file_bson().
Writes a JSON object to a file.
| [in] | obj | The object |
| [in] | file_path | The file path |
Definition at line 402 of file mde_serialization.hpp.
Referenced by save().
Definition at line 413 of file mde_serialization.hpp.
Referenced by save_bson().
Returns a string representation of the supplied JSON object.
| [in] | obj | The object |
Definition at line 386 of file mde_serialization.hpp.
Definition at line 456 of file mde_serialization.hpp.
Definition at line 461 of file mde_serialization.hpp.
Definition at line 435 of file mde_serialization.hpp.
Referenced by load_bson().
Definition at line 425 of file mde_serialization.hpp.
Referenced by load().
Loads all data from the supplied JSON object into MDE.
| root | The MDE object to load data into. | |
| [in] | obj | The object. |
Definition at line 373 of file mde_serialization.hpp.
Referenced by load(), and load_bson().
| void mde::slz::mde_from_json_internal | ( | MDET & | root, |
| const JSON & | obj, | ||
| HashSet< void * > & | visited, | ||
| String & | path | ||
| ) |
Definition at line 338 of file mde_serialization.hpp.
Referenced by mde_from_json(), and mde_from_json_internal().
Converts an MDE and its referenced child MDEs to JSON. The individual MDEs are identified using paths starting from the root MDE (the one supplied as a parameter). A depth-first search is performed without any traversals to already visited references. A JSON object is then created using the string paths as the keys referring to each MDE.
| root | The MDE object to serialize. |
Definition at line 327 of file mde_serialization.hpp.
Referenced by save(), and save_bson().
| void mde::slz::mde_to_json_internal | ( | MDET & | root, |
| JSON & | obj, | ||
| HashSet< void * > & | visited, | ||
| String & | path | ||
| ) |
Definition at line 287 of file mde_serialization.hpp.
Referenced by mde_to_json(), and mde_to_json_internal().
| void mde::slz::register_storage_from_json | ( | MDET & | mde, |
| const JSON & | obj, | ||
| Serializer & | serializer | ||
| ) |
Inserts data from the JSON representation to the equivalent C++ data strucure for a PropertySetStorage. It needs direct access to the MDE object to use register_set.
| mde | The MDE object | |
| [in] | obj | The JSON representation |
| serializer | The serializer |
Definition at line 181 of file mde_serialization.hpp.
| void mde::slz::register_storage_from_json_nested | ( | MDET & | mde, |
| const JSON & | obj, | ||
| Serializer & | serializer | ||
| ) |
Inserts data from the JSON representation to the equivalent C++ data strucure for a PropertySetStorage in the nested case. It needs direct access to the MDE object to use register_set.
| mde | The MDE object | |
| [in] | obj | The JSON representation |
| serializer | The serializer |
Definition at line 256 of file mde_serialization.hpp.
Definition at line 446 of file mde_serialization.hpp.
Definition at line 451 of file mde_serialization.hpp.
| JSON mde::slz::storage_array_to_json | ( | const StoreT & | store, |
| Serializer & | serializer | ||
| ) |
Converts a storage array to its JSON representation.
| [in] | store | A PropertySetStorage or an analogue. |
| serializer | A serializer structure. |
Definition at line 159 of file mde_serialization.hpp.
| JSON mde::slz::storage_array_to_json_nested | ( | const StoreT & | store, |
| Serializer & | serializer | ||
| ) |
Converts an MDE storage array to JSON in the nested case.
| [in] | store | A PropertySetStorage object or analogue. |
| [in] | serializer | A Serializer object. |
Definition at line 210 of file mde_serialization.hpp.
Inserts data from the JSON representation to the equivalent C++ data strucure for the integer -> integer map.
| [in] | map | a UnaryOperationMap or analogue. |
| [in] | obj | The JSON object. |
Definition at line 133 of file mde_serialization.hpp.