YAMI4 - core
yami::core::parameter_entry Class Reference

Read-only view on the parameters entry. More...

#include <parameter_entry.h>

List of all members.

Public Member Functions

parameter_type type () const
 Returns the type of underlying (current) entry.
void get_name (const char *&name, std::size_t &name_length) const
 Extracts the name of current entry.
result get_boolean (bool &value) const
 Extracts the bool value from the current entry.
result get_integer (int &value) const
 Extracts the int value from the current entry.
result get_long_long (long long &value) const
 Extracts the long long value from the current entry.
result get_double_float (double &value) const
 Extracts the double value from the current entry.
result get_string (const char *&value, std::size_t &value_length) const
 Extracts the string value from the current entry.
result get_binary (const void *&value, std::size_t &value_length) const
 Extracts the binary value from the current entry.
result get_nested_parameters (parameters *&params) const
 Extracts the nested parameters object from the current entry.
result get_boolean_array (bool *&values, std::size_t &array_length) const
 Extracts the array of bool values from the current entry.
result get_integer_array (int *&values, std::size_t &array_length) const
 Extracts the array of int values from the current entry.
result get_long_long_array (long long *&values, std::size_t &array_length) const
 Extracts the array of long long values from the current entry.
result get_double_float_array (double *&values, std::size_t &array_length) const
 Extracts the array of double values from the current entry.
result get_string_array_length (std::size_t &length) const
 Extracts the length of string array.
result get_string_in_array (std::size_t index, const char *&value, std::size_t &value_length) const
 Extracts string value from string array.
result get_binary_array_length (std::size_t &length) const
 Extracts the length of binary array.
result get_binary_in_array (std::size_t index, const void *&value, std::size_t &value_length) const
 Extracts binary value from binary array.

Detailed Description

Read-only view on the parameters entry.

See also:
parameters

Member Function Documentation

parameter_type parameter_entry::type ( ) const

Returns the type of the underlying entry in the associated parameters object.

Returns:
Type of the entry.
void parameter_entry::get_name ( const char *&  name,
std::size_t &  name_length 
) const

Extracts the name of the underlying entry in the associated parameters object.

Parameters:
namePointer to the internal name buffer to be returned.
name_lengthLength of the internal name buffer.
result parameter_entry::get_boolean ( bool &  value) const

Extracts the bool value from the current entry.

Parameters:
valueThe value to be returned.
Returns:
  • ok if operation was successful
  • bad_type if the current entry does not contain the bool value
result parameter_entry::get_integer ( int &  value) const

Extracts the int value from the current entry.

Parameters:
valueThe value to be returned.
Returns:
  • ok if operation was successful
  • bad_type if the current entry does not contain the int value
result parameter_entry::get_long_long ( long long &  value) const

Extracts the long long value from the current entry.

Parameters:
valueThe value to be returned.
Returns:
  • ok if operation was successful
  • bad_type if the current entry does not contain the long long value
result parameter_entry::get_double_float ( double &  value) const

Extracts the double value from the current entry.

Parameters:
valueThe value to be returned.
Returns:
  • ok if operation was successful
  • bad_type if the current entry does not contain the double value
result parameter_entry::get_string ( const char *&  value,
std::size_t &  value_length 
) const

Extracts the string value from the current entry.

Parameters:
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 current entry does not contain the string value
result parameter_entry::get_binary ( const void *&  value,
std::size_t &  value_length 
) const

Extracts the binary value from the current entry.

Parameters:
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 current entry does not contain the binary value
result parameter_entry::get_nested_parameters ( parameters *&  params) const

Extracts nested parameters from the current entry.

Parameters:
paramsPointer to the internally created parameters object.
Returns:
  • ok if operation was successful
  • bad_type if the current entry does not contain nested parameters
result parameter_entry::get_boolean_array ( bool *&  values,
std::size_t &  array_length 
) const

Extracts the array of bool values from the current entry.

Parameters:
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 current entry does not contain bool array

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

result parameter_entry::get_integer_array ( int *&  values,
std::size_t &  array_length 
) const

Extracts the array of int values from the current entry.

Parameters:
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 current entry does not contain int array

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

result parameter_entry::get_long_long_array ( long long *&  values,
std::size_t &  array_length 
) const

Extracts the array of long long values from the current entry.

Parameters:
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 current entry does not contain long long array

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

result parameter_entry::get_double_float_array ( double *&  values,
std::size_t &  array_length 
) const

Extracts the array of double values from the current entry.

Parameters:
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 current entry does not contain double array

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

result parameter_entry::get_string_array_length ( std::size_t &  length) const

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

Parameters:
lengthLength of the array.
Returns:
  • ok if operation was successful
  • bad_type if the current entry does not contain string array
result parameter_entry::get_string_in_array ( std::size_t  index,
const char *&  value,
std::size_t &  value_length 
) const

Extracts the string value from the given index of string array that is located at the current entry.

Parameters:
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 current entry does not contain string array
  • no_such_index if the given index is out of range
result parameter_entry::get_binary_array_length ( std::size_t &  length) const

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

Parameters:
lengthLength of the array.
Returns:
  • ok if operation was successful
  • bad_type if the current entry does not contain binary array
result parameter_entry::get_binary_in_array ( std::size_t  index,
const void *&  value,
std::size_t &  value_length 
) const

Extracts the binary value from the given index of binary array that is located at the current entry.

Parameters:
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 current entry does not contain binary array
  • no_such_index if the given index is out of range