Adaptive Framework  0.9.0
All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
Files | Data Structures | Macros | Typedefs | Enumerations | Functions | Variables

Files

file  afw_runtime.h
 Runtime objects adaptor.
 

Data Structures

struct  afw_runtime_custom_s
 
struct  afw_runtime_object_type_meta_s
 
struct  afw_runtime_object_map_property_s
 Struct for runtime object map property. More...
 
struct  afw_runtime_object_map_s
 
struct  afw_runtime_object_indirect_s
 Struct for runtime objects. More...
 
struct  afw_runtime_const_object_instance_s
 
struct  afw_runtime_const_object_meta_object_s
 meta instance with single parent path. More...
 
struct  afw_runtime_property_s
 
struct  afw_runtime_unresolved_const_list_s
 
struct  afw_runtime_unresolved_const_object_s
 
struct  afw_runtime_unresolved_const_embedded_untyped_object_s
 
struct  afw_runtime_unresolved_value_s
 Runtime unresolved value. More...
 
struct  afw_runtime_unresolved_property_s
 Runtime unresolved property. More...
 

Macros

#define AFW_RUNTIME_OBJECT_RTI(label_, meta_)
 
#define AFW_RUNTIME_OBJECT_INF(inf_, meta_)
 

Typedefs

typedef enum afw_runtime_unresolved_primitive_type_e afw_runtime_unresolved_primitive_type_t
 Runtime unresolved primitive value.
 
typedef const afw_object_t *(* afw_runtime_object_wrapper_p_cb_t) (void *data, const afw_pool_t *p, afw_xctx_t *xctx)
 Typedef used for afw_runtime_env_set_object_cb_wrapper() cb. More...
 

Enumerations

enum  afw_runtime_unresolved_primitive_type_e {
  afw_runtime_unresolved_primitive_type_boolean , afw_runtime_unresolved_primitive_type_number , afw_runtime_unresolved_primitive_type_integer , afw_runtime_unresolved_primitive_type_list ,
  afw_runtime_unresolved_primitive_type_object , afw_runtime_unresolved_primitive_type_string
}
 Runtime unresolved primitive value. More...
 

Functions

const afw_object_tafw_runtime_object_create_indirect_using_inf (const afw_object_inf_t *inf, const afw_utf8_t *object_id, void *internal, const afw_pool_t *p, afw_xctx_t *xctx)
 Create an indirect runtime object. More...
 
void afw_runtime_env_set_object (const afw_object_t *object, afw_boolean_t overwrite, afw_xctx_t *xctx)
 Set an object pointer in the environment's runtime objects. More...
 
void afw_runtime_env_set_objects (const afw_object_t *const *objects, afw_boolean_t overwrite, afw_xctx_t *xctx)
 Set a list of object pointers in the environment's runtime objects. More...
 
void afw_runtime_env_set_object_cb_wrapper (const afw_utf8_t *object_type_id, const afw_utf8_t *object_id, afw_runtime_object_wrapper_p_cb_t callback, void *data, afw_boolean_t overwrite, afw_xctx_t *xctx)
 Set environment object accessed via callback. More...
 
void afw_runtime_env_create_and_set_indirect_object (const afw_utf8_t *object_type_id, const afw_utf8_t *object_id, void *internal, afw_boolean_t overwrite, afw_xctx_t *xctx)
 Create and set an indirect runtime object. More...
 
void afw_runtime_env_create_and_set_indirect_object_using_inf (const afw_object_inf_t *inf, const afw_utf8_t *object_id, void *internal, afw_boolean_t overwrite, afw_xctx_t *xctx)
 Create and set an indirect runtime object. More...
 
void afw_runtime_env_resolve_and_set_const_objects (const afw_runtime_unresolved_const_object_t *const *unresolved, afw_boolean_t overwrite, afw_xctx_t *xctx)
 Resolve and set a NULL terminated list of object pointers in the xctx's runtime objects. More...
 
void afw_runtime_foreach (const afw_utf8_t *object_type_id, void *context, afw_object_cb_t callback, afw_xctx_t *xctx)
 Call a callback for each runtime object. More...
 
const afw_adaptor_factory_tafw_runtime_get_adaptor_factory ()
 Get singleton factory for runtime adaptor. More...
 
const afw_adaptor_session_tafw_runtime_get_internal_session (afw_xctx_t *xctx)
 Get an internal session for runtime objects. More...
 
const afw_object_tafw_runtime_get_object (const afw_utf8_t *object_type_id, const afw_utf8_t *object_id, afw_xctx_t *xctx)
 Get a runtime object. More...
 
const afw_object_tafw_runtime_object_create_indirect (const afw_utf8_t *object_type_id, const afw_utf8_t *object_id, void *internal, const afw_pool_t *p, afw_xctx_t *xctx)
 Create an indirect runtime object. More...
 
void afw_runtime_remove_object (const afw_utf8_t *object_type_id, const afw_utf8_t *object_id, afw_xctx_t *xctx)
 Remove object by object type id and object id. More...
 
void afw_runtime_xctx_set_object (const afw_object_t *object, afw_boolean_t overwrite, afw_xctx_t *xctx)
 Set an object pointer in the xctx's runtime objects. More...
 
void afw_runtime_xctx_set_objects (const afw_object_t *const *objects, afw_boolean_t overwrite, afw_xctx_t *xctx)
 Set a list of object pointers in the xctx's runtime objects. More...
 
void afw_runtime_register_object_map_infs (const afw_object_inf_t *const *inf, afw_xctx_t *xctx)
 Register runtime object map interfaces. More...
 
void afw_runtime_resolve_and_register_object_map_infs (const afw_interface_implementation_rti_t *const *rti, afw_xctx_t *xctx)
 Create and register runtime object map interfaces. More...
 
const afw_object_tafw_runtime_resolve_const_object (const afw_runtime_unresolved_const_object_t *unresolved, const afw_pool_t *p, afw_xctx_t *xctx)
 Resolve a runtime const object. More...
 
void afw_runtime_object_release (const afw_object_t *instance, afw_xctx_t *xctx)
 Method release for runtime object. More...
 
void afw_runtime_object_add_reference (const afw_object_t *instance, afw_xctx_t *xctx)
 Method add_reference for runtime object. More...
 
afw_size_t afw_runtime_object_get_count (const afw_object_t *instance, afw_xctx_t *xctx)
 Method get_count for runtime object. More...
 
const afw_utf8_tafw_runtime_object_get_object_type_id (const afw_object_t *instance, afw_xctx_t *xctx)
 Method get_object_type_id for runtime object.
 
const afw_value_tafw_runtime_object_get_meta (const afw_object_t *instance, const afw_pool_t *p, afw_xctx_t *xctx)
 Method get_meta for runtime object.
 
const afw_value_tafw_runtime_object_get_property (const afw_object_t *instance, const afw_utf8_t *property_name, afw_xctx_t *xctx)
 Method get_property for runtime object.
 
const afw_value_tafw_runtime_object_get_property_meta (const afw_object_t *instance, const afw_utf8_t *property_name, const afw_pool_t *p, afw_xctx_t *xctx)
 Method get_property_meta for runtime object.
 
const afw_value_tafw_runtime_object_get_next_own_property (const afw_object_t *instance, const afw_iterator_t **iterator, const afw_utf8_t **property_name, afw_xctx_t *xctx)
 Method get_next_property for runtime object.
 
const afw_value_tafw_runtime_object_get_next_property_meta (const afw_object_t *instance, const afw_iterator_t **iterator, const afw_utf8_t **property_name, const afw_pool_t *p, afw_xctx_t *xctx)
 Method get_next_property_meta for runtime object.
 
afw_boolean_t afw_runtime_object_has_property (const afw_object_t *instance, const afw_utf8_t *property_name, afw_xctx_t *xctx)
 Method has_property for runtime object.
 
const afw_object_setter_tafw_runtime_object_get_setter (const afw_object_t *instance, afw_xctx_t *xctx)
 Method get_setter for runtime object.
 

Variables

 afw_runtime_inf_const_embedded_untyped_object
 
 afw_runtime_inf_const_meta_object_inf
 

Detailed Description

This is an Adaptive Framework read-only objects adaptor.

Macro Definition Documentation

◆ AFW_RUNTIME_OBJECT_INF

#define AFW_RUNTIME_OBJECT_INF (   inf_,
  meta_ 
)
Value:
\
AFW_DEFINE_CONST_DATA(afw_object_inf_t) \
inf_ = { \
{ \
AFW_UTF8_LITERAL("afw_object"), \
AFW_UTF8_LITERAL(__FILE__), \
AFW_UTF8_LITERAL("afw_runtime"), \
&meta_ \
}, \
afw_runtime_object_release, \
afw_runtime_object_add_reference, \
afw_runtime_object_get_count, \
afw_runtime_object_get_meta, \
afw_runtime_object_get_property, \
afw_runtime_object_get_property_meta, \
afw_runtime_object_get_next_own_property, \
afw_runtime_object_get_next_property_meta, \
afw_runtime_object_has_property, \
afw_runtime_object_get_setter \
} \
Interface afw_object_inf_s struct.

Definition at line 638 of file afw_runtime.h.

◆ AFW_RUNTIME_OBJECT_RTI

#define AFW_RUNTIME_OBJECT_RTI (   label_,
  meta_ 
)
Value:
\
static const afw_interface_implementation_rti_t \
label_ = { \
AFW_UTF8_LITERAL("afw_object"), \
AFW_UTF8_LITERAL(__FILE__), \
AFW_UTF8_LITERAL("afw_runtime"), \
&meta_ \
}; \

Definition at line 627 of file afw_runtime.h.

Typedef Documentation

◆ afw_runtime_object_wrapper_p_cb_t

typedef const afw_object_t*(* afw_runtime_object_wrapper_p_cb_t) (void *data, const afw_pool_t *p, afw_xctx_t *xctx)

Typedef used for afw_runtime_env_set_object_cb_wrapper() cb.

Parameters
dataset on afw_runtime_env_set_object_cb_wrapper().
pto use.
xctxof caller.
Returns
object.

Definition at line 379 of file afw_runtime.h.

Enumeration Type Documentation

◆ afw_runtime_unresolved_primitive_type_e

Runtime unresolved primitive value.

Enumerator
afw_runtime_unresolved_primitive_type_boolean 

value is NULL for false and non-NULL for true.

afw_runtime_unresolved_primitive_type_number 

value points to (double)

afw_runtime_unresolved_primitive_type_integer 

value points to (integer)

afw_runtime_unresolved_primitive_type_list 

afw_runtime_unresolved_const_list_t.

afw_runtime_unresolved_primitive_type_object 

value points to afw_runtime_unresolved_const_embedded_untyped_object_s.

afw_runtime_unresolved_primitive_type_string 

value points to afw_utf8_z_t.

Definition at line 266 of file afw_runtime.h.

Function Documentation

◆ afw_runtime_env_create_and_set_indirect_object()

void afw_runtime_env_create_and_set_indirect_object ( const afw_utf8_t object_type_id,
const afw_utf8_t object_id,
void *  internal,
afw_boolean_t  overwrite,
afw_xctx_t xctx 
)

Create and set an indirect runtime object.

Parameters
object_type_idof a registered map.
object_idof object.
internalis pointer to object's internal.
overwritewhether to throw error is object with path exists.
xctxThe intent of this function is to create a runtime object to represent a runtime struct mapped by a registered runtime object map.

Definition at line 528 of file afw_runtime.c.

◆ afw_runtime_env_create_and_set_indirect_object_using_inf()

void afw_runtime_env_create_and_set_indirect_object_using_inf ( const afw_object_inf_t inf,
const afw_utf8_t object_id,
void *  internal,
afw_boolean_t  overwrite,
afw_xctx_t xctx 
)

Create and set an indirect runtime object.

Parameters
infof map.
object_idof object.
internalis pointer to object's internal.
overwritewhether to throw error is object with path exists.
xctxThe intent of this function is to create a runtime object to represent a runtime struct mapped by a registered runtime object map.

Definition at line 507 of file afw_runtime.c.

◆ afw_runtime_env_resolve_and_set_const_objects()

void afw_runtime_env_resolve_and_set_const_objects ( const afw_runtime_unresolved_const_object_t *const *  unresolved,
afw_boolean_t  overwrite,
afw_xctx_t xctx 
)

Resolve and set a NULL terminated list of object pointers in the xctx's runtime objects.

Parameters
unresolvedNULL terminated list of unresolved object pointers.
overwritewhether to throw error is object with path exists.
xctxof caller.

Definition at line 750 of file afw_runtime.c.

◆ afw_runtime_env_set_object()

void afw_runtime_env_set_object ( const afw_object_t object,
afw_boolean_t  overwrite,
afw_xctx_t xctx 
)

Set an object pointer in the environment's runtime objects.

Parameters
objectto set in the xctx's runtime objects.
overwritewhether to throw error is object with path exists.
xctxof caller.

Definition at line 210 of file afw_runtime.c.

◆ afw_runtime_env_set_object_cb_wrapper()

void afw_runtime_env_set_object_cb_wrapper ( const afw_utf8_t object_type_id,
const afw_utf8_t object_id,
afw_runtime_object_wrapper_p_cb_t  callback,
void *  data,
afw_boolean_t  overwrite,
afw_xctx_t xctx 
)

Set environment object accessed via callback.

Parameters
object_type_idof a registered map.
object_idof object.
callbackto call;
datapassed to callback.
overwritewhether to throw error is object with path exists.
xctx

Definition at line 240 of file afw_runtime.c.

◆ afw_runtime_env_set_objects()

void afw_runtime_env_set_objects ( const afw_object_t *const *  objects,
afw_boolean_t  overwrite,
afw_xctx_t xctx 
)

Set a list of object pointers in the environment's runtime objects.

Parameters
objectsNULL terminated list of object pointers.
overwritewhether to throw error is object with path exists.
xctxof caller.

Definition at line 228 of file afw_runtime.c.

◆ afw_runtime_foreach()

void afw_runtime_foreach ( const afw_utf8_t object_type_id,
void *  context,
afw_object_cb_t  callback,
afw_xctx_t xctx 
)

Call a callback for each runtime object.

Parameters
object_type_idof objects to pass to callback.
contextto be passed to callback.
callbackfunction.
xctxof caller.

Custom handled object types are not supported and will call callback once with NULL object.

The callback function is the same type as the normal adaptor get/retrieve callback, but should not release the object passed.

Definition at line 900 of file afw_runtime.c.

◆ afw_runtime_get_adaptor_factory()

const afw_adaptor_factory_t* afw_runtime_get_adaptor_factory ( )

Get singleton factory for runtime adaptor.

Returns
pointer to adaptor factory.

Definition at line 915 of file afw_runtime.c.

◆ afw_runtime_get_internal_session()

const afw_adaptor_session_t* afw_runtime_get_internal_session ( afw_xctx_t xctx)

Get an internal session for runtime objects.

Parameters
pto use for session.
xctxof caller.
Returns
pointer to adaptor factory.

Definition at line 961 of file afw_runtime.c.

◆ afw_runtime_get_object()

const afw_object_t* afw_runtime_get_object ( const afw_utf8_t object_type_id,
const afw_utf8_t object_id,
afw_xctx_t xctx 
)

Get a runtime object.

Parameters
object_type_idof object.
object_idof object.
xctxof caller.

Definition at line 853 of file afw_runtime.c.

◆ afw_runtime_object_add_reference()

void afw_runtime_object_add_reference ( const afw_object_t instance,
afw_xctx_t xctx 
)

Method add_reference for runtime object.

Todo:
FIXME: Think about this.

Definition at line 1328 of file afw_runtime.c.

◆ afw_runtime_object_create_indirect()

const afw_object_t* afw_runtime_object_create_indirect ( const afw_utf8_t object_type_id,
const afw_utf8_t object_id,
void *  internal,
const afw_pool_t p,
afw_xctx_t xctx 
)

Create an indirect runtime object.

Parameters
object_type_idof a registered map.
object_idof object.
internalis pointer to object's internal.
pfor result.
xctxThe intent of this function is to create a runtime object to represent a runtime struct mapped by a registered runtime object map.

Definition at line 481 of file afw_runtime.c.

◆ afw_runtime_object_create_indirect_using_inf()

const afw_object_t* afw_runtime_object_create_indirect_using_inf ( const afw_object_inf_t inf,
const afw_utf8_t object_id,
void *  internal,
const afw_pool_t p,
afw_xctx_t xctx 
)

Create an indirect runtime object.

Parameters
infof map.
object_idof object.
internalis pointer to object's internal.
pfor result.
xctxThe intent of this function is to create a runtime object to represent a runtime struct mapped by a registered runtime object map.

Definition at line 449 of file afw_runtime.c.

◆ afw_runtime_object_get_count()

afw_size_t afw_runtime_object_get_count ( const afw_object_t instance,
afw_xctx_t xctx 
)

Method get_count for runtime object.

Todo:
Add code to implement method.

Definition at line 1341 of file afw_runtime.c.

◆ afw_runtime_object_release()

void afw_runtime_object_release ( const afw_object_t instance,
afw_xctx_t xctx 
)

Method release for runtime object.

Todo:
FIXME: Think about this.

Definition at line 1315 of file afw_runtime.c.

◆ afw_runtime_register_object_map_infs()

void afw_runtime_register_object_map_infs ( const afw_object_inf_t *const *  inf,
afw_xctx_t xctx 
)

Register runtime object map interfaces.

Parameters
infis NULL terminate list of inf pointers.
xctxinf->rti->implementation_specific MUST pointed to afw_runtime_object_type_meta_t of map.

Definition at line 356 of file afw_runtime.c.

◆ afw_runtime_remove_object()

void afw_runtime_remove_object ( const afw_utf8_t object_type_id,
const afw_utf8_t object_id,
afw_xctx_t xctx 
)

Remove object by object type id and object id.

Parameters
object_type_idof object to remove.
object_idof object to remove.
xctxof caller.

No error is thrown if object is not found.

Definition at line 262 of file afw_runtime.c.

◆ afw_runtime_resolve_and_register_object_map_infs()

void afw_runtime_resolve_and_register_object_map_infs ( const afw_interface_implementation_rti_t *const *  rti,
afw_xctx_t xctx 
)

Create and register runtime object map interfaces.

Parameters
rtiis NULL terminate list of rti pointers.
xctxrti->implementation_specific MUST pointed to afw_runtime_object_type_meta_t of map.

Definition at line 373 of file afw_runtime.c.

◆ afw_runtime_resolve_const_object()

const afw_object_t* afw_runtime_resolve_const_object ( const afw_runtime_unresolved_const_object_t unresolved,
const afw_pool_t p,
afw_xctx_t xctx 
)

Resolve a runtime const object.

Parameters
unresolvedis an unresolved runtime object.
pto use.
xctxof caller.
Returns
resolved object.

Definition at line 701 of file afw_runtime.c.

◆ afw_runtime_xctx_set_object()

void afw_runtime_xctx_set_object ( const afw_object_t object,
afw_boolean_t  overwrite,
afw_xctx_t xctx 
)

Set an object pointer in the xctx's runtime objects.

Parameters
objectto set in the xctx's runtime objects.
overwritewhether to throw error is object with path exists.
xctxof caller.

Definition at line 292 of file afw_runtime.c.

◆ afw_runtime_xctx_set_objects()

void afw_runtime_xctx_set_objects ( const afw_object_t *const *  objects,
afw_boolean_t  overwrite,
afw_xctx_t xctx 
)

Set a list of object pointers in the xctx's runtime objects.

Parameters
objectsNULL terminated list of object pointers.
overwritewhether to throw error is object with path exists.
xctxof caller.

Definition at line 344 of file afw_runtime.c.