efl::eina::value Class Reference

- Main Page
- Related Pages
- Modules
- Namespaces
- Data Structures
- Files
- Examples

- Data Structures
- Data Structure Index
- Class Hierarchy
- Data Fields

Public Types | Public Member Functions | Friends
efl::eina::value Class Reference
Eina C++ » Data Types » Generic Value Storage Eina C++ » | Data Types

Store generic value. More...

## Public Types
typedef Eina_Value * | native_handle_type
| Get a handle for the wrapped `Eina_Value`. More...
typedef Eina_Value_Type const * | type_info_t
| Type for a constant pointer to an `Eina_Value_Type`. More...

## Public Member Functions
| value ()
| Default constructor. More...
template<typename T >
| value (T v)
| Create an generic value storage holding the given argument. More...
| value (char v)
| Create an generic value storage holding a `char` value. More...
| value (short v)
| Create an generic value storage holding a `short` value. More...
| value (int v)
| Create an generic value storage holding a `int` value. More...
| value (long v)
| Create an generic value storage holding a `long` value. More...
| value (unsigned char v)
| Create an generic value storage holding a `unsigned char` value. More...
| value (unsigned short v)
| Create an generic value storage holding a `unsigned short` value. More...
| value (unsigned int v)
| Create an generic value storage holding a `unsigned int` value. More...
| value (unsigned long v)
| Create an generic value storage holding a `unsigned long` value. More...
| value (float v)
| Create an generic value storage holding a `float` value. More...
| value (double v)
| Create an generic value storage holding a `double` value. More...
| ~value ()
| Deallocate stored value.
| value (value const &other)
| Copy Constructor. More...
value & | operator= (value const &other)
| Assignment operator. More...
void | swap (value &other)
| Swap stored values with the given `eina::value` object. More...
native_handle_type | native_handle () const
type_info_t | type_info () const
| Get an identifier for the type of the value currently stored. More...

## Friends
template<typename T >
T | get (value const &v)
| Get the data stored in the given `eina::value`. More...

## Detailed Description

Store generic value.

## Member Typedef Documentation

typedef Eina_Value* efl::eina::value::native_handle_type

Get a handle for the wrapped `Eina_Value`.

Returns
  Handle for the native `Eina_Value`.

This member function returns the native `Eina_Value` handle that is wrapped inside this object.

Warning
  It is important to take care when using it, since the handle will be automatically released upon object destruction.

typedef Eina_Value_Type const* efl::eina::value::type_info_t

Type for a constant pointer to an `Eina_Value_Type`.

Describes the type of the data being stored.

## Constructor & Destructor Documentation

efl::eina::value::value | ( |  | ) |
| inline

Default constructor.

Create an empty generic value storage.

template<typename T >

efl::eina::value::value | ( | T | v | ) |
| inline

Create an generic value storage holding the given argument.

Parameters

  v | Value to be stored.

efl::eina::value::value | ( | char | v | ) |
| inline

Create an generic value storage holding a `char` value.

Parameters

  v | `char` value to be stored.

efl::eina::value::value | ( | short | v | ) |
| inline

Create an generic value storage holding a `short` value.

Parameters

  v | `short` value to be stored.

efl::eina::value::value | ( | int | v | ) |
| inline

Create an generic value storage holding a `int` value.

Parameters

  v | `int` value to be stored.

efl::eina::value::value | ( | long | v | ) |
| inline

Create an generic value storage holding a `long` value.

Parameters

  v | `long` value to be stored.

efl::eina::value::value | ( | unsigned char | v | ) |
| inline

Create an generic value storage holding a `unsigned char` value.

Parameters

  v | `unsigned char` value to be stored.

efl::eina::value::value | ( | unsigned short | v | ) |
| inline

Create an generic value storage holding a `unsigned short` value.

Parameters

  v | `unsigned short` value to be stored.

efl::eina::value::value | ( | unsigned int | v | ) |
| inline

Create an generic value storage holding a `unsigned int` value.

Parameters

  v | `unsigned int` value to be stored.

efl::eina::value::value | ( | unsigned long | v | ) |
| inline

Create an generic value storage holding a `unsigned long` value.

Parameters

  v | `unsigned long` value to be stored.

efl::eina::value::value | ( | float | v | ) |
| inline

Create an generic value storage holding a `float` value.

Parameters

  v | `float` value to be stored.

efl::eina::value::value | ( | double | v | ) |
| inline

Create an generic value storage holding a `double` value.

Parameters

  v | `double` value to be stored.

efl::eina::value::value | ( | value const & | other | ) |
| inline

Copy Constructor.

Create an generic value storage holding the same value of `other`.

Parameters

  other | Another `eina::value` object.

References eina_value_copy(), and efl::eina::get_error_code().

## Member Function Documentation

value& efl::eina::value::operator= | ( | value const & | other | ) |
| inline

Assignment operator.

Replace the current stored value by the value in `other`.

Parameters

  other | Another `eina::value` object.

References eina_value_copy(), eina_value_flush(), and efl::eina::get_error_code().

void efl::eina::value::swap | ( | value & | other | ) |
| inline

Swap stored values with the given `eina::value` object.

Parameters

  other | Another `eina::value` object.

References efl::eina::swap().

Referenced by efl::eina::swap().

type_info_t efl::eina::value::type_info | ( |  | ) | const
| inline

Get an identifier for the type of the value currently stored.

Returns
  `Eina_Value_Type` instance or `NULL` if type is invalid.

References eina_value_type_get().

Referenced by efl::eina::operator<(), efl::eina::operator==(), and efl::eina::operator>().

## Friends And Related Function Documentation

template<typename T >

T get | ( | value const & | v | ) |
| friend

Get the data stored in the given `eina::value`.

Parameters

  v | `eina::value` object.
  T | Type of the value stored.

Returns
  Copy of the value stored in `v`.

Exceptions

  <tt>eina::system_error</tt> | with error the code `EINA_ERROR_VALUE_FAILED` if `T` doesn't match the type of the value currently stored. Or `eina::system_error` with an internal Eina error code if the operation fails for another reason.

This function returns the value stored in `v`. The type of the value must be specified via the template parameter `T`, and must match the current stored value type.