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

Collection of message parameters. More...

#include <parameters.h>

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

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...
 

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:

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.

Constructor & Destructor Documentation

◆ parameters() [1/2]

yami::parameters::parameters ( )

Constructor.

Creates an empty parameters object.

◆ parameters() [2/2]

yami::parameters::parameters ( core::parameters *  external)
explicit

Constructor.

Constructor, allows to wrap existing object from the core part of the YAMI library. The wrapped core object is not owned.

◆ ~parameters()

yami::parameters::~parameters ( )
inline

Destructor.

The destructor cleans all dependent resources.

Member Function Documentation

◆ begin()

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.

Returns
the iterator pointing to the beginning of the collection

◆ clear()

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.

◆ create_binary_array()

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.

Parameters
nameName of the new entry or the entry to be replaced.
array_lengthLength of the newly created array.

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

◆ create_nested_array()

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.

Parameters
nameName of the new entry or the entry to be replaced.
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()

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.

Parameters
nameName of the new entry or the entry to be replaced.
Returns
Pointer to the internally created parameters object; the return value can be used to initialize wrapper parameters object.

◆ create_string_array()

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.

Parameters
nameName of the new entry or the entry to be replaced.
array_lengthLength of the newly created array.

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

◆ deserialize()

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.

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.

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.

◆ end()

iterator yami::parameters::end ( ) const

Extracts the ending iterator for this collection.

Extracts the iterator pointing past the end of the collection.

Returns
the iterator pointing past the end of the collection

◆ find()

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.

Parameters
nameName of the entry.
entryThe entry view to be returned.
Returns
  • true if the entry has been found
  • false if the given name cannot be found

◆ get_binary()

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.

Parameters
nameName of the entry.
lengthLength of the internal buffer.
Returns
Value of the entry if it has correct type.

◆ get_binary_array_length()

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.

Parameters
nameName of the entry containing binary array.
Returns
Length of the array.

◆ get_binary_in_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.

Parameters
nameName of the entry containing binary array.
indexThe array index (array slot to be read, starting from 0).
lengthLength of the value buffer.
Returns
Value from array.

◆ get_boolean()

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.

Parameters
nameName of the entry.
Returns
Value of the entry if it has correct type.

◆ get_boolean_array()

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.

Parameters
nameName of the entry.
array_lengthLength of the internal array.
Returns
Pointer to the internal array buffer.

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

◆ get_core_object()

virtual const core::parameters & yami::parameters::get_core_object ( ) const
virtual

Provides access to the underlying core object.

Implements yami::serializable.

◆ get_double_float()

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.

Parameters
nameName of the entry.
Returns
Value of the entry if it has correct type.

◆ get_double_float_array()

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.

Parameters
nameName of the entry.
array_lengthLength of the internal array.
Returns
Pointer to the internally managed array buffer.

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

◆ get_integer()

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.

Parameters
nameName of the entry.
Returns
Value of the entry if it has correct type.

◆ get_integer_array()

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.

Parameters
nameName of the entry.
array_lengthLength of the internal array.
Returns
Pointer to the internal array buffer.

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

◆ get_long_long()

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.

Parameters
nameName of the entry.
Returns
Value of the entry if it has correct type.

◆ get_long_long_array()

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.

Parameters
nameName of the entry.
array_lengthLength of the internal array.
Returns
Pointer to the internal array buffer.

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

◆ get_long_long_word()

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.

Parameters
nameName of the entry.
Returns
Value of the entry if it has correct type.

◆ get_long_long_word_array()

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.

Parameters
nameName of the entry.
array_lengthLength of the internal array.
Returns
Pointer to the internal array buffer.

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

◆ get_nested_array_length()

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.

Parameters
nameName of the entry containing nested parameters array.
Returns
Length of the array.

◆ get_nested_in_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.

Parameters
nameName of the entry containing nested parameters array.
indexThe array index (array slot to be read, starting from 0).
Returns
Pointer to the internally stored parameters object; the return value can be used to initialize wrapper parameters object.

◆ get_nested_parameters()

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.

Parameters
nameName of the entry.
Returns
Pointer to the internally stored parameters object; the return value can be used to initialize wrapper parameters object.

◆ get_string() [1/2]

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.

Parameters
nameName of the entry.
Returns
Value of the entry if it has correct type.

◆ get_string() [2/2]

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.

Parameters
nameName of the entry.
lengthLength of the internal buffer.
Returns
Value of the entry if it has correct type.

◆ get_string_array_length()

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.

Parameters
nameName of the entry containing string array.
Returns
Length of the array.

◆ get_string_in_array() [1/2]

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.

Parameters
nameName of the entry containing string array.
indexThe array index (array slot to be read, starting from 0).
Returns
Value from array.

◆ get_string_in_array() [2/2]

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.

Parameters
nameName of the entry containing string array.
indexThe array index (array slot to be read, starting from 0).
lengthLength of the value buffer.
Returns
Value from array.

◆ get_word()

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.

Parameters
nameName of the entry.
Returns
Value of the entry if it has correct type.

