Public Types | Public Member Functions | Friends
efl::eina::value Class Reference

Store generic value. More...

Public Types

typedef Eina_Valuenative_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...
 
valueoperator= (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 >
get (value const &v)
 Get the data stored in the given eina::value. More...
 

Detailed Description

Store generic value.

Member Typedef Documentation

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

◆ type_info_t

Type for a constant pointer to an Eina_Value_Type.

Describes the type of the data being stored.

Constructor & Destructor Documentation

◆ value() [1/13]

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

Default constructor.

Create an empty generic value storage.

◆ value() [2/13]

template<typename T >
efl::eina::value::value ( v)
inline

Create an generic value storage holding the given argument.

Parameters
vValue to be stored.

◆ value() [3/13]

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

Create an generic value storage holding a char value.

Parameters
vchar value to be stored.

◆ value() [4/13]

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

Create an generic value storage holding a short value.

Parameters
vshort value to be stored.

◆ value() [5/13]

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

Create an generic value storage holding a int value.

Parameters
vint value to be stored.

◆ value() [6/13]

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

Create an generic value storage holding a long value.

Parameters
vlong value to be stored.

◆ value() [7/13]

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

Create an generic value storage holding a unsigned char value.

Parameters
vunsigned char value to be stored.

◆ value() [8/13]

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

Create an generic value storage holding a unsigned short value.

Parameters
vunsigned short value to be stored.

◆ value() [9/13]

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

Create an generic value storage holding a unsigned int value.

Parameters
vunsigned int value to be stored.

◆ value() [10/13]

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

Create an generic value storage holding a unsigned long value.

Parameters
vunsigned long value to be stored.

◆ value() [11/13]

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

Create an generic value storage holding a float value.

Parameters
vfloat value to be stored.

◆ value() [12/13]

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

Create an generic value storage holding a double value.

Parameters
vdouble value to be stored.

◆ value() [13/13]

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

Copy Constructor.

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

Parameters
otherAnother eina::value object.

References eina_value_copy().

Member Function Documentation

◆ operator=()

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

Assignment operator.

Replace the current stored value by the value in other.

Parameters
otherAnother eina::value object.

References eina_value_copy(), and eina_value_flush().

◆ swap()

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

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

Parameters
otherAnother eina::value object.

References efl::eina::swap().

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

◆ type_info()

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

◆ get

template<typename T >
T get ( value const &  v)
friend

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

Parameters
veina::value object.
TType 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.