YAMI4 Core Library 2.0.0
Messaging Solution for Distributed Systems
Loading...
Searching...
No Matches
Public Member Functions | Public Attributes | List of all members
yami::core::parameters Class Reference

Collection of message parameters. More...

#include <parameters.h>

Inheritance diagram for yami::core::parameters:
yami::core::serializable

Public Member Functions

 parameters ()
 Constructor. More...
 
 parameters (allocator &alloc)
 Constructor. More...
 
 ~parameters ()
 Destructor. More...
 
result set_boolean (const char *name, std::size_t name_length, bool value)
 Inserts new entry of type bool. More...
 
result set_boolean (const char *name, bool value)
 Inserts new entry of type bool. More...
 
result get_boolean (const char *name, std::size_t name_length, bool &value) const
 Extracts the bool value from the given entry. More...
 
result get_boolean (const char *name, bool &value) const
 Extracts the bool value from the given entry. More...
 
result set_integer (const char *name, std::size_t name_length, int value)
 Inserts new entry of type int. More...
 
result set_integer (const char *name, int value)
 Inserts new entry of type int. More...
 
result get_integer (const char *name, std::size_t name_length, int &value) const
 Extracts the int value from the given entry. More...
 
result get_integer (const char *name, int &value) const
 Extracts the int value from the given entry. More...
 
result set_long_long (const char *name, std::size_t name_length, long long value)
 Inserts new entry of type long long. More...
 
result set_long_long (const char *name, long long value)
 Inserts new entry of type long long. More...
 
result get_long_long (const char *name, std::size_t name_length, long long &value) const
 Extracts the long long value from the given entry. More...
 
result get_long_long (const char *name, long long &value) const
 Extracts the long long value from the given entry. More...
 
result set_word (const char *name, std::size_t name_length, unsigned int value)
 Inserts new entry of type unsigned int. More...
 
result set_word (const char *name, unsigned int value)
 Inserts new entry of type unsigned int. More...
 
result get_word (const char *name, std::size_t name_length, unsigned int &value) const
 Extracts the unsigned int value from the given entry. More...
 
result get_word (const char *name, unsigned int &value) const
 Extracts the unsigned int value from the given entry. More...
 
result set_long_long_word (const char *name, std::size_t name_length, unsigned long long value)
 Inserts new entry of type unsigned long long. More...
 
result set_long_long_word (const char *name, unsigned long long value)
 Inserts new entry of type unsigned long long. More...
 
result get_long_long_word (const char *name, std::size_t name_length, unsigned long long &value) const
 Extracts the unsigned long long value from the given entry. More...
 
result get_long_long_word (const char *name, unsigned long long &value) const
 Extracts the unsigned long long value from the given entry. More...
 
result set_double_float (const char *name, std::size_t name_length, double value)
 Inserts new entry of type double. More...
 
result set_double_float (const char *name, double value)
 Inserts new entry of type double. More...
 
result get_double_float (const char *name, std::size_t name_length, double &value) const
 Extracts the double value from the given entry. More...
 
result get_double_float (const char *name, double &value) const
 Extracts the double value from the given entry. More...
 
result set_string (const char *name, std::size_t name_length, const char *value, std::size_t value_length)
 Inserts new entry of type string. More...
 
result set_string (const char *name, const char *value)
 Inserts new entry of type string. More...
 
result set_string_shallow (const char *name, std::size_t name_length, const char *value, std::size_t value_length)
 Inserts new entry of type string. More...
 
result set_string_shallow (const char *name, const char *value)
 Inserts new entry of type string. More...
 
result get_string (const char *name, std::size_t name_length, const char *&value, std::size_t &value_length) const
 Extracts the string value from the given entry. More...
 
result get_string (const char *name, const char *&value, std::size_t &value_length) const
 Extracts the string value from the given entry. More...
 
result set_binary (const char *name, std::size_t name_length, const void *value, std::size_t value_length)
 Inserts new entry of type binary. More...
 
result set_binary (const char *name, const void *value, std::size_t value_length)
 Inserts new entry of type binary. More...
 
result set_binary_shallow (const char *name, std::size_t name_length, const void *value, std::size_t value_length)
 Inserts new entry of type binary. More...
 
result set_binary_shallow (const char *name, const void *value, std::size_t value_length)
 Inserts new entry of type binary. More...
 
result get_binary (const char *name, std::size_t name_length, const void *&value, std::size_t &value_length) const
 Extracts the binary value from the given entry. More...
 
result get_binary (const char *name, const void *&value, std::size_t &value_length) const
 Extracts the binary value from the given entry. More...
 
result set_boolean_array (const char *name, std::size_t name_length, const bool *values, std::size_t array_length)
 Inserts new entry of type bool array. More...
 
result set_boolean_array (const char *name, const bool *values, std::size_t array_length)
 Inserts new entry of type bool array. More...
 
result set_boolean_array_shallow (const char *name, std::size_t name_length, const bool *values, std::size_t array_length)
 Inserts new entry of type bool array. More...
 
result set_boolean_array_shallow (const char *name, const bool *values, std::size_t array_length)
 Inserts new entry of type bool array. More...
 
result create_boolean_array (const char *name, std::size_t name_length, std::size_t array_length, bool *&array)
 Creates new uninitialized entry of type bool array. More...
 
result create_boolean_array (const char *name, std::size_t array_length, bool *&array)
 Creates new uninitialized entry of type bool array. More...
 
result get_boolean_array (const char *name, std::size_t name_length, bool *&values, std::size_t &array_length) const
 Extracts the array of bool values from the given entry. More...
 
result get_boolean_array (const char *name, bool *&values, std::size_t &array_length) const
 Extracts the array of bool values from the given entry. More...
 
result set_integer_array (const char *name, std::size_t name_length, const int *values, std::size_t array_length)
 Inserts new entry of type int array. More...
 
result set_integer_array (const char *name, const int *values, std::size_t array_length)
 Inserts new entry of type int array. More...
 
result set_integer_array_shallow (const char *name, std::size_t name_length, const int *values, std::size_t array_length)
 Inserts new entry of type int array. More...
 
result set_integer_array_shallow (const char *name, const int *values, std::size_t array_length)
 Inserts new entry of type int array. More...
 
result create_integer_array (const char *name, std::size_t name_length, std::size_t array_length, int *&array)
 Creates new uninitialized entry of type int array. More...
 
result create_integer_array (const char *name, std::size_t array_length, int *&array)
 Creates new uninitialized entry of type int array. More...
 
result get_integer_array (const char *name, std::size_t name_length, int *&values, std::size_t &array_length) const
 Extracts the array of int values from the given entry. More...
 
result get_integer_array (const char *name, int *&values, std::size_t &array_length) const
 Extracts the array of int values from the given entry. More...
 
result set_long_long_array (const char *name, std::size_t name_length, const long long *values, std::size_t array_length)
 Inserts new entry of type long long array. More...
 
result set_long_long_array (const char *name, const long long *values, std::size_t array_length)
 Inserts new entry of type long long array. More...
 
result set_long_long_array_shallow (const char *name, std::size_t name_length, const long long *values, std::size_t array_length)
 Inserts new entry of type long long array. More...
 
result set_long_long_array_shallow (const char *name, const long long *values, std::size_t array_length)
 Inserts new entry of type long long array. More...
 
result create_long_long_array (const char *name, std::size_t name_length, std::size_t array_length, long long *&array)
 Creates new uninitialized entry of type long long array. More...
 
result create_long_long_array (const char *name, std::size_t array_length, long long *&array)
 Creates new uninitialized entry of type long long array. More...
 
result get_long_long_array (const char *name, std::size_t name_length, long long *&values, std::size_t &array_length) const
 Extracts the array of long long values from the given entry. More...
 
result get_long_long_array (const char *name, long long *&values, std::size_t &array_length) const
 Extracts the array of long long values from the given entry. More...
 
