Data Model Utilities
[Data Model API]

Miscellaneous utilities to help usage or debug of Data Model API. More...

Data Structures

struct  _Eina_Model_XRef
 Extended reference to model. More...

Typedefs

typedef struct _Eina_Model_XRef Eina_Model_XRef
 Extended reference to model.

Functions

Eina_Bool eina_model_instance_check (const Eina_Model *model, const Eina_Model_Type *type)
 Checks if model is an instance of type.
Eina_Bool eina_model_interface_implemented (const Eina_Model *model, const Eina_Model_Interface *iface)
 Checks if model implements iface.
int eina_model_refcount (const Eina_Model *model)
 Returns the number of references to model.
const Eina_Inlisteina_model_xrefs_get (const Eina_Model *model)
 Returns the current references of this model.
void eina_models_usage_dump (void)
 Dump usage of all existing modules.
Eina_Listeina_models_list_get (void)
 Return a list of all live models.
void eina_models_list_free (Eina_List *list)
 Release list returned by eina_models_list_get().

Detailed Description

Miscellaneous utilities to help usage or debug of Data Model API.


Typedef Documentation

Extended reference to model.

This is returned by eina_model_xrefs_get() and should never be modified. It is managed by eina_model_xref() and eina_model_xunref() when EINA_MODEL_DEBUG is set to "1" or "backtrace".

See also:
_Eina_Model_XRef explains fields.
Since:
1.2


Function Documentation

Eina_Bool eina_model_instance_check ( const Eina_Model model,
const Eina_Model_Type type 
)

Checks if model is an instance of type.

Parameters:
model The model instance.
type The type being checked for.
Returns:
EINA_TRUE on success, EINA_FALSE on failure.
See also:
eina_model_new()

_Eina_Model_Type

Since:
1.2

References EINA_FALSE.

Eina_Bool eina_model_interface_implemented ( const Eina_Model model,
const Eina_Model_Interface iface 
)

Checks if model implements iface.

Parameters:
model The model instance.
iface The interface being checked for.
Returns:
EINA_TRUE on success, EINA_FALSE on failure.
See also:
_Eina_Model_Interface
Since:
1.2

References EINA_FALSE.

int eina_model_refcount ( const Eina_Model model  ) 

Returns the number of references to model.

Parameters:
model The model to query number of references.
Returns:
Number of references to model.
See also:
eina_model_ref()

eina_model_unref()

eina_model_xref()

eina_model_xunref()

eina_model_xrefs_get()

Since:
1.2

const Eina_Inlist* eina_model_xrefs_get ( const Eina_Model model  ) 

Returns the current references of this model.

Parameters:
model The model to query references.
Returns:
List of reference holders as Eina_Model_XRef. This is the internal list for speed purposes, do not modify or free it in anyway!
Note:
This list only exist if environment variable EINA_MODEL_DEBUG is set to "1" or "backtrace".

The backtrace information is only available if environment variable EINA_MODEL_DEBUG=backtrace is set.

Since:
1.2

void eina_models_usage_dump ( void   ) 

Eina_List* eina_models_list_get ( void   ) 

Return a list of all live models.

Returns:
a newly allocated list of Eina_Model. Free using eina_models_list_free()
Note:
this is meant to debug purposes, do not modify the models in any way!

due performance reasons, this is only enabled when EINA_MODEL_DEBUG is set to "1" or "backtrace".

Since:
1.2

References eina_list_append(), EINA_LIST_FOREACH, eina_lock_release(), eina_lock_take(), eina_model_xref(), and eina_models_list_get().

Referenced by eina_models_list_free(), and eina_models_list_get().

void eina_models_list_free ( Eina_List list  ) 

Release list returned by eina_models_list_get().

Parameters:
list the list to release.

References EINA_LIST_FREE, eina_model_xunref(), and eina_models_list_get().