YAMI4 C++ Library 2.0.0
Messaging Solution for Distributed Systems
|
Collection of message parameters. More...
#include <parameters.h>
Classes | |
class | iterator |
Iterator class for inspecting entries in the collection. More... | |
Public Member Functions | |
parameters () | |
Constructor. More... | |
parameters (core::parameters *external) | |
Constructor. More... | |
parameters (const parameters &other) | |
Copy constructor. | |
void | operator= (const parameters &other) |
Assignment operator. | |
void | swap (parameters &other) |
Swap operation. More... | |
~parameters () | |
Destructor. More... | |
void | set_boolean (const std::string &name, bool value) |
Inserts new entry of type bool. More... | |
void | set_boolean (const char *name, bool value) |
bool | get_boolean (const std::string &name) const |
Extracts the bool value from the given entry. More... | |
bool | get_boolean (const char *name) const |
void | set_integer (const std::string &name, int value) |
Inserts new entry of type int. More... | |
void | set_integer (const char *name, int value) |
int | get_integer (const std::string &name) const |
Extracts the int value from the given entry. More... | |
int | get_integer (const char *name) const |
void | set_long_long (const std::string &name, long long value) |
Inserts new entry of type long long. More... | |
void | set_long_long (const char *name, long long value) |
long long | get_long_long (const std::string &name) const |
Extracts the long long value from the given entry. More... | |
long long | get_long_long (const char *name) const |
void | set_word (const std::string &name, unsigned int value) |
Inserts new entry of type unsigned int. More... | |
void | set_word (const char *name, unsigned int value) |
unsigned int | get_word (const std::string &name) const |
Extracts the unsigned int value from the given entry. More... | |
unsigned int | get_word (const char *name) const |
void | set_long_long_word (const std::string &name, unsigned long long value) |
Inserts new entry of type unsigned long long. More... | |
void | set_long_long_word (const char *name, unsigned long long value) |
unsigned long long | get_long_long_word (const std::string &name) const |
Extracts the unsigned long long value from the given entry. More... | |
unsigned long long | get_long_long_word (const char *name) const |
void | set_double_float (const std::string &name, double value) |
Inserts new entry of type double. More... | |
void | set_double_float (const char *name, double value) |
double | get_double_float (const std::string &name) const |
Extracts the double value from the given entry. More... | |
double | get_double_float (const char *name) const |
void | set_string (const std::string &name, const std::string &value) |
Inserts new entry of type string. More... | |
void | set_string (const char *name, const char *value) |
void | set_string_shallow (const std::string &name, const char *value, std::size_t value_length) |
Inserts new entry of type string. More... | |
void | set_string_shallow (const char *name, std::size_t name_length, const char *value, std::size_t value_length) |
std::string | get_string (const std::string &name) const |
Extracts the string value from the given entry. More... | |
std::string | get_string (const char *name) const |
const char * | get_string (const std::string &name, std::size_t &length) const |
Extracts the string value from the given entry. More... | |
const char * | get_string (const char *name, std::size_t &length) const |
void | set_binary (const std::string &name, const void *value, std::size_t value_length) |
Inserts new entry of type binary. More... | |
void | set_binary (const char *name, const void *value, std::size_t value_length) |
void | set_binary_shallow (const std::string &name, const void *value, std::size_t value_length) |
Inserts new entry of type binary. More... | |
void | set_binary_shallow (const char *name, std::size_t name_length, const void *value, std::size_t value_length) |
const void * | get_binary (const std::string &name, std::size_t &length) const |
Extracts the binary value from the given entry. More... | |
const void * | get_binary (const char *name, std::size_t &length) const |
void | set_boolean_array (const std::string &name, const bool *values, std::size_t array_length) |
Inserts new entry of type bool array. More... | |
void | set_boolean_array (const char *name, const bool *values, std::size_t array_length) |
void | set_boolean_array_shallow (const std::string &name, const bool *values, std::size_t array_length) |
Inserts new entry of type bool array. More... | |
void | set_boolean_array_shallow (const char *name, const bool *values, std::size_t array_length) |
bool * | get_boolean_array (const std::string &name, std::size_t &array_length) const |
Extracts the array of bool values from the given entry. More... | |
bool * | get_boolean_array (const char *name, std::size_t &array_length) const |
void | set_integer_array (const std::string &name, const int *values, std::size_t array_length) |
Inserts new entry of type int array. More... | |
void | set_integer_array (const char *name, const int *values, std::size_t array_length) |
void | set_integer_array_shallow (const std::string &name, const int *values, std::size_t array_length) |
Inserts new entry of type int array. More... | |
void | set_integer_array_shallow (const char *name, const int *values, std::size_t array_length) |
int * | get_integer_array (const std::string &name, std::size_t &array_length) const |
Extracts the array of int values from the given entry. More... | |
int * | get_integer_array (const char *name, std::size_t &array_length) const |
void | set_long_long_array (const std::string &name, const long long *values, std::size_t array_length) |
Inserts new entry of type long long array. More... | |
void | set_long_long_array (const char *name, const long long *values, std::size_t array_length) |
void | set_long_long_array_shallow (const std::string &name, const long long *values, std::size_t array_length) |
Inserts new entry of type long long array. More... | |
void | set_long_long_array_shallow (const char *name, const long long *values, std::size_t array_length) |
long long * | get_long_long_array (const std::string &name, std::size_t &array_length) const |
Extracts the array of long long values from the given entry. More... | |
long long * | get_long_long_array (const char *name, std::size_t &array_length) const |
void | set_word_array (const std::string &name, const unsigned int *values, std::size_t array_length) |
Inserts new entry of type unsigned int array. More... | |
void | set_word_array (const char *name, const unsigned int *values, std::size_t array_length) |
void | set_word_array_shallow (const std::string &name, const unsigned int *values, std::size_t array_length) |
Inserts new entry of type unsigned int array. More... | |
void | set_word_array_shallow (const char *name, const unsigned int *values, std::size_t array_length) |
unsigned int * | get_word_array (const std::string &name, std::size_t &array_length) const |
Extracts the array of unsigned int values from the given entry. More... | |
unsigned int * | get_word_array (const char *name, std::size_t &array_length) const |
void | set_long_long_word_array (const std::string &name, const unsigned long long *values, std::size_t array_length) |
Inserts new entry of type unsigned long long array. More... | |
void | set_long_long_word_array (const char *name, const unsigned long long *values, std::size_t array_length) |
void | set_long_long_word_array_shallow (const std::string &name, const unsigned long long *values, std::size_t array_length) |
Inserts new entry of type unsigned long long array. More... | |
void | set_long_long_word_array_shallow (const char *name, const unsigned long long *values, std::size_t array_length) |
unsigned long long * | get_long_long_word_array (const std::string &name, std::size_t &array_length) const |
Extracts the array of unsigned long long values from the given entry. More... | |
unsigned long long * | get_long_long_word_array (const char *name, std::size_t &array_length) const |
void | set_double_float_array (const std::string &name, const double *values, std::size_t array_length) |
Inserts new entry of type double array. More... | |
void | set_double_float_array (const char *name, const double *values, std::size_t array_length) |
void | set_double_float_array_shallow (const std::string &name, const double *values, std::size_t array_length) |
Inserts new entry of type double array. More... | |
void | set_double_float_array_shallow (const char *name, const double *values, std::size_t array_length) |
double * | get_double_float_array (const std::string &name, std::size_t &array_length) const |
Extracts the array of double values from the given entry. More... | |
double * | get_double_float_array (const char *name, std::size_t &array_length) const |
void | create_string_array (const std::string &name, std::size_t array_length) |
Creates new empty entry of type string array. More... | |
void | create_string_array (const char *name, std::size_t array_length) |
void | set_string_in_array (const std::string &name, std::size_t index, const std::string &value) |
Inserts new string value to string array. More... | |
void | set_string_in_array (const char *name, std::size_t index, const char *value) |
std::size_t | get_string_array_length (const std::string &name) const |
Extracts the length of string array. More... | |
std::size_t | get_string_array_length (const char *name) const |
std::string | get_string_in_array (const std::string &name, std::size_t index) const |
Extracts string value from string array. More... | |
std::string | get_string_in_array (const char *name, std::size_t index) const |
const char * | get_string_in_array (const std::string &name, std::size_t index, std::size_t &length) const |
Extracts string value from string array. More... | |
const char * | get_string_in_array (const char *name, std::size_t index, std::size_t &length) const |
void | create_binary_array (const std::string &name, std::size_t array_length) |
Creates new empty entry of type binary array. More... | |
void | create_binary_array (const char *name, std::size_t array_length) |
void | set_binary_in_array (const std::string &name, std::size_t index, const void *value, std::size_t value_length) |
Inserts new binary value to binary array. More... | |
void | set_binary_in_array (const char *name, std::size_t index, const void *value, std::size_t value_length) |
std::size_t | get_binary_array_length (const std::string &name) const |
Extracts the length of binary array. More... | |
std::size_t | get_binary_array_length (const char *name) const |
const void * | get_binary_in_array (const std::string &name, std::size_t index, std::size_t &length) const |
Extracts binary value from binary array. More... | |
const void * | get_binary_in_array (const char *name, std::size_t index, std::size_t &length) const |
core::parameters * | create_nested_parameters (const std::string &name) |
Creates nested parameters entry. More... | |
core::parameters * | create_nested_parameters (const char *name) |
core::parameters * | get_nested_parameters (const std::string &name) const |
Extracts the nested parameters object from the given entry. More... | |
core::parameters * | get_nested_parameters (const char *name) const |
void | create_nested_array (const std::string &name, std::size_t array_length) |
Creates nested parameters array entry. More... | |
void | create_nested_array (const char *name, std::size_t array_length) |
std::size_t | get_nested_array_length (const std::string &name) const |
Extracts the length of nested parameters array. More... | |
std::size_t | get_nested_array_length (const char *name) const |
core::parameters * | get_nested_in_array (const std::string &name, std::size_t index) const |
Extracts nested parameters value from nested array. More... | |
core::parameters * | get_nested_in_array (const char *name, std::size_t index) const |
std::size_t | size () const |
Returns the size of the collection. More... | |
parameter_type | type (const std::string &name) const |
Extracts the type of the given entry. More... | |
parameter_type | type (const char *name) const |
iterator | begin () const |
Extracts the starting iterator for this collection. More... | |
iterator | end () const |
Extracts the ending iterator for this collection. More... | |
bool | find (const std::string &name, parameter_entry &entry) const |
Finds the given entry. More... | |
bool | find (const char *name, parameter_entry &entry) const |
void | remove (const std::string &name) |
Removes the given entry. More... | |
void | remove (const char *name) |
void | remove (iterator it) |
Removes the entry given by its iterator. More... | |
void | merge_from (const parameters &other) |
Merges entries from the given parameters object. More... | |
void | clear () |
Clears the collection of entries. More... | |
virtual std::size_t | serialize_buffer_size () const |
Returns the total size of serialization buffer. More... | |
virtual void | serialize (char **buffers, std::size_t *buffer_sizes, std::size_t num_of_buffers) const |
Serializes current content into given buffer(s). More... | |
void | deserialize (const char **buffers, std::size_t *buffer_sizes, std::size_t num_of_buffers) |
Deserializes from the given buffer(s). More... | |
virtual const core::parameters & | get_core_object () const |
Provides access to the underlying core object. More... | |
void | dump (std::ostream &os) const |
virtual std::size_t | serialize_buffer_size () const =0 |
Returns the total size of serialization buffer. More... | |
virtual void | serialize (char **buffers, std::size_t *buffer_sizes, std::size_t num_of_buffers) const =0 |
Serializes current content into given buffer(s). More... | |
virtual const core::serializable & | get_core_object () const =0 |
Provides access to the underlying core object. More... | |
Collection of message parameters.
The collection of message parameters, which are typed {name, value} pairs.
Each entry in this collection has a unique name and can have one of the following types:
This class is not thread-safe, although distinct instances of this class can be used by different threads without synchronization.
Note: The entries are ordered - the order in which they are created influences the final serialized form of the message payload.
Newly created entries are appended to the end of the collection unless there is an existing empty slot that can be reused - the appropriate slot is searched for from the beginning to the end of the collection and if no free slot is found the collection is extended at the end.
The above guarantee concerns the user code that relies on predictable serialization.
Note: For each function that accepts const std::string &
parameter there is also an overloaded function accepting const char *
. These additional functions are provided to make it more natural to use strings by pointer or as a hard-code literals. They have exactly the same functionality and are therefore not separately documented.
yami::parameters::parameters | ( | ) |
Constructor.
Creates an empty parameters object.
|
explicit |
Constructor.
Constructor, allows to wrap existing object from the core part of the YAMI library. The wrapped core object is not owned.
|
inline |
Destructor.
The destructor cleans all dependent resources.
iterator yami::parameters::begin | ( | ) | const |
Extracts the starting iterator for this collection.
Extracts the iterator pointing to the beginning of the collection, which means the first used slot.
void yami::parameters::clear | ( | ) |
Clears the collection of entries.
Clears the collection of entries and deallocates dependent structures. After executing the state of this object is as it was immediately after construction.
void yami::parameters::create_binary_array | ( | const std::string & | name, |
std::size_t | array_length | ||
) |
Creates new empty entry of type binary array.
Creates a new empty entry of type binary array. If the entry with the given name already exists it is replaced without changing the order of entries.
name | Name of the new entry or the entry to be replaced. |
array_length | Length of the newly created array. |
Note: After creation the array contains empty binaries (that is, binaries which length is 0).
void yami::parameters::create_nested_array | ( | const std::string & | name, |
std::size_t | array_length | ||
) |
Creates nested parameters array entry.
Creates a new nested parameters array entry. If the entry with the given name already exists it is replaced without changing the order of entries.
name | Name of the new entry or the entry to be replaced. |
array_length | Length of the newly created array. |
ok
if operation was successfulno_memory
if the new entry cannot be allocatedNote: After creation the array contains empty nested objects (that is, parameters objects which do not have any entries).
core::parameters * yami::parameters::create_nested_parameters | ( | const std::string & | name | ) |
Creates nested parameters entry.
Creates a new nested parameters entry in the first available slot. If the entry with the given name already exists it is replaced without changing the order of entries.
name | Name of the new entry or the entry to be replaced. |
parameters
object. void yami::parameters::create_string_array | ( | const std::string & | name, |
std::size_t | array_length | ||
) |
Creates new empty entry of type string array.
Creates a new empty entry of type string array. If the entry with the given name already exists it is replaced without changing the order of entries.
name | Name of the new entry or the entry to be replaced. |
array_length | Length of the newly created array. |
Note: After creation the array contains empty strings (that is, strings which length is 0).
void yami::parameters::deserialize | ( | const char ** | buffers, |
std::size_t * | buffer_sizes, | ||
std::size_t | num_of_buffers | ||
) |
Deserializes from the given buffer(s).
Deserializes content from the given buffer(s). The data buffer does not have to be contiguous and any number of buffer segments is allowed, provided that the size of each buffer segment is a multiple of 4 (32 bits).
The function gathers the serialized data from subsequent buffers as they are consumed.
The buffers are provided as array of buffer pointers and their sizes.
buffers | Pointer to the array of buffer pointers (each of type const char * ). |
buffer_sizes | Pointer to the array of buffer sizes. |
num_of_buffers | Number of buffers described by the array. |
Note: The current content of this object is not cleared before attempting deserialization and each retrieved data element is merged into the current content as if done by individual calls to appropriate set_XYZ
functions.
In most cases deserialization will be performed to the empty parameters object (to reconstruct it to the form that was used for serialization), but deserialization onto non-empty object might be occasionally useful as a way of merging two collections.
iterator yami::parameters::end | ( | ) | const |
Extracts the ending iterator for this collection.
Extracts the iterator pointing past the end of the collection.
bool yami::parameters::find | ( | const std::string & | name, |
parameter_entry & | entry | ||
) | const |
Finds the given entry.
Extracts the view on the entry specified by its name.
name | Name of the entry. |
entry | The entry view to be returned. |
true
if the entry has been foundfalse
if the given name cannot be found const void * yami::parameters::get_binary | ( | const std::string & | name, |
std::size_t & | length | ||
) | const |
Extracts the binary value from the given entry.
Extracts the binary value from the entry given by its name by accessing the buffer directly.
name | Name of the entry. |
length | Length of the internal buffer. |
std::size_t yami::parameters::get_binary_array_length | ( | const std::string & | name | ) | const |
Extracts the length of binary array.
Extracts the length of binary array that is located at the given entry.
name | Name of the entry containing binary array. |
const void * yami::parameters::get_binary_in_array | ( | const std::string & | name, |
std::size_t | index, | ||
std::size_t & | length | ||
) | const |
Extracts binary value from binary array.
Extracts the binary value from the given index of binary array by accessing the internal buffer directly.
name | Name of the entry containing binary array. |
index | The array index (array slot to be read, starting from 0). |
length | Length of the value buffer. |
bool yami::parameters::get_boolean | ( | const std::string & | name | ) | const |
Extracts the bool value from the given entry.
Extracts the bool value from the entry given by its name.
name | Name of the entry. |
bool * yami::parameters::get_boolean_array | ( | const std::string & | name, |
std::size_t & | array_length | ||
) | const |
Extracts the array of bool values from the given entry.
Extracts the array of bool values from the entry given by its name.
name | Name of the entry. |
array_length | Length of the internal array. |
Note: this function gives read-write access to the underlying array, even if it was set as a shallow-copy.
|
virtual |
Provides access to the underlying core object.
Implements yami::serializable.
double yami::parameters::get_double_float | ( | const std::string & | name | ) | const |
Extracts the double value from the given entry.
Extracts the double value from the entry given by its name.
name | Name of the entry. |
double * yami::parameters::get_double_float_array | ( | const std::string & | name, |
std::size_t & | array_length | ||
) | const |
Extracts the array of double values from the given entry.
Extracts the array of double values from the entry given by its name.
name | Name of the entry. |
array_length | Length of the internal array. |
Note: this function gives read-write access to the underlying array, even if it was set as a shallow-copy.
int yami::parameters::get_integer | ( | const std::string & | name | ) | const |
Extracts the int value from the given entry.
Extracts the int value from the entry given by its name.
name | Name of the entry. |
int * yami::parameters::get_integer_array | ( | const std::string & | name, |
std::size_t & | array_length | ||
) | const |
Extracts the array of int values from the given entry.
Extracts the array of int values from the entry given by its name.
name | Name of the entry. |
array_length | Length of the internal array. |
Note: this function gives read-write access to the underlying array, even if it was set as a shallow-copy.
long long yami::parameters::get_long_long | ( | const std::string & | name | ) | const |
Extracts the long long value from the given entry.
Extracts the long long value from the entry given by its name.
name | Name of the entry. |
long long * yami::parameters::get_long_long_array | ( | const std::string & | name, |
std::size_t & | array_length | ||
) | const |
Extracts the array of long long values from the given entry.
Extracts the array of long long values from the entry given by its name.
name | Name of the entry. |
array_length | Length of the internal array. |
Note: this function gives read-write access to the underlying array, even if it was set as a shallow-copy.
unsigned long long yami::parameters::get_long_long_word | ( | const std::string & | name | ) | const |
Extracts the unsigned long long value from the given entry.
Extracts the unsigned long long value from the entry given by its name.
name | Name of the entry. |
unsigned long long * yami::parameters::get_long_long_word_array | ( | const std::string & | name, |
std::size_t & | array_length | ||
) | const |
Extracts the array of unsigned long long values from the given entry.
Extracts the array of unsigned long long values from the entry given by its name.
name | Name of the entry. |
array_length | Length of the internal array. |
Note: this function gives read-write access to the underlying array, even if it was set as a shallow-copy.
std::size_t yami::parameters::get_nested_array_length | ( | const std::string & | name | ) | const |
Extracts the length of nested parameters array.
Extracts the length of nested parameters array that is located at the given entry.
name | Name of the entry containing nested parameters array. |
core::parameters * yami::parameters::get_nested_in_array | ( | const std::string & | name, |
std::size_t | index | ||
) | const |
Extracts nested parameters value from nested array.
Extracts the nested parameters value from the given index of nested array.
name | Name of the entry containing nested parameters array. |
index | The array index (array slot to be read, starting from 0). |
parameters
object. core::parameters * yami::parameters::get_nested_parameters | ( | const std::string & | name | ) | const |
Extracts the nested parameters object from the given entry.
Extracts nested parameters from the entry given by its name.
name | Name of the entry. |
parameters
object. std::string yami::parameters::get_string | ( | const std::string & | name | ) | const |
Extracts the string value from the given entry.
Extracts the string value from the entry given by its name.
name | Name of the entry. |
const char * yami::parameters::get_string | ( | const std::string & | name, |
std::size_t & | length | ||
) | const |
Extracts the string value from the given entry.
Extracts the string value from the entry given by its name by accessing the buffer directly.
name | Name of the entry. |
length | Length of the internal buffer. |
std::size_t yami::parameters::get_string_array_length | ( | const std::string & | name | ) | const |
Extracts the length of string array.
Extracts the length of string array that is located at the given entry.
name | Name of the entry containing string array. |
std::string yami::parameters::get_string_in_array | ( | const std::string & | name, |
std::size_t | index | ||
) | const |
Extracts string value from string array.
Extracts the string value from the given index of string array.
name | Name of the entry containing string array. |
index | The array index (array slot to be read, starting from 0). |
const char * yami::parameters::get_string_in_array | ( | const std::string & | name, |
std::size_t | index, | ||
std::size_t & | length | ||
) | const |
Extracts string value from string array.
Extracts the string value from the given index of string array by accessing the internal buffer directly.
name | Name of the entry containing string array. |
index | The array index (array slot to be read, starting from 0). |
length | Length of the value buffer. |
unsigned int yami::parameters::get_word | ( | const std::string & | name | ) | const |
Extracts the unsigned int value from the given entry.
Extracts the unsigned int value from the entry given by its name.
name | Name of the entry. |
unsigned int * yami::parameters::get_word_array | ( | const std::string & | name, |
std::size_t & | array_length | ||
) | const |
Extracts the array of unsigned int values from the given entry.
Extracts the array of unsigned int values from the entry given by its name.
name | Name of the entry. |
array_length | Length of the internal array. |
Note: this function gives read-write access to the underlying array, even if it was set as a shallow-copy.
void yami::parameters::merge_from | ( | const parameters & | other | ) |
Merges entries from the given parameters object.
Merges the entries from another parameters object. The merged entries can have the same names, in which case the new entries replace existing ones. The merging is deep in the sense that no data is shared between this and other object after the merge - this applies also to those entries that were shallow references in the other object.
other | The object to be merged into this object. |
void yami::parameters::remove | ( | const std::string & | name | ) |
Removes the given entry.
Removes the entry given by its name.
name | Name of the entry to remove. |
Note: The removed entry leaves a hole (empty slot) in the collection that can be reused by newly added entries.
void yami::parameters::remove | ( | iterator | it | ) |
Removes the entry given by its iterator.
Removes the entry given by its iterator.
it | Iterator pointing to the entry to remove. |
Note: The removed entry leaves a hole (empty slot) in the collection that can be reused by newly added entries.
|
virtual |
Serializes current content into given buffer(s).
Serializes the current content of this object into the given buffer(s). The serialization buffer does not have to be contiguous and any number of buffer segments is allowed, provided that the size of each buffer segment is a multiple of 4 (32 bits).
The function scatters the serialized data into subsequent buffers as they become filled.
The buffers are provided as array of buffer pointers and their sizes.
buffers | Pointer to the array of buffer pointers (each of type char * ). |
buffer_sizes | Pointer to the array of buffer sizes. |
num_of_buffers | Number of buffers described by the array. |
Implements yami::serializable.
|
virtual |
Returns the total size of serialization buffer.
Computes the total size of serialization buffer(s) for the current content of this object.
Implements yami::serializable.
void yami::parameters::set_binary | ( | const std::string & | name, |
const void * | value, | ||
std::size_t | value_length | ||
) |
Inserts new entry of type binary.
Inserts a new entry of type binary to the first available slot. If the entry with the given name already exists it is replaced without changing the order of entries.
name | Name of the new entry or the entry to be replaced. |
value | Value to be set. |
value_length | Length of the value buffer. |
void yami::parameters::set_binary_in_array | ( | const std::string & | name, |
std::size_t | index, | ||
const void * | value, | ||
std::size_t | value_length | ||
) |
Inserts new binary value to binary array.
Inserts a new binary value (possibly replacing the old one) to already existing binary array at the given index.
name | Name of the entry containing string array. |
index | The array index (array slot, starting from 0). |
value | Pointer to the value buffer to be set. |
value_length | Length of the value buffer. |
Note: The value is copied to the internal buffer.
void yami::parameters::set_binary_shallow | ( | const std::string & | name, |
const void * | value, | ||
std::size_t | value_length | ||
) |
Inserts new entry of type binary.
Inserts a new entry of type binary to the first available slot. If the entry with the given name already exists it is replaced without changing the order of entries.
name | Name of the new entry or the entry to be replaced. |
value | Pointer to the value buffer to be set. The buffer can contain zeros. |
value_length | Length of the value buffer. |
Note: The value is not copied to the internal buffer and the user has to ensure that the given buffer is valid as long as this object refers to it.
void yami::parameters::set_boolean | ( | const std::string & | name, |
bool | value | ||
) |
Inserts new entry of type bool.
Inserts a new entry of type bool to the first available slot. If the entry with the given name already exists it is replaced without changing the order of entries.
name | Name of the new entry or the entry to be replaced. |
value | Value to be set. |
void yami::parameters::set_boolean_array | ( | const std::string & | name, |
const bool * | values, | ||
std::size_t | array_length | ||
) |
Inserts new entry of type bool array.
Inserts a new entry of type bool array to the first available slot. If the entry with the given name already exists it is replaced without changing the order of entries.
name | Name of the new entry or the entry to be replaced. |
values | Pointer to the array of values to be set. |
array_length | Length of the array of values. |
Note: The array of values is copied to the internal buffer.
void yami::parameters::set_boolean_array_shallow | ( | const std::string & | name, |
const bool * | values, | ||
std::size_t | array_length | ||
) |
Inserts new entry of type bool array.
Inserts a new entry of type bool array to the first available slot. If the entry with the given name already exists it is replaced without changing the order of entries.
name | Name of the new entry or the entry to be replaced. |
values | Pointer to the array of values to be set. |
array_length | Length of the array of values. |
Note: The array of values is not copied to the internal buffer and the user has to ensure that the given buffer is valid as long as this object refers to it.
void yami::parameters::set_double_float | ( | const std::string & | name, |
double | value | ||
) |
Inserts new entry of type double.
Inserts a new entry of type double to the first available slot. If the entry with the given name already exists it is replaced without changing the order of entries.
name | Name of the new entry or the entry to be replaced. |
value | Value to be set. |
void yami::parameters::set_double_float_array | ( | const std::string & | name, |
const double * | values, | ||
std::size_t | array_length | ||
) |
Inserts new entry of type double array.
Inserts a new entry of type double array to the first available slot. If the entry with the given name already exists it is replaced without changing the order of entries.
name | Name of the new entry or the entry to be replaced. |
values | Pointer to the array of values to be set. |
array_length | Length of the array of values. |
Note: The array of values is copied to the internal buffer.
void yami::parameters::set_double_float_array_shallow | ( | const std::string & | name, |
const double * | values, | ||
std::size_t | array_length | ||
) |
Inserts new entry of type double array.
Inserts a new entry of type double array to the first available slot. If the entry with the given name already exists it is replaced without changing the order of entries.
name | Name of the new entry or the entry to be replaced. |
values | Pointer to the array of values to be set. |
array_length | Length of the array of values. |
Note: The array of values is not copied to the internal buffer and the user has to ensure that the given buffer is valid as long as this object refers to it.
void yami::parameters::set_integer | ( | const std::string & | name, |
int | value | ||
) |
Inserts new entry of type int.
Inserts a new entry of type int to the first available slot. If the entry with the given name already exists it is replaced without changing the order of entries.
name | Name of the new entry or the entry to be replaced. |
value | Value to be set. |
void yami::parameters::set_integer_array | ( | const std::string & | name, |
const int * | values, | ||
std::size_t | array_length | ||
) |
Inserts new entry of type int array.
Inserts a new entry of type int array to the first available slot. If the entry with the given name already exists it is replaced without changing the order of entries.
name | Name of the new entry or the entry to be replaced. |
values | Pointer to the array of values to be set. |
array_length | Length of the array of values. |
Note: The array of values is copied to the internal buffer.
void yami::parameters::set_integer_array_shallow | ( | const std::string & | name, |
const int * | values, | ||
std::size_t | array_length | ||
) |
Inserts new entry of type int array.
Inserts a new entry of type int array to the first available slot. If the entry with the given name already exists it is replaced without changing the order of entries.
name | Name of the new entry or the entry to be replaced. |
values | Pointer to the array of values to be set. |
array_length | Length of the array of values. |
Note: The array of values is not copied to the internal buffer and the user has to ensure that the given buffer is valid as long as this object refers to it.
void yami::parameters::set_long_long | ( | const std::string & | name, |
long long | value | ||
) |
Inserts new entry of type long long.
Inserts a new entry of type long long to the first available slot. If the entry with the given name already exists it is replaced without changing the order of entries.
name | Name of the new entry or the entry to be replaced. |
value | Value to be set. |
void yami::parameters::set_long_long_array | ( | const std::string & | name, |
const long long * | values, | ||
std::size_t | array_length | ||
) |
Inserts new entry of type long long array.
Inserts a new entry of type long long array to the first available slot. If the entry with the given name already exists it is replaced without changing the order of entries.
name | Name of the new entry or the entry to be replaced. |
values | Pointer to the array of values to be set. |
array_length | Length of the array of values. |
Note: The array of values is copied to the internal buffer.
void yami::parameters::set_long_long_array_shallow | ( | const std::string & | name, |
const long long * | values, | ||
std::size_t | array_length | ||
) |
Inserts new entry of type long long array.
Inserts a new entry of type long long array to the first available slot. If the entry with the given name already exists it is replaced without changing the order of entries.
name | Name of the new entry or the entry to be replaced. |
values | Pointer to the array of values to be set. |
array_length | Length of the array of values. |
Note: The array of values is not copied to the internal buffer and the user has to ensure that the given buffer is valid as long as this object refers to it.
void yami::parameters::set_long_long_word | ( | const std::string & | name, |
unsigned long long | value | ||
) |
Inserts new entry of type unsigned long long.
Inserts a new entry of type unsigned long long to the first available slot. If the entry with the given name already exists it is replaced without changing the order of entries.
name | Name of the new entry or the entry to be replaced. |
value | Value to be set. |
void yami::parameters::set_long_long_word_array | ( | const std::string & | name, |
const unsigned long long * | values, | ||
std::size_t | array_length | ||
) |
Inserts new entry of type unsigned long long array.
Inserts a new entry of type unsigned long long array to the first available slot. If the entry with the given name already exists it is replaced without changing the order of entries.
name | Name of the new entry or the entry to be replaced. |
values | Pointer to the array of values to be set. |
array_length | Length of the array of values. |
Note: The array of values is copied to the internal buffer.
void yami::parameters::set_long_long_word_array_shallow | ( | const std::string & | name, |
const unsigned long long * | values, | ||
std::size_t | array_length | ||
) |
Inserts new entry of type unsigned long long array.
Inserts a new entry of type unsigned long long array to the first available slot. If the entry with the given name already exists it is replaced without changing the order of entries.
name | Name of the new entry or the entry to be replaced. |
values | Pointer to the array of values to be set. |
array_length | Length of the array of values. |
Note: The array of values is not copied to the internal buffer and the user has to ensure that the given buffer is valid as long as this object refers to it.
void yami::parameters::set_string | ( | const std::string & | name, |
const std::string & | value | ||
) |
Inserts new entry of type string.
Inserts a new entry of type string to the first available slot. If the entry with the given name already exists it is replaced without changing the order of entries.
name | Name of the new entry or the entry to be replaced. |
value | Value to be set. |
void yami::parameters::set_string_in_array | ( | const std::string & | name, |
std::size_t | index, | ||
const std::string & | value | ||
) |
Inserts new string value to string array.
Inserts a new string value (possibly replacing the old one) to already existing string array at the given index.
name | Name of the entry containing string array. |
index | The array index (array slot, starting from 0). |
value | Value to be set. |
Note: The value is copied to the internal buffer.
void yami::parameters::set_string_shallow | ( | const std::string & | name, |
const char * | value, | ||
std::size_t | value_length | ||
) |
Inserts new entry of type string.
Inserts a new entry of type string to the first available slot. If the entry with the given name already exists it is replaced without changing the order of entries.
name | Name of the new entry or the entry to be replaced. |
value | Pointer to the value buffer to be set. The buffer can contain zeros. |
value_length | Length of the value buffer. |
Note: The value is not copied to the internal buffer and the user has to ensure that the given buffer is valid as long as this object refers to it.
void yami::parameters::set_word | ( | const std::string & | name, |
unsigned int | value | ||
) |
Inserts new entry of type unsigned int.
Inserts a new entry of type unsigned int to the first available slot. If the entry with the given name already exists it is replaced without changing the order of entries.
name | Name of the new entry or the entry to be replaced. |
value | Value to be set. |
void yami::parameters::set_word_array | ( | const std::string & | name, |
const unsigned int * | values, | ||
std::size_t | array_length | ||
) |
Inserts new entry of type unsigned int array.
Inserts a new entry of type unsigned int array to the first available slot. If the entry with the given name already exists it is replaced without changing the order of entries.
name | Name of the new entry or the entry to be replaced. |
values | Pointer to the array of values to be set. |
array_length | Length of the array of values. |
Note: The array of values is copied to the internal buffer.
void yami::parameters::set_word_array_shallow | ( | const std::string & | name, |
const unsigned int * | values, | ||
std::size_t | array_length | ||
) |
Inserts new entry of type unsigned int array.
Inserts a new entry of type unsigned int array to the first available slot. If the entry with the given name already exists it is replaced without changing the order of entries.
name | Name of the new entry or the entry to be replaced. |
values | Pointer to the array of values to be set. |
array_length | Length of the array of values. |
Note: The array of values is not copied to the internal buffer and the user has to ensure that the given buffer is valid as long as this object refers to it.
std::size_t yami::parameters::size | ( | ) | const |
Returns the size of the collection.
Returns the size of the collection - that is, the number of all non-empty slots.
void yami::parameters::swap | ( | parameters & | other | ) |
Swap operation.
The (no-throw) swap operation.
parameter_type yami::parameters::type | ( | const std::string & | name | ) | const |
Extracts the type of the given entry.
Extracts the type of the entry given by its name.
name | Name of the entry. |