result set_word_array (const char *name, std::size_t name_length, const unsigned int *values, std::size_t array_length)
 Inserts new entry of type unsigned int array. More...
 
result set_word_array (const char *name, const unsigned int *values, std::size_t array_length)
 Inserts new entry of type unsigned int array. More...
 
result set_word_array_shallow (const char *name, std::size_t name_length, const unsigned int *values, std::size_t array_length)
 Inserts new entry of type unsigned int array. More...
 
result set_word_array_shallow (const char *name, const unsigned int *values, std::size_t array_length)
 Inserts new entry of type unsigned int array. More...
 
result create_word_array (const char *name, std::size_t name_length, std::size_t array_length, unsigned int *&array)
 Creates new uninitialized entry of type unsigned int array. More...
 
result create_word_array (const char *name, std::size_t array_length, unsigned int *&array)
 Creates new uninitialized entry of type unsigned int array. More...
 
result get_word_array (const char *name, std::size_t name_length, unsigned int *&values, std::size_t &array_length) const
 Extracts the array of unsigned int values from the given entry. More...
 
result get_word_array (const char *name, unsigned int *&values, std::size_t &array_length) const
 Extracts the array of unsigned int values from the given entry. More...
 
result set_long_long_word_array (const char *name, std::size_t name_length, const unsigned long long *values, std::size_t array_length)
 Inserts new entry of type unsigned long long array. More...
 
result set_long_long_word_array (const char *name, const unsigned long long *values, std::size_t array_length)
 Inserts new entry of type unsigned long long array. More...
 
result set_long_long_word_array_shallow (const char *name, std::size_t name_length, const unsigned long long *values, std::size_t array_length)
 Inserts new entry of type unsigned long long array. More...
 
result set_long_long_word_array_shallow (const char *name, const unsigned long long *values, std::size_t array_length)
 Inserts new entry of type unsigned long long array. More...
 
result create_long_long_word_array (const char *name, std::size_t name_length, std::size_t array_length, unsigned long long *&array)
 Creates new uninitialized entry of type unsigned long long array. More...
 
result create_long_long_word_array (const char *name, std::size_t array_length, unsigned long long *&array)
 Creates new uninitialized entry of type unsigned long long array. More...
 
result get_long_long_word_array (const char *name, std::size_t name_length, unsigned long long *&values, std::size_t &array_length) const
 Extracts the array of unsigned long long values from the given entry. More...
 
result get_long_long_word_array (const char *name, unsigned long long *&values, std::size_t &array_length) const
 Extracts the array of unsigned long long values from the given entry. More...
 
result set_double_float_array (const char *name, std::size_t name_length, const double *values, std::size_t array_length)
 Inserts new entry of type double array. More...
 
result set_double_float_array (const char *name, const double *values, std::size_t array_length)
 Inserts new entry of type double array. More...
 
result set_double_float_array_shallow (const char *name, std::size_t name_length, const double *values, std::size_t array_length)
 Inserts new entry of type double array. More...
 
result set_double_float_array_shallow (const char *name, const double *values, std::size_t array_length)
 Inserts new entry of type double array. More...
 
result create_double_float_array (const char *name, std::size_t name_length, std::size_t array_length, double *&array)
 Creates new uninitialized entry of type double float array. More...
 
result create_double_float_array (const char *name, std::size_t array_length, double *&array)
 Creates new uninitialized entry of type double float array. More...
 
result get_double_float_array (const char *name, std::size_t name_length, double *&values, std::size_t &array_length) const
 Extracts the array of double values from the given entry. More...
 
result get_double_float_array (const char *name, double *&values, std::size_t &array_length) const
 Extracts the array of double values from the given entry. More...
 
result create_string_array (const char *name, std::size_t name_length, std::size_t array_length)
 Creates new empty entry of type string array. More...
 
result create_string_array (const char *name, std::size_t array_length)
 Creates new empty entry of type string array. More...
 
result set_string_in_array (const char *name, std::size_t name_length, std::size_t index, const char *value, std::size_t value_length)
 Inserts new string value to string array. More...
 
result set_string_in_array (const char *name, std::size_t index, const char *value)
 Inserts new string value to string array. More...
 
result get_string_array_length (const char *name, std::size_t name_length, std::size_t &array_length) const
 Extracts the length of string array. More...
 
result get_string_array_length (const char *name, std::size_t &array_length) const
 Extracts the length of string array. More...
 
result get_string_in_array (const char *name, std::size_t name_length, std::size_t index, const char *&value, std::size_t &value_length) const
 Extracts string value from string array. More...
 
result get_string_in_array (const char *name, std::size_t index, const char *&value, std::size_t &value_length) const
 Extracts string value from string array. More...
 
result create_binary_array (const char *name, std::size_t name_length, std::size_t array_length)
 Creates new empty entry of type binary array. More...
 
result create_binary_array (const char *name, std::size_t array_length)
 Creates new empty entry of type binary array. More...
 
result set_binary_in_array (const char *name, std::size_t name_length, std::size_t index, const void *value, std::size_t value_length)
 Inserts new binary value to binary array. More...
 
result set_binary_in_array (const char *name, std::size_t index, const void *value, std::size_t value_length)
 Inserts new binary value to binary array. More...
 
result get_binary_array_length (const char *name, std::size_t name_length, std::size_t &array_length) const
 Extracts the length of binary array. More...
 
result get_binary_array_length (const char *name, std::size_t &array_length) const
 Extracts the length of binary array. More...
 
result get_binary_in_array (const char *name, std::size_t name_length, std::size_t index, const void *&value, std::size_t &value_length) const
 Extracts binary value from binary array. More...
 
result get_binary_in_array (const char *name, std::size_t index, const void *&value, std::size_t &value_length) const
 Extracts binary value from binary array. More...
 
result create_nested_parameters (const char *name, std::size_t name_length, parameters *&params)
 Creates nested parameters entry. More...
 
result create_nested_parameters (const char *name, parameters *&params)
 Creates nested parameters entry. More...
 
result get_nested_parameters (const char *name, std::size_t name_length, parameters *&params) const
 Extracts the nested parameters object from the given entry. More...
 
result get_nested_parameters (const char *name, parameters *&params) const
 Extracts the nested parameters object from the given entry. More...
 
result create_nested_array (const char *name, std::size_t name_length, std::size_t array_length)
 Creates new empty entry of type nested parameters array. More...
 
result create_nested_array (const char *name, std::size_t array_length)
 Creates new empty entry of type nested parameters array. More...
 
result get_nested_array_length (const char *name, std::size_t name_length, std::size_t &array_length) const
 Extracts the length of nested parameters array. More...
 
result get_nested_array_length (const char *name, std::size_t &array_length) const
 Extracts the length of nested parameters array. More...
 
result get_nested_in_array (const char *name, std::size_t name_length, std::size_t index, parameters *&nested) const
 Extracts nested parameters value from nested array. More...
 
result get_nested_in_array (const char *name, std::size_t index, parameters *&nested) const
 Extracts nested parameters value from nested array. More...
 
result remove (const char *name, std::size_t name_length)
 Removes the given entry. More...
 
result remove (const char *name)
 Removes the given entry. More...
 
std::size_t size () const
 Returns the size of the collection. More...
 
result get_type (const char *name, std::size_t name_length, parameter_type &t) const
 Extracts the type of the given entry. More...
 
result get_type (const char *name, parameter_type &t) const
 Extracts the type of the given entry. More...
 
result get_iterator (parameter_iterator &it) const
 Extracts the iterator to all entries. More...
 
result find (const char *name, std::size_t name_length, parameter_entry &entry) const
 Finds the given entry. More...
 
result find (const char *name, parameter_entry &entry) const
 Finds the given entry. More...
 
result merge_from (const parameters &other)
 Merges entries from the given parameters object. More...
 
void clear ()
 Clears the collection of entries. More...
 
