_Eina_Future_Race_Result Struct Reference

Data Fields
_Eina_Future_Race_Result Struct Reference
Eina » Eina Promises » Eina Futures

The struct that is used to store the race result. More...

## Data Fields
Eina_Value | value
| The race result.
unsigned int | index
| The future index that won the race.

## Detailed Description

The struct that is used to store the race result.

When using eina_promise_race_array() and friends, the future result will be reported as a struct. The values can be obtained using eina_value_struct_get() or one could access the struct directly such as this example:

static Eina_Value
_race_cb(const void *data EINA_UNUSED, const Eina_Value v)
{
//code...
Eina_Value_Struct st;
Eina_Future_Race_Result *rr;
eina_value_get(v, &st);
rr = st.memory;
printf("Winning future index: %u\n", rr->index);
//more code..
return v;
}
EINA_UNUSED
#define EINA_UNUSED
Used to indicate that a function parameter is purposely unused.
Definition: eina_types.h:339
eina_value_get
static Eina_Bool eina_value_get(const Eina_Value *value,...)
Gets the generic value.
_Eina_Future_Race_Result
The struct that is used to store the race result.
Definition: eina_promise.h:1590
_Eina_Value_Struct
Used to store the memory and its description.
Definition: eina_value.h:3180
_Eina_Value_Struct::memory
void * memory
The managed structure memory.
Definition: eina_value.h:3182
_Eina_Value
defines the contents of a value
Definition: eina_value.h:662

See also
  eina_promise_race_array()
  eina_future_race_array()
  eina_promise_race()
  eina_future_race()
  EINA_PROMISE_RACE_STRUCT_DESC