libamxd  6.4.1
Data Model Manager
amxd_object_hierarchy.h File Reference
#include <stdint.h>
#include <amxd/amxd_types.h>

Go to the source code of this file.

Typedefs

typedef bool(* amxd_object_filter_fn_t) (amxd_object_t *const object, int32_t depth, void *priv)
 Definition of object filter function. More...
 
typedef void(* amxd_object_cb_fn_t) (amxd_object_t *const object, int32_t depth, void *priv)
 Definition of object walk callback function. More...
 
typedef int(* amxd_mobject_cb_t) (amxd_object_t *object, amxd_object_t *mobject, void *priv)
 Definition of matching object callback function. More...
 
typedef int(* amxd_instance_cb_t) (amxd_object_t *templ, amxd_object_t *instance, void *priv)
 

Functions

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. More...
 
amxd_object_tamxd_object_get_parent (const amxd_object_t *const object)
 Get the parent object. More...
 
amxd_object_tamxd_object_get_root (const amxd_object_t *const object)
 Get the data model root. More...
 
amxd_dm_tamxd_object_get_dm (const amxd_object_t *const object)
 Get the data model. More...
 
amxd_object_tamxd_object_get_child (const amxd_object_t *object, const char *name)
 Get a child of the object. More...
 
amxd_object_tamxd_object_get_instance (const amxd_object_t *object, const char *name, uint32_t index)
 Get an instance of the template object. More...
 
amxd_object_tamxd_object_get (const amxd_object_t *object, const char *name)
 Get an instance or child of an object. More...
 
amxd_object_tamxd_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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
bool amxd_object_is_supported (amxd_object_t *object, const char *rel_path)
 Checks if a path is in the supported data model. More...
 
static amxc_llist_it_t * amxd_object_first_instance (const amxd_object_t *const object)
 
static amxc_llist_it_t * amxd_object_first_child (const amxd_object_t *const object)
 
static uint32_t amxd_object_get_instance_count (const amxd_object_t *object)
 
static uint32_t amxd_object_get_child_count (const amxd_object_t *object)
 

Function Documentation

◆ amxd_object_first_child()

static amxc_llist_it_t* amxd_object_first_child ( const amxd_object_t *const  object)
inlinestatic

Definition at line 614 of file amxd_object_hierarchy.h.

614  {
615  return object == NULL ? NULL : amxc_llist_get_first(&object->objects);
616 }
amxc_llist_t objects
Definition: amxd_types.h:243

◆ amxd_object_first_instance()

static amxc_llist_it_t* amxd_object_first_instance ( const amxd_object_t *const  object)
inlinestatic

Definition at line 609 of file amxd_object_hierarchy.h.

609  {
610  return object == NULL ? NULL : amxc_llist_get_first(&object->instances);
611 }
amxc_llist_t instances
Definition: amxd_types.h:244

◆ amxd_object_get_child_count()

static uint32_t amxd_object_get_child_count ( const amxd_object_t object)
inlinestatic

Definition at line 624 of file amxd_object_hierarchy.h.

624  {
625  return object == NULL ? 0 : amxc_llist_size(&object->objects);
626 }

◆ amxd_object_get_instance_count()

static uint32_t amxd_object_get_instance_count ( const amxd_object_t object)
inlinestatic

Definition at line 619 of file amxd_object_hierarchy.h.

619  {
620  return object == NULL ? 0 : amxc_llist_size(&object->instances);
621 }