virtual result get_serialize_buffer_size (std::size_t &size) const
 Finds the total size of serialization buffer. More...
 
virtual result serialize (char **buffers, const std::size_t *buffer_sizes, std::size_t num_of_buffers) const
 Serializes current content into given buffer(s). More...
 
result deserialize (const char **buffers, const std::size_t *buffer_sizes, std::size_t num_of_buffers)
 Deserializes from the given buffer(s). More...
 
void dump (details::dump_sink &sink, std::size_t indent_length=0) const
 
virtual result get_serialize_buffer_size (std::size_t &size) const =0
 Finds the total size of serialization buffer. More...
 
virtual result serialize (char **buffers, const std::size_t *buffer_sizes, std::size_t num_of_buffers) const =0
 Serializes current content into given buffer(s). More...
 

Public Attributes

allocatorallocator_
 
details::entry * data_
 
std::size_t num_of_entries_
 

Detailed Description

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:

Each entry has a name that can be either null-terminated or contain embedded zeros and appropriate member functions are provided for both cases. The names are searched for using case-sensitive comparisons. The name of entry is always kept by copy.

This class is not copyable and 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.

Constructor & Destructor Documentation

◆ parameters() [1/2]

yami::core::parameters::parameters ( )
explicit

Constructor.

Creates an empty parameters object that uses a standard allocator.

◆ parameters() [2/2]

yami::core::parameters::parameters ( allocator alloc)
explicit

Constructor.

Creates an empty parameters object that uses a custom allocator.

Parameters
allocProvides a custom allocator to use.

◆ ~parameters()

yami::core::parameters::~parameters ( )

Destructor.

The destructor cleans all dependent resources only if each of them was separately allocated on the global store. If the parameters object was created with externally provided working area (that is, when working_area != NULL when the object was constructed) then no cleanup is performed.

Member Function Documentation

◆ clear()

void yami::core::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.

◆ create_binary_array() [1/2]

result yami::core::parameters::create_binary_array ( const char *  name,
std::size_t  array_length 
)

Creates new empty entry of type binary array.

Creates a new empty entry of type binary array with null-terminated name. See the other overloaded function for details.

◆ create_binary_array() [2/2]

