55 #if !defined(__AMXD_OBJECT_HIERARCHY_H__)
56 #define __AMXD_OBJECT_HIERARCHY_H__
369 const char* rel_path,
370 ...) __attribute__ ((format(printf, 2, 3)));
400 const
char* rel_path,
401 ...) __attribute__ ((format(printf, 3, 4)));
433 const
char* rel_path,
434 ...) __attribute__ ((format(printf, 4, 5)));
519 const uint32_t flags);
588 const
char* rel_spath,
607 const
char* rel_path);
610 return object == NULL ? NULL : amxc_llist_get_first(&object->
instances);
615 return object == NULL ? NULL : amxc_llist_get_first(&object->
objects);
620 return object == NULL ? 0 : amxc_llist_size(&object->
instances);
625 return object == NULL ? 0 : amxc_llist_size(&object->
objects);
static amxc_llist_it_t * amxd_object_first_child(const amxd_object_t *const object)
static uint32_t amxd_object_get_child_count(const amxd_object_t *object)
static amxc_llist_it_t * amxd_object_first_instance(const amxd_object_t *const object)
static uint32_t amxd_object_get_instance_count(const amxd_object_t *object)
enum _amxd_direction amxd_direction_t
enum _amxd_status amxd_status_t
amxd_object_t amxd_status_t amxd_status_t char * amxd_object_get_path(const amxd_object_t *object, const uint32_t flags)
Get the full path of the object.
bool amxd_object_is_child_of(const amxd_object_t *const child, const amxd_object_t *const parent)
Checks if the child object is in the hierarchical tree of the parent object.
int(* amxd_instance_cb_t)(amxd_object_t *templ, amxd_object_t *instance, void *priv)
amxd_object_t * amxd_object_get_parent(const amxd_object_t *const object)
Get the parent object.
amxd_object_t * amxd_object_get_child(const amxd_object_t *object, const char *name)
Get a child of the object.
amxd_object_t * amxd_object_get_root(const amxd_object_t *const object)
Get the data model root.
char * amxd_object_get_rel_path(const amxd_object_t *child, const amxd_object_t *parent, const uint32_t flags)
Get the relative path of the object.
void amxd_object_hierarchy_walk(amxd_object_t *const object, const amxd_direction_t direction, amxd_object_filter_fn_t filter, amxd_object_cb_fn_t cb, int32_t depth, void *priv)
Iterates over all objects in the data model tree.
int(* amxd_mobject_cb_t)(amxd_object_t *object, amxd_object_t *mobject, void *priv)
Definition of matching object callback function.
amxd_object_t * amxd_object_findf(amxd_object_t *object, const char *rel_path,...) __attribute__((format(printf
Find an object in the data model tree, starting from an object.
amxd_object_t amxd_status_t amxd_status_t amxd_object_resolve_pathf_ext(amxd_object_t *object, bool *key_path, amxc_llist_t *paths, const char *rel_path,...) __attribute__((format(printf
Resolves a search path into a list of matching object paths.
amxd_dm_t * amxd_object_get_dm(const amxd_object_t *const object)
Get the data model.
amxd_object_t amxd_status_t amxd_object_resolve_pathf(amxd_object_t *object, amxc_llist_t *paths, const char *rel_path,...) __attribute__((format(printf
Resolves a search path into a list of matching object paths.
void amxd_object_for_all(amxd_object_t *object, const char *rel_spath, amxd_mobject_cb_t fn, void *priv)
Executes a task for all matching objects in an object tree.
amxd_object_t * amxd_object_get(const amxd_object_t *object, const char *name)
Get an instance or child of an object.
void(* amxd_object_cb_fn_t)(amxd_object_t *const object, int32_t depth, void *priv)
Definition of object walk callback function.
amxd_status_t amxd_object_add_object(amxd_object_t *const parent, amxd_object_t *const child)
Adds an object in the data model tree.
bool amxd_object_is_supported(amxd_object_t *object, const char *rel_path)
Checks if a path is in the supported data model.
bool(* amxd_object_filter_fn_t)(amxd_object_t *const object, int32_t depth, void *priv)
Definition of object filter function.
amxd_object_t * amxd_object_get_instance(const amxd_object_t *object, const char *name, uint32_t index)
Get an instance of the template object.