Zigbee Protocol Controller 1.6.0
attribute_store_node Class Reference

A node in the attribute store tree. More...

#include <attribute_store_node.h>

Public Member Functions

 attribute_store_node (attribute_store_node *_parent_node, attribute_store_type_t _type, attribute_store_node_t _id)
 Node class constructor. More...
 
 ~attribute_store_node ()
 Node class destructor. More...
 
attribute_store_nodeadd_child (attribute_store_type_t _type, attribute_store_node_t _id)
 Add a child for the current node. More...
 
attribute_store_nodefind_id (attribute_store_node_t _id)
 Finds if this node or one of its children have a given public interface ID. More...
 
void log ()
 Logs the content of the a Node using Unify Logging system. More...
 
void log (uint8_t indent)
 Logs the content of the a Node using Unify Logging system, indicating an indent to use for the current element. More...
 
void log_children (uint8_t indent)
 Logs the content of the a Node and all its children using Unify Logging system. More...
 

Public Attributes

attribute_store_type_t type
 
attribute_store_node_t id
 
std::vector< uint8_t > desired_value
 Desired value for the node attribute. More...
 
std::vector< uint8_t > reported_value
 Reported value for the node attribute. More...
 
attribute_store_nodeparent_node
 Pointer to the parent node in the tree. More...
 
std::vector< attribute_store_node * > child_nodes
 Pointers to child nodes. There will be 0 to N child nodes. More...
 
bool undergoing_deletion
 Node is being deleted. More...
 

Private Member Functions

void remove_child_link (attribute_store_node *_child_node)
 Removes a child from the list of children for the current node. More...
 

Detailed Description

A node in the attribute store tree.

Constructor & Destructor Documentation

◆ attribute_store_node()

attribute_store_node::attribute_store_node ( attribute_store_node _parent_node,
attribute_store_type_t  _type,
attribute_store_node_t  _id 
)

Node class constructor.

Create a node object under the parent node indicated by the pointer. The attribute ID is also assigned immediately.

Parameters
_parent_nodePointer to the parent node.
_typeThe attribute Type to assign to the new node.
_idThe unique ID used to identify to assign to the new node in the persistent datastore/ public interface.

◆ ~attribute_store_node()

attribute_store_node::~attribute_store_node ( )

Node class destructor.

Destroy the Node object and all its children.

Member Function Documentation

◆ add_child()

attribute_store_node * attribute_store_node::add_child ( attribute_store_type_t  _type,
attribute_store_node_t  _id 
)

Add a child for the current node.

This function will instanciance a new child under the current node.

Parameters
_typeThe attribute Type to assign to the new node.
_idThe unique ID used to identify to assign to the new node.
Returns
pointer to the newly created node.

◆ find_id()

attribute_store_node * attribute_store_node::find_id ( attribute_store_node_t  _id)

Finds if this node or one of its children have a given public interface ID.

This functions returns the pointer to the node found with the given id. If no node has this ID assigned under the tree, it will return NULL.

Parameters
_idThe unique ID to search for under the node.
Returns
A pointer to the node having this ID, if it is in the tree.
NULL if the ID is not part of the sub-tree

◆ log() [1/2]

void attribute_store_node::log ( )

Logs the content of the a Node using Unify Logging system.

◆ log() [2/2]

void attribute_store_node::log ( uint8_t  indent)

Logs the content of the a Node using Unify Logging system, indicating an indent to use for the current element.

Parameters
indentNumber of spaces to insert before the current entry.

◆ log_children()

void attribute_store_node::log_children ( uint8_t  indent)

Logs the content of the a Node and all its children using Unify Logging system.

Parameters
indentNumber of spaces to insert before the children.

◆ remove_child_link()

void attribute_store_node::remove_child_link ( attribute_store_node _child_node)
private

Removes a child from the list of children for the current node.

Member Data Documentation

◆ child_nodes

std::vector<attribute_store_node *> attribute_store_node::child_nodes

Pointers to child nodes. There will be 0 to N child nodes.

◆ desired_value

std::vector<uint8_t> attribute_store_node::desired_value

Desired value for the node attribute.

◆ id

attribute_store_node_t attribute_store_node::id

Unique ID used by the public interface to identify this instance of a node

◆ parent_node

attribute_store_node* attribute_store_node::parent_node

Pointer to the parent node in the tree.

◆ reported_value

std::vector<uint8_t> attribute_store_node::reported_value

Reported value for the node attribute.

◆ type

attribute_store_type_t attribute_store_node::type

Type used to identify what the attribute represents. (e.g. Binary Switch value, HomeID, Version of a Comamand Class, etc.)

◆ undergoing_deletion

bool attribute_store_node::undergoing_deletion

Node is being deleted.


The documentation for this class was generated from the following file: