_Eina_Model_Interface Struct Reference
[Data Model Type management]
API to access models.
More...
Data Fields | |
unsigned int | version |
must be EINA_MODEL_INTERFACE_VERSION | |
unsigned int | private_size |
used to allocate interface private data | |
unsigned int | interface_size |
used to know sizeof(Eina_Model_Interface) or subtypes (which may be bigger, by including Eina_Model_Interface as header | |
const char * | name |
name for debug and introspection | |
const Eina_Model_Interface ** | interfaces |
null terminated array of parent interfaces | |
const Eina_Model_Event_Description * | events |
null terminated array of events | |
Eina_Bool(* | setup )(Eina_Model *model) |
setup interface private data, do not call parent interface setup! | |
Eina_Bool(* | flush )(Eina_Model *model) |
flush interface private data, do not call parent interface flush! | |
Eina_Bool(* | constructor )(Eina_Model *model) |
construct interface instance, setup was already called. | |
Eina_Bool(* | destructor )(Eina_Model *model) |
destruct interface instance, flush will be called after it. | |
Eina_Bool(* | copy )(const Eina_Model *src, Eina_Model *dst) |
copy interface private data, do not call parent interface copy! | |
Eina_Bool(* | deep_copy )(const Eina_Model *src, Eina_Model *dst) |
deep copy interface private data, do not call parent interface deep copy! | |
void * | __extension_ptr0 |
not to be used | |
void * | __extension_ptr1 |
not to be used | |
void * | __extension_ptr2 |
not to be used | |
void * | __extension_ptr3 |
not to be used |
Detailed Description
API to access models.Interfaces are managed by name, then multiple Eina_Model_Interface may have the same name meaning it implements that name.
Each interface will get its own private data of size private_size
(defined at each sub interface), this can be retrieved with eina_model_interface_private_data_get().
Private are created automatically and should be setup with setup
and flushed with flush
. All interfaces functions that exist are called! Don't call your parent's setup
or flush!
The setup is done from parent to child. Flush is done from child to parent (topological sort is applied to interface graph).
- Note:
- The methods
setup
andflush
should exist if there is private data, otherwise memory may be uninitialized or leaks.It is recommended that
constructor
anddestructor
exist to correctly do their roles and call parents in the correct order. Whenever they do not exist, their parent pointer is called.Interface's constructor and destructor are only called by type counterparts. Unlike setup and flush, they are not guaranteed to be called.
use the same name pointer on queries to speed up the lookups!
a runtime check will enforce just types with ABI version EINA_MODEL_INTERFACE_VERSION are used by comparing with the
version
member.
- Since:
- 1.2
Field Documentation
construct interface instance, setup was already called.
Should call parent's constructor if needed
Eina_Bool(* _Eina_Model_Interface::destructor)(Eina_Model *model) |
destruct interface instance, flush will be called after it.
Should call parent's destructor if needed. Release reference to other models here.