◆ get_word_array()

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.

Parameters
nameName of the entry.
array_lengthLength of the internal array.
Returns
Pointer to the internal array buffer.

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

◆ merge_from()

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.

Parameters
otherThe object to be merged into this object.

◆ remove() [1/2]

void yami::parameters::remove ( const std::string &  name)

Removes the given entry.

Removes the entry given by its name.

Parameters
nameName 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.

◆ remove() [2/2]

void yami::parameters::remove ( iterator  it)

Removes the entry given by its iterator.

Removes the entry given by its iterator.

Parameters
itIterator 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.

◆ serialize()

virtual void yami::parameters::serialize ( char **  buffers,
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.

Implements yami::serializable.

◆ serialize_buffer_size()

virtual std::size_t yami::parameters::serialize_buffer_size ( ) const
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.

◆ set_binary()

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.

Parameters
nameName of the new entry or the entry to be replaced.
valueValue to be set.
value_lengthLength of the value buffer.

◆ set_binary_in_array()

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.

Parameters
nameName of the entry containing string array.
indexThe array index (array slot, starting from 0).
valuePointer to the value buffer to be set.
value_lengthLength of the value buffer.

Note: The value is copied to the internal buffer.

◆ set_binary_shallow()

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.

Parameters
nameName of the new entry or the entry to be replaced.
valuePointer to the value buffer to be set. The buffer can contain zeros.
value_lengthLength 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.

◆ set_boolean()

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.

Parameters
nameName of the new entry or the entry to be replaced.
valueValue to be set.

◆ set_boolean_array()

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.

Parameters
nameName of the new entry or the entry to be replaced.
valuesPointer to the array of values to be set.
array_lengthLength of the array of values.

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

◆ set_boolean_array_shallow()

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.

Parameters
nameName of the new entry or the entry to be replaced.
valuesPointer to the array of values to be set.
array_lengthLength 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.

◆ set_double_float()

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.

Parameters
nameName of the new entry or the entry to be replaced.
valueValue to be set.

◆ set_double_float_array()

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.

Parameters
nameName of the new entry or the entry to be replaced.
valuesPointer to the array of values to be set.
array_lengthLength of the array of values.

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

◆ set_double_float_array_shallow()

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.

Parameters
nameName of the new entry or the entry to be replaced.
valuesPointer to the array of values to be set.
array_lengthLength 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.

◆ set_integer()

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.

Parameters
nameName of the new entry or the entry to be replaced.
valueValue to be set.

◆ set_integer_array()

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.

Parameters
nameName of the new entry or the entry to be replaced.
valuesPointer to the array of values to be set.
array_lengthLength of the array of values.

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

◆ set_integer_array_shallow()

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.

Parameters
nameName of the new entry or the entry to be replaced.
valuesPointer to the array of values to be set.
array_lengthLength 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.

◆ set_long_long()

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.

Parameters
nameName of the new entry or the entry to be replaced.
valueValue to be set.

◆ set_long_long_array()

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.

Parameters
nameName of the new entry or the entry to be replaced.
valuesPointer to the array of values to be set.
array_lengthLength of the array of values.

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

◆ set_long_long_array_shallow()

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.

Parameters
nameName of the new entry or the entry to be replaced.
valuesPointer to the array of values to be set.
array_lengthLength 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.

◆ set_long_long_word()

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.

Parameters
nameName of the new entry or the entry to be replaced.
valueValue to be set.

◆ set_long_long_word_array()

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.

Parameters
nameName of the new entry or the entry to be replaced.
valuesPointer to the array of values to be set.
array_lengthLength of the array of values.

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

◆ set_long_long_word_array_shallow()

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.

Parameters
nameName of the new entry or the entry to be replaced.
valuesPointer to the array of values to be set.
array_lengthLength 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.

◆ set_string()

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.

Parameters
nameName of the new entry or the entry to be replaced.
valueValue to be set.

◆ set_string_in_array()

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.

Parameters
nameName of the entry containing string array.
indexThe array index (array slot, starting from 0).
valueValue to be set.

Note: The value is copied to the internal buffer.

◆ set_string_shallow()

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.

Parameters
nameName of the new entry or the entry to be replaced.
valuePointer to the value buffer to be set. The buffer can contain zeros.
value_lengthLength 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.

◆ set_word()

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.

Parameters
nameName of the new entry or the entry to be replaced.
valueValue to be set.

◆ set_word_array()

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.

Parameters
nameName of the new entry or the entry to be replaced.
valuesPointer to the array of values to be set.
array_lengthLength of the array of values.

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

◆ set_word_array_shallow()

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.

Parameters
nameName of the new entry or the entry to be replaced.
valuesPointer to the array of values to be set.
array_lengthLength 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.

◆ size()

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.

Returns
the size of the collection

◆ swap()

void yami::parameters::swap ( parameters other)

Swap operation.

The (no-throw) swap operation.

◆ type()

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.

Parameters
nameName of the entry.
Returns
type of the given entry.

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