22#include <peak_icv_c/serialization/peak_icv_archive.h>
152 void SetBool(
const std::string& key,
bool value)
override;
161 void SetInt(
const std::string& key, int64_t value)
override;
170 void SetDouble(
const std::string& key,
double value)
override;
179 void SetString(
const std::string& key,
const std::string& value)
override;
188 void SetArchive(
const std::string& key,
const std::shared_ptr<IArchive>& value)
override;
197 void SetBoolArray(
const std::string& key,
const std::vector<bool>& value)
override;
206 void SetIntArray(
const std::string& key,
const std::vector<int64_t>& value)
override;
215 void SetDoubleArray(
const std::string& key,
const std::vector<double>& value)
override;
224 void SetStringArray(
const std::string& key,
const std::vector<std::string>& value)
override;
233 void SetArchiveArray(
const std::string& key,
const std::vector<std::shared_ptr<IArchive>>& value)
override;
328 friend peak::common::detail::BackendAccessor<Archive>;
330 explicit Archive(peak_icv_archive_handle handle);
337 peak_icv_archive_handle m_handle{};
Interface for a hierarchical key-value archive system.
ValueType
Enumerates supported value types that can be stored or queried in the archive.
A simple key-value store that implements the IArchive interface.
std::vector< int64_t > GetIntArray(const std::string &key) const override
Gets an array of integer values.
std::vector< std::shared_ptr< IArchive > > GetArchiveArray(const std::string &key) const override
Gets an array of nested archive values.
void SetBoolArray(const std::string &key, const std::vector< bool > &value) override
Sets an array of boolean values.
double GetDouble(const std::string &key) const override
Gets a double precision floating point value.
void SetDouble(const std::string &key, double value) override
Sets a double precision floating point value.
Archive(const Archive &)=delete
Deleted copy constructor.
std::string GetString(const std::string &key) const override
Gets a string value.
void SetInt(const std::string &key, int64_t value) override
Sets an integer value.
std::shared_ptr< IArchive > GetArchive(const std::string &key) const override
Gets a nested archive value.
std::vector< std::string > GetStringArray(const std::string &key) const override
Gets an array of string values.
std::vector< double > GetDoubleArray(const std::string &key) const override
Gets an array of double precision floating point values.
void SetString(const std::string &key, const std::string &value) override
Sets a string value.
void SetIntArray(const std::string &key, const std::vector< int64_t > &value) override
Sets an array of integer values.
Archive & operator=(const Archive &)=delete
Deleted copy assignment operator.
void SetArchive(const std::string &key, const std::shared_ptr< IArchive > &value) override
Sets a nested archive value.
int64_t GetInt(const std::string &key) const override
Gets an integer value.
bool GetBool(const std::string &key) const override
Gets a boolean value.
size_t GetArrayCount(const std::string &key) const override
Gets the count of elements in an array value.
ValueType GetValueType(const std::string &key) const override
Gets the type of value stored under a key.
void SetStringArray(const std::string &key, const std::vector< std::string > &value) override
Sets an array of string values.
~Archive() override
Virtual destructor.
std::shared_ptr< IArchive > CreateArchive() const override
Creates a new Archive instance.
std::vector< std::string > GetKeys() const override
Gets all keys stored in the archive.
std::vector< bool > GetBoolArray(const std::string &key) const override
Gets an array of boolean values.
Archive()
Default constructor.
bool HasKey(const std::string &key) const override
Checks if a key exists in the archive.
void SetBool(const std::string &key, bool value) override
Sets a boolean value.
void SetDoubleArray(const std::string &key, const std::vector< double > &value) override
Sets an array of double precision floating point values.
void SetArchiveArray(const std::string &key, const std::vector< std::shared_ptr< IArchive > > &value) override
Sets an array of nested archive values.
#define PEAK_COMMON_NO_DISCARD
Compatability macro for the nodiscard attribute.