result yami::core::parameters::create_binary_array ( const char *  name,
std::size_t  name_length,
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.

Parameters
namePointer to the name buffer. The buffer can contain zeros.
name_lengthLength of the name buffer.
array_lengthLength of the newly created array.
Returns
  • ok if operation was successful
  • no_memory if the new entry cannot be allocated

Note: After creation the array contains empty binaries (that is, binaries which length is 0).

◆ create_boolean_array() [1/2]

result yami::core::parameters::create_boolean_array ( const char *  name,
std::size_t  array_length,
bool *&  array 
)

Creates new uninitialized entry of type bool array.

Creates a new entry of type bool array with null-terminated name and given length. See the other overloaded function for details.

◆ create_boolean_array() [2/2]

result yami::core::parameters::create_boolean_array ( const char *  name,
std::size_t  name_length,
std::size_t  array_length,
bool *&  array 
)

Creates new uninitialized entry of type bool array.

Creates a new entry of type bool array in the first available slot. If the entry with the given name already exists it is replaced without changing the order of entries.

Parameters
namePointer to the name buffer. The buffer can contain zeros.
name_lengthLength of the name buffer.
array_lengthLength of the new array.
arrayReturned pointer to the array.
Returns
  • ok if operation was successful
  • no_memory if the new entry cannot be allocated

◆ create_double_float_array() [1/2]

result yami::core::parameters::create_double_float_array ( const char *  name,
std::size_t  array_length,
double *&  array 
)

Creates new uninitialized entry of type double float array.

Creates a new entry of type double float array with null-terminated name and given array_length. See the other overloaded function for details.

◆ create_double_float_array() [2/2]

result yami::core::parameters::create_double_float_array ( const char *  name,
std::size_t  name_length,
std::size_t  array_length,
double *&  array 
)

Creates new uninitialized entry of type double float array.

Creates a new entry of type double float array in the first available slot. If the entry with the given name already exists it is replaced without changing the order of entries.

Parameters
namePointer to the name buffer. The buffer can contain zeros.
name_lengthLength of the name buffer.
array_lengthLength of the new array.
arrayReturned pointer to the array.
Returns
  • ok if operation was successful
  • no_memory if the new entry cannot be allocated

◆ create_integer_array() [1/2]

result yami::core::parameters::create_integer_array ( const char *  name,
std::size_t  array_length,
int *&  array 
)

Creates new uninitialized entry of type int array.

Creates a new entry of type int array with null-terminated name and given length. See the other overloaded function for details.

◆ create_integer_array() [2/2]

result yami::core::parameters::create_integer_array ( const char *  name,
std::size_t  name_length,
std::size_t  array_length,
int *&  array 
)

Creates new uninitialized entry of type int array.

Creates a new entry of type int array in the first available slot. If the entry with the given name already exists it is replaced without changing the order of entries.

Parameters
namePointer to the name buffer. The buffer can contain zeros.
name_lengthLength of the name buffer.
array_lengthLength of the new array.
arrayReturned pointer to the array.
Returns
  • ok if operation was successful
  • no_memory if the new entry cannot be allocated

◆ create_long_long_array() [1/2]

result yami::core::parameters::create_long_long_array ( const char *  name,
std::size_t  array_length,
long long *&  array 
)

Creates new uninitialized entry of type long long array.

Creates a new entry of type long long array with null-terminated name and given length. See the other overloaded function for details.

◆ create_long_long_array() [2/2]

result yami::core::parameters::create_long_long_array ( const char *  name,
std::size_t  name_length,
std::size_t  array_length,
long long *&  array 
)

Creates new uninitialized entry of type long long array.

Creates a new entry of type long long array in the first available slot. If the entry with the given name already exists it is replaced without changing the order of entries.

Parameters
namePointer to the name buffer. The buffer can contain zeros.
name_lengthLength of the name buffer.
array_lengthLength of the new array.
arrayReturned pointer to the array.
Returns
  • ok if operation was successful
  • no_memory if the new entry cannot be allocated

◆ create_long_long_word_array() [1/2]

result yami::core::parameters::create_long_long_word_array ( const char *  name,
std::size_t  array_length,
unsigned long long *&  array 
)

Creates new uninitialized entry of type unsigned long long array.

Creates a new entry of type unsigned long long array with null-terminated name and given length. See the other overloaded function for details.

◆ create_long_long_word_array() [2/2]

result yami::core::parameters::create_long_long_word_array ( const char *  name,
std::size_t  name_length,
std::size_t  array_length,
unsigned long long *&  array 
)

Creates new uninitialized entry of type unsigned long long array.

Creates a new entry of type unsigned long long array in the first available slot. If the entry with the given name already exists it is replaced without changing the order of entries.

Parameters
namePointer to the name buffer. The buffer can contain zeros.
name_lengthLength of the name buffer.
array_lengthLength of the new array.
arrayReturned pointer to the array.
Returns
  • ok if operation was successful
  • no_memory if the new entry cannot be allocated

◆ create_nested_array() [1/2]

result yami::core::parameters::create_nested_array ( const char *  name,
std::size_t  array_length 
)

Creates new empty entry of type nested parameters array.

Creates a new empty entry of type nested parameters array with null-terminated name. See the other overloaded function for details.

◆ create_nested_array() [2/2]

result yami::core::parameters::create_nested_array ( const char *  name,
std::size_t  name_length,
std::size_t  array_length 
)

Creates new empty entry of type nested parameters array.

Creates a new empty entry of type nested parameters array. If the entry with the given name already exists it is replaced without changing the order of entries.

Parameters
namePointer to the name buffer. The buffer can contain zeros.
name_lengthLength of the name buffer.
array_lengthLength of the newly created array.
Returns
  • ok if operation was successful
  • no_memory if the new entry cannot be allocated

Note: After creation the array contains empty nested objects (that is, parameters objects which do not have any entries).

◆ create_nested_parameters() [1/2]

result yami::core::parameters::create_nested_parameters ( const char *  name,
parameters *&  params 
)

Creates nested parameters entry.

Creates a new nested parameters entry with null-terminated name. See the other overloaded function for details.

◆ create_nested_parameters() [2/2]

result yami::core::parameters::create_nested_parameters ( const char *  name,
std::size_t  name_length,
parameters *&  params 
)

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.

Parameters
namePointer to the name buffer. The buffer can contain zeros.
name_lengthLength of the name buffer.
paramsPointer to the internally created parameters object.
Returns
  • ok if operation was successful
  • no_memory if the new entry cannot be allocated

◆ create_string_array() [1/2]

result yami::core::parameters::create_string_array ( const char *  name,
std::size_t  array_length 
)

Creates new empty entry of type string array.

Creates a new empty entry of type string array with null-terminated name. See the other overloaded function for details.

◆ create_string_array() [2/2]

result yami::core::parameters::create_string_array ( const char *  name,
std::size_t  name_length,
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.

Parameters
namePointer to the name buffer. The buffer can contain zeros.
name_lengthLength of the name buffer.
array_lengthLength of the newly created array.
Returns
  • ok if operation was successful
  • no_memory if the new entry cannot be allocated

Note: After creation the array contains empty strings (that is, strings which length is 0).

◆ create_word_array() [1/2]

result yami::core::parameters::create_word_array ( const char *  name,
std::size_t  array_length,
unsigned int *&  array 
)

Creates new uninitialized entry of type unsigned int array.

Creates a new entry of type unsigned int array with null-terminated name and given length. See the other overloaded function for details.

◆ create_word_array() [2/2]

result yami::core::parameters::create_word_array ( const char *  name,
std::size_t  name_length,
std::size_t  array_length,
unsigned int *&  array 
)

Creates new uninitialized entry of type unsigned int array.

Creates a new entry of type unsigned int array in the first available slot. If the entry with the given name already exists it is replaced without changing the order of entries.

Parameters
namePointer to the name buffer. The buffer can contain zeros.
name_lengthLength of the name buffer.
array_lengthLength of the new array.
arrayReturned pointer to the array.
Returns
  • ok if operation was successful
  • no_memory if the new entry cannot be allocated

◆ deserialize()

result yami::core::parameters::deserialize ( const char **  buffers,
const 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.

Parameters
buffersPointer to the array of buffer pointers (each of type const char *).
buffer_sizesPointer to the array of buffer sizes.
num_of_buffersNumber of buffers described by the array.
Returns
  • ok if operation was successful
  • nesting_too_deep if the level of nesting in the data stream is deeper than the limit
  • not_enough_space if the buffers do not contain all expected data
  • unexpected_value if the data stream contains a value that cannot be properly interpreted

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.

◆ find() [1/2]

result yami::core::parameters::find ( const char *  name,
parameter_entry entry 
) const

Finds the given entry.

Extracts the on the entry specified by its null-terminated name. See the other overloaded function for details.

◆ find() [2/2]

result yami::core::parameters::find ( const char *  name,
std::size_t  name_length,
parameter_entry entry 
) const

Finds the given entry.

Extracts the view on the entry specified by its name.

Parameters
namePointer to the name buffer. The buffer can contain zeros.
name_lengthLength of the name buffer.
entryThe entry view to be returned.
Returns
  • ok if operation was successful
  • no_such_name if the given name cannot be found

◆ get_binary() [1/2]

result yami::core::parameters::get_binary ( const char *  name,
const void *&  value,
std::size_t &  value_length 
) const

Extracts the binary value from the given entry.

Extracts the binary value from the entry given by null-terminated name. See the other overloaded function for details.

◆ get_binary() [2/2]

result yami::core::parameters::get_binary ( const char *  name,
std::size_t  name_length,
const void *&  value,
std::size_t &  value_length 
) const

Extracts the binary value from the given entry.

Extracts the binary value from the entry given by its name.

Parameters
namePointer to the name buffer. The buffer can contain zeros.
name_lengthLength of the name buffer.
valuePointer to the internal value buffer to be returned.
value_lengthLength of the internal value buffer.
Returns
  • ok if operation was successful
  • bad_type if the given entry does not contain binary
  • no_such_name if the given name cannot be found

◆ get_binary_array_length() [1/2]

result yami::core::parameters::get_binary_array_length ( const char *  name,
std::size_t &  array_length 
) const

Extracts the length of binary array.

Extracts the length of binary array identified by null-terminated name. See the other overloaded function for details.

◆ get_binary_array_length() [2/2]

result yami::core::parameters::get_binary_array_length ( const char *  name,
std::size_t  name_length,
std::size_t &  array_length 
) const

Extracts the length of binary array.

Extracts the length of binary array that is located at the given entry.

Parameters
namePointer to the name buffer. The buffer can contain zeros.
name_lengthLength of the name buffer.
array_lengthLength of the array.
Returns
  • ok if operation was successful
  • bad_type if the current entry does not contain binary array

◆ get_binary_in_array() [1/2]

result yami::core::parameters::get_binary_in_array ( const char *  name,
std::size_t  index,
const void *&  value,
std::size_t &  value_length 
) const

Extracts binary value from binary array.

Extracts the binary value from the given index of binary array identified by null-terminated name. See the other overloaded function for details.

◆ get_binary_in_array() [2/2]

result yami::core::parameters::get_binary_in_array ( const char *  name,
std::size_t  name_length,
std::size_t  index,
const void *&  value,
std::size_t &  value_length 
) const

Extracts binary value from binary array.

Extracts the binary value from the given index of binary array.

Parameters
namePointer to the name buffer. The buffer can contain zeros.
name_lengthLength of the name buffer.
indexThe array index (array slot to be read, starting from 0).
valuePointer to the internal value buffer to be returned.
value_lengthLength of the internal value buffer.
Returns
  • ok if operation was successful
  • bad_type if the given entry does not contain binary array
  • no_such_index if the given index is out of range

◆ get_boolean() [1/2]

result yami::core::parameters::get_boolean ( const char *  name,
bool &  value 
) const

Extracts the bool value from the given entry.

Extracts the bool value from the entry given by null-terminated name. See the other overloaded function for details.

◆ get_boolean() [2/2]

result yami::core::parameters::get_boolean ( const char *  name,
std::size_t  name_length,
bool &  value 
) const

Extracts the bool value from the given entry.

Extracts the bool value from the entry given by its name.

Parameters
namePointer to the name buffer. The buffer can contain zeros.
name_lengthLength of the name buffer.
valueValue to be returned.
Returns
  • ok if operation was successful
  • bad_type if the given entry does not contain bool
  • no_such_name if the given name cannot be found

◆ get_boolean_array() [1/2]

result yami::core::parameters::get_boolean_array ( const char *  name,
bool *&  values,
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 null-terminated name. See the other overloaded function for details.

◆ get_boolean_array() [2/2]

result yami::core::parameters::get_boolean_array ( const char *  name,
std::size_t  name_length,
bool *&  values,
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.

Parameters
namePointer to the name buffer. The buffer can contain zeros.
name_lengthLength of the name buffer.
valuesPointer to the internal array buffer to be returned.
array_lengthLength of the internal array.
Returns
  • ok if operation was successful
  • bad_type if the given entry does not contain bool array
  • no_such_name if the given name cannot be found

Note: this function gives read-write access to the underlying array, even if it was set as a shallow-copy.

◆ get_double_float() [1/2]

result yami::core::parameters::get_double_float ( const char *  name,
double &  value 
) const

Extracts the double value from the given entry.

Extracts the double value from the entry given by null-terminated name. See the other overloaded function for details.

◆ get_double_float() [2/2]

result yami::core::parameters::get_double_float ( const char *  name,
std::size_t  name_length,
double &  value 
) const

Extracts the double value from the given entry.

Extracts the double value from the entry given by its name.

Parameters
namePointer to the name buffer. The buffer can contain zeros.
name_lengthLength of the name buffer.
valueValue to be returned.
Returns
  • ok if operation was successful
  • bad_type if the given entry does not contain double
  • no_such_name if the given name cannot be found

◆ get_double_float_array() [1/2]

result yami::core::parameters::get_double_float_array ( const char *  name,
double *&  values,
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 null-terminated name. See the other overloaded function for details.

◆ get_double_float_array() [2/2]

result yami::core::parameters::get_double_float_array ( const char *  name,
std::size_t  name_length,
double *&  values,
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.

Parameters
namePointer to the name buffer. The buffer can contain zeros.
name_lengthLength of the name buffer.
valuesPointer to the internal array buffer to be returned.
array_lengthLength of the internal array.
Returns
  • ok if operation was successful
  • bad_type if the given entry does not contain double array
  • no_such_name if the given name cannot be found

Note: this function gives read-write access to the underlying array, even if it was set as a shallow-copy.

◆ get_integer() [1/2]

result yami::core::parameters::get_integer ( const char *  name,
int &  value 
) const

Extracts the int value from the given entry.

Extracts the int value from the entry given by null-terminated name. See the other overloaded function for details.

◆ get_integer() [2/2]

result yami::core::parameters::get_integer ( const char *  name,
std::size_t  name_length,
int &  value 
) const

Extracts the int value from the given entry.

Extracts the int value from the entry given by its name.

Parameters
namePointer to the name buffer. The buffer can contain zeros.
name_lengthLength of the name buffer.
valueValue to be returned.
Returns
  • ok if operation was successful
  • bad_type if the given entry does not contain int
  • no_such_name if the given name cannot be found

◆ get_integer_array() [1/2]

result yami::core::parameters::get_integer_array ( const char *  name,
int *&  values,
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 null-terminated name. See the other overloaded function for details.

◆ get_integer_array() [2/2]

result yami::core::parameters::get_integer_array ( const char *  name,
std::size_t  name_length,
int *&  values,
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.

Parameters
namePointer to the name buffer. The buffer can contain zeros.
name_lengthLength of the name buffer.
valuesPointer to the internal array buffer to be returned.
array_lengthLength of the internal array.
Returns
  • ok if operation was successful
  • bad_type if the given entry does not contain int array
  • no_such_name if the given name cannot be found

Note: this function gives read-write access to the underlying array, even if it was set as a shallow-copy.

◆ get_iterator()

result yami::core::parameters::get_iterator ( parameter_iterator it) const

Extracts the iterator to all entries.

Extracts the iterator pointing to the beginning of the collection, which means the first used slot.

Returns
  • ok if operation was successful
  • no_entries if this object contains no entries

◆ get_long_long() [1/2]

result yami::core::parameters::get_long_long ( const char *  name,
long long &  value 
) const

Extracts the long long value from the given entry.

Extracts the long long value from the entry given by null-terminated name. See the other overloaded function for details.

◆ get_long_long() [2/2]

result yami::core::parameters::get_long_long ( const char *  name,
std::size_t  name_length,
long long &  value 
) const

Extracts the long long value from the given entry.

Extracts the long long value from the entry given by its name.

Parameters
namePointer to the name buffer. The buffer can contain zeros.
name_lengthLength of the name buffer.
valueValue to be returned.
Returns
  • ok if operation was successful
  • bad_type if the given entry does not contain long long
  • no_such_name if the given name cannot be found

◆ get_long_long_array() [1/2]

result yami::core::parameters::get_long_long_array ( const char *  name,
long long *&  values,
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 null-terminated name. See the other overloaded function for details.

◆ get_long_long_array() [2/2]

result yami::core::parameters::get_long_long_array ( const char *  name,
std::size_t  name_length,
long long *&  values,
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.

Parameters
namePointer to the name buffer. The buffer can contain zeros.
name_lengthLength of the name buffer.
valuesPointer to the internal array buffer to be returned.
array_lengthLength of the internal array.
Returns
  • ok if operation was successful
  • bad_type if the given entry does not contain long long array
  • no_such_name if the given name cannot be found

Note: this function gives read-write access to the underlying array, even if it was set as a shallow-copy.

◆ get_long_long_word() [1/2]

result yami::core::parameters::get_long_long_word ( const char *  name,
std::size_t  name_length,
unsigned long long &  value 
) const

Extracts the unsigned long long value from the given entry.

Extracts the unsigned long long value from the entry given by its name.

Parameters
namePointer to the name buffer. The buffer can contain zeros.
name_lengthLength of the name buffer.
valueValue to be returned.
Returns
  • ok if operation was successful
  • bad_type if the given entry does not contain unsigned long long
  • no_such_name if the given name cannot be found

◆ get_long_long_word() [2/2]

result yami::core::parameters::get_long_long_word ( const char *  name,
unsigned long long &  value 
) const

Extracts the unsigned long long value from the given entry.

Extracts the unsigned long long value from the entry given by null-terminated name. See the other overloaded function for details.

◆ get_long_long_word_array() [1/2]

result yami::core::parameters::get_long_long_word_array ( const char *  name,
std::size_t  name_length,
unsigned long long *&  values,
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.

Parameters
namePointer to the name buffer. The buffer can contain zeros.
name_lengthLength of the name buffer.
valuesPointer to the internal array buffer to be returned.
array_lengthLength of the internal array.
Returns
  • ok if operation was successful
  • bad_type if the given entry does not contain unsigned long long array
  • no_such_name if the given name cannot be found

Note: this function gives read-write access to the underlying array, even if it was set as a shallow-copy.

◆ get_long_long_word_array() [2/2]

result yami::core::parameters::get_long_long_word_array ( const char *  name,
unsigned long long *&  values,
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 null-terminated name. See the other overloaded function for details.

◆ get_nested_array_length() [1/2]

result yami::core::parameters::get_nested_array_length ( const char *  name,
std::size_t &  array_length 
) const

Extracts the length of nested parameters array.

Extracts the length of nested parameters array identified by null-terminated name. See the other overloaded function for details.

◆ get_nested_array_length() [2/2]

result yami::core::parameters::get_nested_array_length ( const char *  name,
std::size_t  name_length,
std::size_t &  array_length 
) const

Extracts the length of nested parameters array.

Extracts the length of nested parameters array that is located at the given entry.

Parameters
namePointer to the name buffer. The buffer can contain zeros.
name_lengthLength of the name buffer.
array_lengthLength of the array.
Returns
  • ok if operation was successful
  • bad_type if the current entry does not contain nested parameters array

◆ get_nested_in_array() [1/2]

result yami::core::parameters::get_nested_in_array ( const char *  name,
std::size_t  index,
parameters *&  nested 
) const

Extracts nested parameters value from nested array.

Extracts the nested parameters value from the given index of nested array identified by null-terminated name. See the other overloaded function for details.

◆ get_nested_in_array() [2/2]

result yami::core::parameters::get_nested_in_array ( const char *  name,
std::size_t  name_length,
std::size_t  index,
parameters *&  nested 
) const

Extracts nested parameters value from nested array.

Extracts the nested parameters value from the given index of nested array.

Parameters
namePointer to the name buffer. The buffer can contain zeros.
name_lengthLength of the name buffer.
indexThe array index (array slot to be read, starting from 0).
nestedPointer to the internally stored parameters object.
Returns
  • ok if operation was successful
  • bad_type if the given entry does not contain nested parameters array
  • no_such_index if the given index is out of range

◆ get_nested_parameters() [1/2]

result yami::core::parameters::get_nested_parameters ( const char *  name,
parameters *&  params 
) const

Extracts the nested parameters object from the given entry.

Extracts nested parameters from the entry given by its null-terminated name. See the other overloaded function for details.

◆ get_nested_parameters() [2/2]

result yami::core::parameters::get_nested_parameters ( const char *  name,
std::size_t  name_length,
parameters *&  params 
) const

Extracts the nested parameters object from the given entry.

Extracts nested parameters from the entry given by its name.

Parameters
namePointer to the name buffer. The buffer can contain zeros.
name_lengthLength of the name buffer.
paramsPointer to the internally stored parameters object.
Returns
  • ok if operation was successful
  • bad_type if the given entry does not contain nested parameters
  • no_such_name if the given name cannot be found

◆ get_serialize_buffer_size()

virtual result yami::core::parameters::get_serialize_buffer_size ( std::size_t &  size) const
virtual

Finds the total size of serialization buffer.

Computes the total size of serialization buffer(s) for the current content of this object.

Parameters
sizeThe computed size of buffer.
Returns
  • ok if operation was successful
  • nesting_too_deep if the level of nesting in this object is deeper than the limit

Implements yami::core::serializable.

◆ get_string() [1/2]

result yami::core::parameters::get_string ( const char *  name,
const char *&  value,
std::size_t &  value_length 
) const

Extracts the string value from the given entry.

Extracts the string value from the entry given by null-terminated name. See the other overloaded function for details.

◆ get_string() [2/2]

result yami::core::parameters::get_string ( const char *  name,
std::size_t  name_length,
const char *&  value,
std::size_t &  value_length 
) const

Extracts the string value from the given entry.

Extracts the string value from the entry given by its name.

Parameters
namePointer to the name buffer. The buffer can contain zeros.
name_lengthLength of the name buffer.
valuePointer to the internal value buffer to be returned.
value_lengthLength of the internal value buffer.
Returns
  • ok if operation was successful
  • bad_type if the given entry does not contain string
  • no_such_name if the given name cannot be found

◆ get_string_array_length() [1/2]

result yami::core::parameters::get_string_array_length ( const char *  name,
std::size_t &  array_length 
) const

Extracts the length of string array.

Extracts the length of string array identified by null-terminated name. See the other overloaded function for details.

◆ get_string_array_length() [2/2]

result yami::core::parameters::get_string_array_length ( const char *  name,
std::size_t  name_length,
std::size_t &  array_length 
) const

Extracts the length of string array.

Extracts the length of string array that is located at the given entry.

Parameters
namePointer to the name buffer. The buffer can contain zeros.
name_lengthLength of the name buffer.
array_lengthLength of the array.
Returns
  • ok if operation was successful
  • bad_type if the current entry does not contain string array

◆ get_string_in_array() [1/2]

result yami::core::parameters::get_string_in_array ( const char *  name,
std::size_t  index,
const char *&  value,
std::size_t &  value_length 
) const

Extracts string value from string array.

Extracts the string value from the given index of string array identified by null-terminated name. See the other overloaded function for details.

◆ get_string_in_array() [2/2]

result yami::core::parameters::get_string_in_array ( const char *  name,
std::size_t  name_length,
std::size_t  index,
const char *&  value,
std::size_t &  value_length 
) const

Extracts string value from string array.

Extracts the string value from the given index of string array.

Parameters
namePointer to the name buffer. The buffer can contain zeros.
name_lengthLength of the name buffer.
indexThe array index (array slot to be read, starting from 0).
valuePointer to the internal value buffer to be returned.
value_lengthLength of the internal value buffer.
Returns
  • ok if operation was successful
  • bad_type if the given entry does not contain string array
  • no_such_index if the given index is out of range

◆ get_type() [1/2]

result yami::core::parameters::get_type ( const char *  name,
parameter_type t 
) const

Extracts the type of the given entry.

Extracts the type of the entry given by its null-terminated name. See the other overloaded function for details.

◆ get_type() [2/2]

result yami::core::parameters::get_type ( const char *  name,
std::size_t  name_length,
parameter_type t 
) const

Extracts the type of the given entry.

Extracts the type of the entry given by its name.

Parameters
namePointer to the name buffer. The buffer can contain zeros.
name_lengthLength of the name buffer.
tThe type of the given entry.
Returns
  • ok if operation was successful
  • no_such_name if the given name cannot be found

◆ get_word() [1/2]

result yami::core::parameters::get_word ( const char *  name,
std::size_t  name_length,
unsigned int &  value 
) const

Extracts the unsigned int value from the given entry.

Extracts the unsigned int value from the entry given by its name.

Parameters
namePointer to the name buffer. The buffer can contain zeros.
name_lengthLength of the name buffer.
valueValue to be returned.
Returns
  • ok if operation was successful
  • bad_type if the given entry does not contain unsigned int
  • no_such_name if the given name cannot be found

◆ get_word() [2/2]

result yami::core::parameters::get_word ( const char *  name,
unsigned int &  value 
) const

Extracts the unsigned int value from the given entry.

Extracts the unsigned int value from the entry given by null-terminated name. See the other overloaded function for details.

◆ get_word_array() [1/2]

result yami::core::parameters::get_word_array ( const char *  name,
std::size_t  name_length,
unsigned int *&  values,
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.

Parameters
namePointer to the name buffer. The buffer can contain zeros.
name_lengthLength of the name buffer.
valuesPointer to the internal array buffer to be returned.
array_lengthLength of the internal array.
Returns
  • ok if operation was successful
  • bad_type if the given entry does not contain unsigned int array
  • no_such_name if the given name cannot be found

Note: this function gives read-write access to the underlying array, even if it was set as a shallow-copy.

◆ get_word_array() [2/2]

result yami::core::parameters::get_word_array ( const char *  name,
unsigned int *&  values,
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 null-terminated name. See the other overloaded function for details.

◆ merge_from()

result yami::core::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.

Parameters
otherThe object to be merged into this object.

◆ remove() [1/2]

result yami::core::parameters::remove ( const char *  name)

Removes the given entry.

Removes the entry given by its null-terminated name. See the other overloaded function for details.

◆ remove() [2/2]

result yami::core::parameters::remove ( const char *  name,
std::size_t  name_length 
)

Removes the given entry.

Removes the entry given by its name.

Parameters
namePointer to the name buffer. The buffer can contain zeros.
name_lengthLength of the name buffer.
Returns
  • ok if operation was successful
  • no_such_name if the given name cannot be found

Note: The removed entry leaves a hole (empty slot) in the collection that can be reused by newly added entries.

◆ serialize()

virtual result yami::core::parameters::serialize ( char **  buffers,
const std::size_t *  buffer_sizes,
std::size_t  num_of_buffers 
) const
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.

Parameters
buffersPointer to the array of buffer pointers (each of type char *).
buffer_sizesPointer to the array of buffer sizes.
num_of_buffersNumber of buffers described by the array.
Returns
  • ok if operation was successful
  • nesting_too_deep if the level of nesting in this object is deeper than the limit
  • not_enough_space if the buffers are not big enough for all the data

Implements yami::core::serializable.

◆ set_binary() [1/2]

result yami::core::parameters::set_binary ( const char *  name,
const void *  value,
std::size_t  value_length 
)

Inserts new entry of type binary.

Inserts a new entry of type binary with null-terminated name. See the other overloaded function for details.

◆ set_binary() [2/2]

result yami::core::parameters::set_binary ( const char *  name,
std::size_t  name_length,
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.

Parameters
namePointer to the name buffer. The buffer can contain zeros.
name_lengthLength of the name buffer.
valuePointer to the value buffer to be set.
value_lengthLength of the value buffer.
Returns
  • ok if operation was successful
  • no_memory if the new entry cannot be allocated

Note: The value is copied to the internal buffer.

◆ set_binary_in_array() [1/2]

result yami::core::parameters::set_binary_in_array ( const char *  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 to already existing binary array (given by null-terminated name) at the given index. See the other overloaded function for details.

◆ set_binary_in_array() [2/2]

result yami::core::parameters::set_binary_in_array ( const char *  name,
std::size_t  name_length,
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.

Parameters
namePointer to the name buffer. The buffer can contain zeros.
name_lengthLength of the name buffer.
indexThe array index (array slot, starting from 0).
valuePointer to the value buffer to be set.
value_lengthLength of the value buffer.
Returns
  • ok if operation was successful
  • bad_type if the given entry does not contain binary array
  • no_such_index if the given index is out of range
  • no_memory if the new entry cannot be allocated
  • no_such_name if the given name cannot be found

Note: The value is copied to the internal buffer.

◆ set_binary_shallow() [1/2]

result yami::core::parameters::set_binary_shallow ( const char *  name,
const void *  value,
std::size_t  value_length 
)

Inserts new entry of type binary.

Inserts (without copy) a new entry of type binary with null-terminated name. See the other overloaded function for details.

◆ set_binary_shallow() [2/2]

result yami::core::parameters::set_binary_shallow ( const char *  name,
std::size_t  name_length,
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.

Parameters
namePointer to the name buffer. The buffer can contain zeros.
name_lengthLength of the name buffer.
valuePointer to the value buffer to be set.
value_lengthLength of the value buffer.
Returns
  • ok if operation was successful
  • no_memory if the new entry cannot be allocated

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.

◆ set_boolean() [1/2]

result yami::core::parameters::set_boolean ( const char *  name,
bool  value 
)

Inserts new entry of type bool.

Inserts a new entry of type bool with null-terminated name. See the other overloaded function for details.

◆ set_boolean() [2/2]

result yami::core::parameters::set_boolean ( const char *  name,
std::size_t  name_length,
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.

Parameters
namePointer to the name buffer. The buffer can contain zeros.
name_lengthLength of the name buffer.
valueValue to be set.
Returns
  • ok if operation was successful
  • no_memory if the new entry cannot be allocated

◆ set_boolean_array() [1/2]

result yami::core::parameters::set_boolean_array ( const char *  name,
const bool *  values,
std::size_t  array_length 
)

Inserts new entry of type bool array.

Inserts a new entry of type bool array with null-terminated name. See the other overloaded function for details.

◆ set_boolean_array() [2/2]

result yami::core::parameters::set_boolean_array ( const char *  name,
std::size_t  name_length,
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.

Parameters
namePointer to the name buffer. The buffer can contain zeros.
name_lengthLength of the name buffer.
valuesPointer to the array of values to be set.
array_lengthLength of the array of values.
Returns
  • ok if operation was successful
  • no_memory if the new entry cannot be allocated

Note: The array of values is copied to the internal buffer.

◆ set_boolean_array_shallow() [1/2]

result yami::core::parameters::set_boolean_array_shallow ( const char *  name,
const bool *  values,
std::size_t  array_length 
)

Inserts new entry of type bool array.

Inserts (without copy) a new entry of type bool array with null-terminated name and value. See the other overloaded function for details.

◆ set_boolean_array_shallow() [2/2]

result yami::core::parameters::set_boolean_array_shallow ( const char *  name,
std::size_t  name_length,
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.

Parameters
namePointer to the name buffer. The buffer can contain zeros.
name_lengthLength of the name buffer.
valuesPointer to the array of values to be set.
array_lengthLength of the array of values.
Returns
  • ok if operation was successful
  • no_memory if the new entry cannot be allocated

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.

◆ set_double_float() [1/2]

result yami::core::parameters::set_double_float ( const char *  name,
double  value 
)

Inserts new entry of type double.

Inserts a new entry of type double with null-terminated name. See the other overloaded function for details.

◆ set_double_float() [2/2]

result yami::core::parameters::set_double_float ( const char *  name,
std::size_t  name_length,
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.

Parameters
namePointer to the name buffer. The buffer can contain zeros.
name_lengthLength of the name buffer.
valueValue to be set.
Returns
  • ok if operation was successful
  • no_memory if the new entry cannot be allocated

◆ set_double_float_array() [1/2]

result yami::core::parameters::set_double_float_array ( const char *  name,
const double *  values,
std::size_t  array_length 
)

Inserts new entry of type double array.

Inserts a new entry of type double array with null-terminated name. See the other overloaded function for details.

◆ set_double_float_array() [2/2]

result yami::core::parameters::set_double_float_array ( const char *  name,
std::size_t  name_length,
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.

Parameters
namePointer to the name buffer. The buffer can contain zeros.
name_lengthLength of the name buffer.
valuesPointer to the array of values to be set.
array_lengthLength of the array of values.
Returns
  • ok if operation was successful
  • no_memory if the new entry cannot be allocated

Note: The array of values is copied to the internal buffer.

◆ set_double_float_array_shallow() [1/2]

result yami::core::parameters::set_double_float_array_shallow ( const char *  name,
const double *  values,
std::size_t  array_length 
)

Inserts new entry of type double array.

Inserts (without copy) a new entry of type double array with null-terminated name and value. See the other overloaded function for details.

◆ set_double_float_array_shallow() [2/2]

result yami::core::parameters::set_double_float_array_shallow ( const char *  name,
std::size_t  name_length,
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.

Parameters
namePointer to the name buffer. The buffer can contain zeros.
name_lengthLength of the name buffer.
valuesPointer to the array of values to be set.
array_lengthLength of the array of values.
Returns
  • ok if operation was successful
  • no_memory if the new entry cannot be allocated

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.

◆ set_integer() [1/2]

result yami::core::parameters::set_integer ( const char *  name,
int  value 
)

Inserts new entry of type int.

Inserts a new entry of type int with null-terminated name. See the other overloaded function for details.

◆ set_integer() [2/2]

result yami::core::parameters::set_integer ( const char *  name,
std::size_t  name_length,
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.

Parameters
namePointer to the name buffer. The buffer can contain zeros.
name_lengthLength of the name buffer.
valueValue to be set.
Returns
  • ok if operation was successful
  • no_memory if the new entry cannot be allocated

◆ set_integer_array() [1/2]

result yami::core::parameters::set_integer_array ( const char *  name,
const int *  values,
std::size_t  array_length 
)

Inserts new entry of type int array.

Inserts a new entry of type int array with null-terminated name. See the other overloaded function for details.

◆ set_integer_array() [2/2]

result yami::core::parameters::set_integer_array ( const char *  name,
std::size_t  name_length,
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.

Parameters
namePointer to the name buffer. The buffer can contain zeros.
name_lengthLength of the name buffer.
valuesPointer to the array of values to be set.
array_lengthLength of the array of values.
Returns
  • ok if operation was successful
  • no_memory if the new entry cannot be allocated

Note: The array of values is copied to the internal buffer.

◆ set_integer_array_shallow() [1/2]

result yami::core::parameters::set_integer_array_shallow ( const char *  name,
const int *  values,
std::size_t  array_length 
)

Inserts new entry of type int array.

Inserts (without copy) a new entry of type int array with null-terminated name and value. See the other overloaded function for details.

◆ set_integer_array_shallow() [2/2]

result yami::core::parameters::set_integer_array_shallow ( const char *  name,
std::size_t  name_length,
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.

Parameters
namePointer to the name buffer. The buffer can contain zeros.
name_lengthLength of the name buffer.
valuesPointer to the array of values to be set.
array_lengthLength of the array of values.
Returns
  • ok if operation was successful
  • no_memory if the new entry cannot be allocated

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.

◆ set_long_long() [1/2]

result yami::core::parameters::set_long_long ( const char *  name,
long long  value 
)

Inserts new entry of type long long.

Inserts a new entry of type long long with null-terminated name. See the other overloaded function for details.

◆ set_long_long() [2/2]

result yami::core::parameters::set_long_long ( const char *  name,
std::size_t  name_length,
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.

Parameters
namePointer to the name buffer. The buffer can contain zeros.
name_lengthLength of the name buffer.
valueValue to be set.
Returns
  • ok if operation was successful
  • no_memory if the new entry cannot be allocated

◆ set_long_long_array() [1/2]

result yami::core::parameters::set_long_long_array ( const char *  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 with null-terminated name. See the other overloaded function for details.

◆ set_long_long_array() [2/2]

result yami::core::parameters::set_long_long_array ( const char *  name,
std::size_t  name_length,
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.

Parameters
namePointer to the name buffer. The buffer can contain zeros.
name_lengthLength of the name buffer.
valuesPointer to the array of values to be set.
array_lengthLength of the array of values.
Returns
  • ok if operation was successful
  • no_memory if the new entry cannot be allocated

Note: The array of values is copied to the internal buffer.

◆ set_long_long_array_shallow() [1/2]

result yami::core::parameters::set_long_long_array_shallow ( const char *  name,
const long long *  values,
std::size_t  array_length 
)

Inserts new entry of type long long array.

Inserts (without copy) a new entry of type long long array with null-terminated name and value. See the other overloaded function for details.

◆ set_long_long_array_shallow() [2/2]

result yami::core::parameters::set_long_long_array_shallow ( const char *  name,
std::size_t  name_length,
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.

Parameters
namePointer to the name buffer. The buffer can contain zeros.
name_lengthLength of the name buffer.
valuesPointer to the array of values to be set.
array_lengthLength of the array of values.
Returns
  • ok if operation was successful
  • no_memory if the new entry cannot be allocated

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.

◆ set_long_long_word() [1/2]

result yami::core::parameters::set_long_long_word ( const char *  name,
std::size_t  name_length,
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.

Parameters
namePointer to the name buffer. The buffer can contain zeros.
name_lengthLength of the name buffer.
valueValue to be set.
Returns
  • ok if operation was successful
  • no_memory if the new entry cannot be allocated

◆ set_long_long_word() [2/2]

result yami::core::parameters::set_long_long_word ( const char *  name,
unsigned long long  value 
)

Inserts new entry of type unsigned long long.

Inserts a new entry of type unsigned long long with null-terminated name. See the other overloaded function for details.

◆ set_long_long_word_array() [1/2]

result yami::core::parameters::set_long_long_word_array ( const char *  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 with null-terminated name. See the other overloaded function for details.

◆ set_long_long_word_array() [2/2]

result yami::core::parameters::set_long_long_word_array ( const char *  name,
std::size_t  name_length,
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.

Parameters
namePointer to the name buffer. The buffer can contain zeros.
name_lengthLength of the name buffer.
valuesPointer to the array of values to be set.
array_lengthLength of the array of values.
Returns
  • ok if operation was successful
  • no_memory if the new entry cannot be allocated

Note: The array of values is copied to the internal buffer.

◆ set_long_long_word_array_shallow() [1/2]

result yami::core::parameters::set_long_long_word_array_shallow ( const char *  name,
const unsigned long long *  values,
std::size_t  array_length 
)

Inserts new entry of type unsigned long long array.

Inserts (without copy) a new entry of type unsigned long long array with null-terminated name and value. See the other overloaded function for details.

◆ set_long_long_word_array_shallow() [2/2]

result yami::core::parameters::set_long_long_word_array_shallow ( const char *  name,
std::size_t  name_length,
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.

Parameters
namePointer to the name buffer. The buffer can contain zeros.
name_lengthLength of the name buffer.
valuesPointer to the array of values to be set.
array_lengthLength of the array of values.
Returns
  • ok if operation was successful
  • no_memory if the new entry cannot be allocated

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.

◆ set_string() [1/2]

result yami::core::parameters::set_string ( const char *  name,
const char *  value 
)

Inserts new entry of type string.

Inserts a new entry of type string with null-terminated name and value. See the other overloaded function for details.

◆ set_string() [2/2]

result yami::core::parameters::set_string ( const char *  name,
std::size_t  name_length,
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.

Parameters
namePointer to the name buffer. The buffer can contain zeros.
name_lengthLength of the name buffer.
valuePointer to the value buffer to be set. The buffer can contain zeros.
value_lengthLength of the value buffer.
Returns
  • ok if operation was successful
  • no_memory if the new entry cannot be allocated

Note: The value is copied to the internal buffer.

◆ set_string_in_array() [1/2]

result yami::core::parameters::set_string_in_array ( const char *  name,
std::size_t  index,
const char *  value 
)

Inserts new string value to string array.

Inserts a new null-terminated string value to already existing string array (given by null-terminated name) at the given index. See the other overloaded function for details.

◆ set_string_in_array() [2/2]

result yami::core::parameters::set_string_in_array ( const char *  name,
std::size_t  name_length,
std::size_t  index,
const char *  value,
std::size_t  value_length 
)

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.

Parameters
namePointer to the name buffer. The buffer can contain zeros.
name_lengthLength of the name buffer.
indexThe array index (array slot, starting from 0).
valuePointer to the value buffer to be set. The buffer can contain zeros.
value_lengthLength of the value buffer.
Returns
  • ok if operation was successful
  • bad_type if the given entry does not contain string array
  • no_such_index if the given index is out of range
  • no_memory if the new entry cannot be allocated
  • no_such_name if the given name cannot be found

Note: The value is copied to the internal buffer.

◆ set_string_shallow() [1/2]

result yami::core::parameters::set_string_shallow ( const char *  name,
const char *  value 
)

Inserts new entry of type string.

Inserts (without copy) a new entry of type string with null-terminated name and value. See the other overloaded function for details.

◆ set_string_shallow() [2/2]

result yami::core::parameters::set_string_shallow ( const char *  name,
std::size_t  name_length,
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.

Parameters
namePointer to the name buffer. The buffer can contain zeros.
name_lengthLength of the name buffer.
valuePointer to the value buffer to be set. The buffer can contain zeros.
value_lengthLength of the value buffer.
Returns
  • ok if operation was successful
  • no_memory if the new entry cannot be allocated

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.

◆ set_word() [1/2]

result yami::core::parameters::set_word ( const char *  name,
std::size_t  name_length,
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.

Parameters
namePointer to the name buffer. The buffer can contain zeros.
name_lengthLength of the name buffer.
valueValue to be set.
Returns
  • ok if operation was successful
  • no_memory if the new entry cannot be allocated

◆ set_word() [2/2]

result yami::core::parameters::set_word ( const char *  name,
unsigned int  value 
)

Inserts new entry of type unsigned int.

Inserts a new entry of type unsigned int with null-terminated name. See the other overloaded function for details.

◆ set_word_array() [1/2]

result yami::core::parameters::set_word_array ( const char *  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 with null-terminated name. See the other overloaded function for details.

◆ set_word_array() [2/2]

result yami::core::parameters::set_word_array ( const char *  name,
std::size_t  name_length,
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.

Parameters
namePointer to the name buffer. The buffer can contain zeros.
name_lengthLength of the name buffer.
valuesPointer to the array of values to be set.
array_lengthLength of the array of values.
Returns
  • ok if operation was successful
  • no_memory if the new entry cannot be allocated

Note: The array of values is copied to the internal buffer.

◆ set_word_array_shallow() [1/2]

result yami::core::parameters::set_word_array_shallow ( const char *  name,
const unsigned int *  values,
std::size_t  array_length 
)

Inserts new entry of type unsigned int array.

Inserts (without copy) a new entry of type int array with null-terminated name and value. See the other overloaded function for details.

◆ set_word_array_shallow() [2/2]

result yami::core::parameters::set_word_array_shallow ( const char *  name,
std::size_t  name_length,
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.

Parameters
namePointer to the name buffer. The buffer can contain zeros.
name_lengthLength of the name buffer.
valuesPointer to the array of values to be set.
array_lengthLength of the array of values.
Returns
  • ok if operation was successful
  • no_memory if the new entry cannot be allocated

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.

◆ size()

std::size_t yami::core::parameters::size ( ) const

Returns the size of the collection.

Returns the size of the collection - that is, the number of all non-empty slots.

Returns
the size of the collection

The documentation for this class was generated from the following file: