#include <peak_icv/serialization/peak_icv_archive.hpp>

Public Types | |
| enum class | ValueType { Bool , BoolArray , Int , IntArray , Double , DoubleArray , String , StringArray , Archive , ArchiveArray } |
| Enumerates supported value types that can be stored or queried in the archive. More... | |
Public Member Functions | |
| Archive () | |
Constructs an empty Archive instance. | |
| ~Archive () override | |
| Virtual destructor. | |
| Archive (const Archive &)=delete | |
| Archive instances cannot be copied. | |
| Archive & | operator= (const Archive &)=delete |
| Archive instances cannot be copy-assigned. | |
| Archive (Archive &&other) noexcept | |
Constructs an Archive by moving from another instance. | |
| Archive & | operator= (Archive &&other) noexcept |
| Assigns this archive by moving from another instance. | |
| std::shared_ptr< IArchive > | CreateArchive () const override |
| Creates a new archive instance. | |
| bool | HasKey (const std::string &key) const override |
| Checks whether a key exists in the archive. | |
| ValueType | GetValueType (const std::string &key) const override |
| Returns the type of value stored under a key. | |
| std::vector< std::string > | GetKeys () const override |
| Returns all keys stored in the archive. | |
| size_t | GetArrayCount (const std::string &key) const override |
| Retruns the number of elements in an array value. | |
| void | SetBool (const std::string &key, bool value) override |
| Sets a boolean value. | |
| void | SetInt (const std::string &key, int64_t value) override |
| Sets an integer value. | |
| void | SetDouble (const std::string &key, double value) override |
| Sets a double precision floating point value. | |
| void | SetString (const std::string &key, const std::string &value) override |
| Sets a string value. | |
| void | SetArchive (const std::string &key, const std::shared_ptr< IArchive > &value) override |
| Sets a nested archive. | |
| void | SetBoolArray (const std::string &key, const std::vector< bool > &value) override |
| Sets an array of boolean values. | |
| void | SetIntArray (const std::string &key, const std::vector< int64_t > &value) override |
| Sets an array of integer values. | |
| void | SetDoubleArray (const std::string &key, const std::vector< double > &value) override |
| Sets an array of double precision floating point values. | |
| void | SetStringArray (const std::string &key, const std::vector< std::string > &value) override |
| Sets an array of string values. | |
| void | SetArchiveArray (const std::string &key, const std::vector< std::shared_ptr< IArchive > > &value) override |
| Sets an array of nested archives. | |
| bool | GetBool (const std::string &key) const override |
| Returns the boolean value. | |
| int64_t | GetInt (const std::string &key) const override |
| Returns the integer value. | |
| double | GetDouble (const std::string &key) const override |
| Returns the double precision floating point value. | |
| std::string | GetString (const std::string &key) const override |
| Returns the string value. | |
| std::shared_ptr< IArchive > | GetArchive (const std::string &key) const override |
| Returns the nested archive. | |
| std::vector< bool > | GetBoolArray (const std::string &key) const override |
| Returns the array of boolean values. | |
| std::vector< int64_t > | GetIntArray (const std::string &key) const override |
| Returns the array of integer values. | |
| std::vector< double > | GetDoubleArray (const std::string &key) const override |
| Returns the array of double precision floating point values. | |
| std::vector< std::string > | GetStringArray (const std::string &key) const override |
| Returns the array of string values. | |
| std::vector< std::shared_ptr< IArchive > > | GetArchiveArray (const std::string &key) const override |
| Returns the array of nested archives. | |
| virtual void | SetArchive (const std::string &key, const std::shared_ptr< IArchive > &value)=0 |
| Stores a nested archive object. | |
| virtual void | SetArchiveArray (const std::string &key, const std::vector< std::shared_ptr< IArchive > > &value)=0 |
| Stores an array of nested archives. | |
A key-value store that implements the IArchive interface.
The Archive class provides a concrete implementation of a serialization archive that stores data as key-value pairs. It supports various data types including primitives (bool, int64_t, double), strings, nested archives, and arrays of these types.
Example
This class inherits from peak::common::serialization::IArchive.
Definition at line 67 of file peak_icv_archive.hpp.
|
stronginherited |
Enumerates supported value types that can be stored or queried in the archive.
Definition at line 64 of file peak_common_iarchive.hpp.
|
inline |
Constructs an empty Archive instance.
| InvalidConfigurationException | The library is not initialized. |
Definition at line 59 of file peak_icv_archive.ipp.
|
inlineoverride |
Virtual destructor.
Ensures proper cleanup of resources when the archive is destroyed.
Definition at line 70 of file peak_icv_archive.ipp.
Archive instances cannot be copied.
Constructs an Archive by moving from another instance.
| other | The Archive instance to move from. |
Definition at line 78 of file peak_icv_archive.ipp.
|
inlineoverridevirtual |
Creates a new archive instance.
Factory method that creates a new archive wrapped in a shared_ptr.
IArchive instance.Implements IArchive.
Definition at line 149 of file peak_icv_archive.ipp.
|
inlineoverridevirtual |
Returns the nested archive.
| key | The key of the archive to retrieve. |
IArchive instance stored under the specified key.Implements IArchive.
Definition at line 330 of file peak_icv_archive.ipp.
|
inlineoverridevirtual |
Returns the array of nested archives.
| key | The key of the array to retrieve. |
IArchive instances stored under the specified key.Implements IArchive.
Definition at line 454 of file peak_icv_archive.ipp.
|
inlineoverridevirtual |
Retruns the number of elements in an array value.
| key | The key of the array. |
0 if key doesn't exist or is not an array.Implements IArchive.
Definition at line 140 of file peak_icv_archive.ipp.
|
inlineoverridevirtual |
Returns the boolean value.
| key | The key of the value to retrieve. |
Implements IArchive.
Definition at line 268 of file peak_icv_archive.ipp.
|
inlineoverridevirtual |
Returns the array of boolean values.
| key | The key of the array to retrieve. |
Implements IArchive.
Definition at line 341 of file peak_icv_archive.ipp.
|
inlineoverridevirtual |
Returns the double precision floating point value.
| key | The key of the value to retrieve. |
Implements IArchive.
Definition at line 290 of file peak_icv_archive.ipp.
|
inlineoverridevirtual |
Returns the array of double precision floating point values.
| key | The key of the array to retrieve. |
Implements IArchive.
Definition at line 388 of file peak_icv_archive.ipp.
|
inlineoverridevirtual |
Returns the integer value.
| key | The key of the value to retrieve. |
Implements IArchive.
Definition at line 279 of file peak_icv_archive.ipp.
|
inlineoverridevirtual |
Returns the array of integer values.
| key | The key of the array to retrieve. |
Implements IArchive.
Definition at line 368 of file peak_icv_archive.ipp.
|
inlineoverridevirtual |
Returns all keys stored in the archive.
Implements IArchive.
Definition at line 103 of file peak_icv_archive.ipp.
|
inlineoverridevirtual |
Returns the string value.
| key | The key of the value to retrieve. |
Implements IArchive.
Definition at line 301 of file peak_icv_archive.ipp.
|
inlineoverridevirtual |
Returns the array of string values.
| key | The key of the array to retrieve. |
Implements IArchive.
Definition at line 410 of file peak_icv_archive.ipp.
|
inlineoverridevirtual |
Returns the type of value stored under a key.
| key | The key to get query. |
ValueType representing the stored type.Implements IArchive.
Definition at line 93 of file peak_icv_archive.ipp.
|
inlineoverridevirtual |
Checks whether a key exists in the archive.
| key | The key to check. |
true if the key exists, false otherwise.Implements IArchive.
Definition at line 158 of file peak_icv_archive.ipp.
Assigns this archive by moving from another instance.
| other | The Archive instance to move from. |
Definition at line 83 of file peak_icv_archive.ipp.
Archive instances cannot be copy-assigned.
|
pure virtualinherited |
Stores a nested archive object.
|
inlineoverride |
Sets a nested archive.
| key | The key under which to store the archive. |
| value | A shared pointer to the IArchive instance to store. |
Definition at line 196 of file peak_icv_archive.ipp.
|
pure virtualinherited |
Stores an array of nested archives.
|
inlineoverride |
Sets an array of nested archives.
| key | The key under which to store the array. |
| value | The vector of shared pointers to IArchive instances to store. |
Definition at line 250 of file peak_icv_archive.ipp.
|
inlineoverridevirtual |
Sets a boolean value.
| key | The key under which to store the value. |
| value | The boolean value to store. |
Implements IArchive.
Definition at line 168 of file peak_icv_archive.ipp.
|
inlineoverridevirtual |
Sets an array of boolean values.
| key | The key under which to store the array. |
| value | The vector of boolean values to store. |
Implements IArchive.
Definition at line 208 of file peak_icv_archive.ipp.
|
inlineoverridevirtual |
Sets a double precision floating point value.
| key | The key under which to store the value. |
| value | The double value to store. |
Implements IArchive.
Definition at line 182 of file peak_icv_archive.ipp.
|
inlineoverridevirtual |
Sets an array of double precision floating point values.
| key | The key under which to store the array. |
| value | The vector of double values to store. |
Implements IArchive.
Definition at line 230 of file peak_icv_archive.ipp.
|
inlineoverridevirtual |
Sets an integer value.
| key | The key under which to store the value. |
| value | The 64-bit integer value to store. |
Implements IArchive.
Definition at line 175 of file peak_icv_archive.ipp.
|
inlineoverridevirtual |
Sets an array of integer values.
| key | The key under which to store the array. |
| value | The vector of 64-bit integer values to store. |
Implements IArchive.
Definition at line 223 of file peak_icv_archive.ipp.
|
inlineoverridevirtual |
Sets a string value.
| key | The key under which to store the value. |
| value | The string value to store. |
Implements IArchive.
Definition at line 189 of file peak_icv_archive.ipp.
|
inlineoverridevirtual |
Sets an array of string values.
| key | The key under which to store the array. |
| value | The vector of string values to store. |
Implements IArchive.
Definition at line 237 of file peak_icv_archive.ipp.