Generic Value Optional management
Eina » Data Types » Containers » Generic Value Storage

## Typedefs

typedef Eina_Value_Union | Eina_Value_Optional

## Functions

static Eina_Value * | eina_value_optional_empty_new (void)
| Creates an empty optional.
EINA_API Eina_Value * | eina_value_optional_new (const Eina_Value_Type *subtype, const void *value)
| Creates an optional eina value with the passed value.
static Eina_Bool | eina_value_optional_empty_is (const Eina_Value *value, Eina_Bool *is_empty)
| Function to know if an eina optional is empty or not.
EINA_API Eina_Bool | eina_value_optional_pset (Eina_Value *value, Eina_Value_Type const *subtype, const void *subvalue)
| Sets the optional with a value.
EINA_API Eina_Bool | eina_value_optional_pget (Eina_Value *value, void *subvalue)
| Gets the value from an optional.
EINA_API Eina_Bool | eina_value_optional_reset (Eina_Value *value)
| Resets eina optional to empty.
static const Eina_Value_Type * | eina_value_optional_type_get (Eina_Value *value)
| Gets type from value that is stored on Eina Value Optional.

## Variables

EINA_API const Eina_Value_Type * | EINA_VALUE_TYPE_OPTIONAL
| manages optional type.
EINA_API const Eina_Value_Type * | EINA_VALUE_TYPE_FILE
| manages Eina_File type.
EINA_API const Eina_Value_Type * | EINA_VALUE_TYPE_RECTANGLE
| manages Eina_Rectangle type.
EINA_API const Eina_Value_Type * | EINA_VALUE_TYPE_OPTIONAL = NULL
| manages optional type.
EINA_API const Eina_Value_Type * | EINA_VALUE_TYPE_FILE = NULL
| manages Eina_File type.
EINA_API const Eina_Value_Type * | EINA_VALUE_TYPE_RECTANGLE = NULL
| manages Eina_Rectangle type.

## Detailed Description

## Function Documentation

## eina_value_optional_empty_new()

Eina_Value * eina_value_optional_empty_new | ( | void |  | ) |

inline static

Creates an empty optional.

This is the same as eina_value_new(EINA_VALUE_TYPE_OPTIONAL).

Returns
  returns an empty optional eina value.

Since
  1.17

## eina_value_optional_new()

EINA_API Eina_Value * eina_value_optional_new | ( | const Eina_Value_Type * | subtype,
|  | const void * | value )

Creates an optional eina value with the passed value.

Parameters

  [in] | subtype | Eina_Value_Type of parameter value
  [in] | value | The value to be used to construct optional eina value

Returns
  EINA_TRUE on success, EINA_FALSE otherwise.

Since
  1.17

References EINA_API, EINA_ARG_NONNULL, and eina_value_optional_new().

Referenced by eina_value_optional_new().

## eina_value_optional_empty_is()

Eina_Bool eina_value_optional_empty_is | ( | const Eina_Value * | value,
|  | Eina_Bool * | is_empty )

inline static

Function to know if an eina optional is empty or not.

Parameters

  [in] | value | Eina Value Optional
  [out] | is_empty | EINA_TRUE if optional is empty, EINA_FALSE otherwise.

Returns
  EINA_TRUE on success, EINA_FALSE otherwise.

Since
  1.17

References EINA_ARG_NONNULL.

## eina_value_optional_pset()

EINA_API Eina_Bool eina_value_optional_pset | ( | Eina_Value * | value,
|  | Eina_Value_Type const * | subtype,
|  | const void * | subvalue )

Sets the optional with a value.

Parameters

  [in,out] | value | Eina Value Optional to be set with subvalue
  [in] | subtype | Type of subvalue
  [in] | subvalue | Value to be set in optional

Returns
  EINA_TRUE on success, EINA_FALSE otherwise.

Since
  1.17

References EINA_API, EINA_ARG_NONNULL, and eina_value_optional_pset().

Referenced by eina_value_optional_pset().

## eina_value_optional_pget()

EINA_API Eina_Bool eina_value_optional_pget | ( | Eina_Value * | value,
|  | void * | subvalue )

Gets the value from an optional.

Parameters

  [in] | value | Eina Value Optional to get value from
  [out] | subvalue | Pointer to where value is to be copied to. You must use the correct type according to eina_value_optional_type_get

Returns
  EINA_TRUE on success, EINA_FALSE otherwise.

Since
  1.17

References EINA_API, EINA_ARG_NONNULL, and eina_value_optional_pget().

Referenced by eina_value_optional_pget().

## eina_value_optional_reset()

EINA_API Eina_Bool eina_value_optional_reset | ( | Eina_Value * | value | ) |

Resets eina optional to empty.

Parameters

  [in,out] | value | Eina Value Optional

Returns
  EINA_TRUE on success, EINA_FALSE otherwise.

Since
  1.17

References EINA_API, EINA_ARG_NONNULL, and eina_value_optional_reset().

Referenced by eina_value_optional_reset().

## eina_value_optional_type_get()

const Eina_Value_Type * eina_value_optional_type_get | ( | Eina_Value * | value | ) |

inline static

Gets type from value that is stored on Eina Value Optional.

Parameters

  [in] | value | Eina Value Optional

Returns
  The optional sub-type.

Since
  1.17

References EINA_API, EINA_ARG_NONNULL, EINA_VALUE_TYPE_FILE, and EINA_VALUE_TYPE_RECTANGLE.

## Variable Documentation

## EINA_VALUE_TYPE_OPTIONAL [1/2]

EINA_API const Eina_Value_Type* EINA_VALUE_TYPE_OPTIONAL

extern

manages optional type.

Since
  1.17

Referenced by eina_value_type_pget().

## EINA_VALUE_TYPE_FILE [1/2]

EINA_API const Eina_Value_Type* EINA_VALUE_TYPE_FILE

extern

manages Eina_File type.

Since
  1.21

Referenced by eina_value_optional_type_get().

## EINA_VALUE_TYPE_RECTANGLE [1/2]

EINA_API const Eina_Value_Type* EINA_VALUE_TYPE_RECTANGLE

extern

manages Eina_Rectangle type.

Since
  1.21

Referenced by eina_value_optional_type_get().

## EINA_VALUE_TYPE_OPTIONAL [2/2]

EINA_API const Eina_Value_Type* EINA_VALUE_TYPE_OPTIONAL = NULL

manages optional type.

Since
  1.17

Referenced by eina_value_type_pget().

## EINA_VALUE_TYPE_FILE [2/2]

EINA_API const Eina_Value_Type* EINA_VALUE_TYPE_FILE = NULL

manages Eina_File type.

Since
  1.21

Referenced by eina_value_optional_type_get().

## EINA_VALUE_TYPE_RECTANGLE [2/2]

EINA_API const Eina_Value_Type* EINA_VALUE_TYPE_RECTANGLE = NULL

manages Eina_Rectangle type.

Since
  1.21

Referenced by eina_value_optional_type_get().