Generic storage for plugin parameters. Allows to store map of parameters with different types (OpenAB::Variant). Additionally allow for serialization and deserialization to/from JSON format.
More...
#include <GenericParameters.hpp>
Generic storage for plugin parameters. Allows to store map of parameters with different types (OpenAB::Variant). Additionally allow for serialization and deserialization to/from JSON format.
OpenAB_Plugin::GenericParameters::GenericParameters |
( |
| ) |
|
OpenAB_Plugin::GenericParameters::GenericParameters |
( |
const std::string & |
json | ) |
|
Deserializes parameters from JSON sting.
- Parameters
-
[in] | json | JSON string to deserialize from. |
OpenAB_Plugin::GenericParameters::~GenericParameters |
( |
| ) |
|
|
virtual |
Destructor, virtual by default.
bool OpenAB_Plugin::GenericParameters::fromJSON |
( |
const std::string & |
json | ) |
|
|
virtual |
Deserializes parameters from JSON string.
- Note
- all previous contents of parameters will be removed.
- Parameters
-
[in] | json | JSON string to deserialize from. |
- Returns
- true if deserialization was successful, false otherwise.
Implements OpenAB_Plugin::Parameters.
std::vector< std::string > OpenAB_Plugin::GenericParameters::getAllKeys |
( |
| ) |
const |
Returns list of all keys. list of all keys.
OpenAB::Variant OpenAB_Plugin::GenericParameters::getValue |
( |
const std::string & |
key | ) |
const |
void OpenAB_Plugin::GenericParameters::removeKey |
( |
const std::string & |
key | ) |
|
Removes key and its assigned value.
- Parameters
-
void OpenAB_Plugin::GenericParameters::setValue |
( |
const std::string & |
key, |
|
|
const OpenAB::Variant & |
value |
|
) |
| |
Assigns or updates value to/of given key.
- Parameters
-
[in] | key | key to create/modify |
[in] | value | new value |
std::string OpenAB_Plugin::GenericParameters::toJSON |
( |
| ) |
const |
|
virtual |
Serializes parameters to JSON string.
- Returns
- JSON string if serialization was successful or empty string otherwise.
Implements OpenAB_Plugin::Parameters.
The documentation for this class was generated from the following files: