libamxd
6.4.1
Data Model Manager
|
Functions | |
amxd_status_t | amxd_action_object_list (amxd_object_t *const object, amxd_param_t *const param, amxd_action_t reason, const amxc_var_t *const args, amxc_var_t *const retval, void *priv) |
Default object list action implementation. More... | |
amxd_status_t | amxd_action_object_describe (amxd_object_t *object, amxd_param_t *param, amxd_action_t reason, const amxc_var_t *const args, amxc_var_t *const retval, void *priv) |
Default object describe action implementation. More... | |
amxd_status_t | amxd_action_object_destroy (amxd_object_t *object, amxd_param_t *const param, amxd_action_t reason, const amxc_var_t *const args, amxc_var_t *const retval, void *priv) |
Default object destroy action implementation. More... | |
amxd_status_t | amxd_action_object_validate (amxd_object_t *const object, amxd_param_t *const param, amxd_action_t reason, const amxc_var_t *const args, amxc_var_t *const retval, void *priv) |
Default object validate action implementation. More... | |
amxd_status_t amxd_action_object_describe | ( | amxd_object_t * | object, |
amxd_param_t * | param, | ||
amxd_action_t | reason, | ||
const amxc_var_t *const | args, | ||
amxc_var_t *const | retval, | ||
void * | priv | ||
) |
Default object describe action implementation.
This action is mainly invoked for introspection purposes.
For this action the args must be a htable variant and may contain the following parameters in the htable:
All these are optional, when the boolean parameters are not available, true is used as the default value.
The access parameter, when not available, will be set to amxd_dm_access_public
The return value will be a htable variant. The return value is put in the retval
argument and can contain:
attributes
) as a htable variantname
) as a stringobject
) as a stringpath
) as a stringobjects
) as a list variantparameters
) as a htable variant, each parameter is represented as a htable where the key is the parameter value and the value is the parameter description.When access is set to amxd_dm_access_public, only parameters and objects defined as public are added to the description. If access is set to amxd_dm_access_protected, parameters and objects defined as protected are added to the description.
When template_info is set to true, all parameters, functions and objects defined in the multi-instance object are added to the description.
Example of input arguments htable
Example of retval htable
object | The data model object on which the action is invoked. |
param | For object actions this is always NULL |
reason | The action reason. This should be action_object_describe or action_any If the reason is any other action, status amxd_status_function_not_implemented must be returned. |
args | A variant containing the action arguments |
retval | A variant that must be filled with the action return data |
priv | An opaque pointer (user data), that is added when the action callback was set. This pointer can be NULL. |
amxd_status_t amxd_action_object_destroy | ( | amxd_object_t * | object, |
amxd_param_t *const | param, | ||
amxd_action_t | reason, | ||
const amxc_var_t *const | args, | ||
amxc_var_t *const | retval, | ||
void * | priv | ||
) |
Default object destroy action implementation.
This action is invoked when the object is removed from the data model. This action should never fail, it should either return amxd_status_ok or amxd_status_function_not_implemented if called for the wrong reason.
The object pointer becomes invalid when returning from this action implementation, as it will be deleted from memory and removed from the data model.
When adding private data to the object pointer, this action provides you with the possiblity to do some clean-up (like deleting the private data).
The default implementation is doing nothing.
object | The data model object on which the action is invoked. |
param | For object actions this is always NULL |
reason | The action reason. This should be action_object_destroy or action_any If the reason is any other action, status amxd_status_function_not_implemented must be returned. |
args | Not used in the object destroy action |
retval | Not used in the object destroy action |
priv | An opaque pointer (user data), that is added when the action callback was set. This pointer can be NULL. |
amxd_status_t amxd_action_object_list | ( | amxd_object_t *const | object, |
amxd_param_t *const | param, | ||
amxd_action_t | reason, | ||
const amxc_var_t *const | args, | ||
amxc_var_t *const | retval, | ||
void * | priv | ||
) |
Default object list action implementation.
This action is mainly invoked for introspection purposes.
For this action the args must be a htable variant and may contain the following parameters in the htable:
All these are optional, when the boolean parameters are not available, true is used as the default value.
The access parameter, when not available, will be set to amxd_dm_access_public
The return value will be a htable variant, containing list variants for each requested and available topic. The returned htable variant must contain:
When access is set to amxd_dm_access_public, only parameters and objects defined as public must be added to the lists. If access is set to amxd_dm_access_protected, parameters and objects defined as protected must be added to the lists.
When template_info is set to true, all parameters, functions and objects defined in the multi-instance object must be added to the lists.
Example of input arguments htable
Example of retval htable
object | The data model object on which the action is invoked. |
param | For object actions this is always NULL |
reason | The action reason. This should be action_object_list or action_any If the reason is any other action, status amxd_status_function_not_implemented must be returned. |
args | A variant containing the action arguments |
retval | A variant that must be filled with the action return data |
priv | An opaque pointer (user data), that is added when the action callback was set. This pointer can be NULL. |
amxd_status_t amxd_action_object_validate | ( | amxd_object_t *const | object, |
amxd_param_t *const | param, | ||
amxd_action_t | reason, | ||
const amxc_var_t *const | args, | ||
amxc_var_t *const | retval, | ||
void * | priv | ||
) |
Default object validate action implementation.
This default implementation will check for instances that no duplicate instance is created. It will check that the key parameters are not introducing a duplicate key with other instances of the same multi-instance object.
For singleton objects this validate action is doing nothing.
object | The data model object on which the action is invoked. |
param | For object actions this is always NULL |
reason | The action reason. This should be action_object_validate or action_any If the reason is any other action, status amxd_status_function_not_implemented must be returned. |
args | Not used in the object validate action |
retval | Not used in the object validate action |
priv | An opaque pointer (user data), that is added when the action callback was set. This pointer can be NULL. |