21#ifndef DATA_MANAGEMENT_GRAPH_TREE_H
22#define DATA_MANAGEMENT_GRAPH_TREE_H
24#include "configuration.h"
29#if CLOCKWERK_ALLOW_VECTOR
32#if CLOCKWERK_ALLOW_STD_STRING
39#define DEFAULT_NAME ""
136 int16
name(
const char* new_name);
167#if CLOCKWERK_ALLOW_STD_STRING
168 std::string address();
170#if CLOCKWERK_ALLOW_VECTOR
171 std::vector<std::string> search(
const std::string &address);
184 virtual std::vector<std::string> header_info()
const {
return std::vector<std::string>();}
193#if CLOCKWERK_ALLOW_VECTOR
196 void findLoggable(std::vector<GraphTreeObject*> &matches);
215#if CLOCKWERK_ALLOW_VECTOR
216#if CLOCKWERK_ALLOW_STD_STRING
217 std::vector<std::string> _decomposeAddress(std::string address);
225 void _findMatches(
const std::vector<std::string> &subaddresses, uint32 num_subaddresses,
226 uint32 index,
bool match_found, std::vector<GraphTreeObject*> &matches);
231 std::vector<GraphTreeObject*> _searchNodes(
const std::string &address);
260 char _name[MAXIMUM_NAME_CHARS] =
"";
Base class for object organization.
Definition GraphTreeObject.h:98
uint16 nDescendants() const
Definition GraphTreeObject.h:131
GraphTreeObject ** _children_ptr
Definition GraphTreeObject.h:252
uint32 _max_num_children
Definition GraphTreeObject.h:253
uint16 _num_descendants
Definition GraphTreeObject.h:257
GraphTreeObject ** children()
Definition GraphTreeObject.h:108
virtual ~GraphTreeObject()
Destructor.
Definition GraphTreeObject.h:104
void _recalculateDescendants()
Function to recursively re-calculate the number of descendants of a given node on the tree.
Definition GraphTreeObject.cpp:301
int16 _setStorage(GraphTreeObject **storage_array, uint8 storage_size)
Getter for object's string address.
Definition GraphTreeObject.cpp:31
bool loggable()
Getter for object logability flag – note no setter because should only be set by this or a derived cl...
Definition GraphTreeObject.h:147
int8 _graph_tree_type
Variable to store graph tree object type.
Definition GraphTreeObject.h:270
GraphTreeObject * _parent
Definition GraphTreeObject.h:247
uint8 _num_children
Number of direct children of the tree (not including the tree itself).
Definition GraphTreeObject.h:263
virtual int16 fromStr(const char *val)
Set value of graphtreeobject from string.
Definition GraphTreeObject.h:163
bool _loggable
Variable to indicate whether the selected object is loggable. Set to false by default.
Definition GraphTreeObject.h:273
uint32 _index
Index pointing to the next write location for the graph tree children.
Definition GraphTreeObject.h:276
GraphTreeObject * parent()
Functions to get object's parent/children.
Definition GraphTreeObject.h:107
uint8 capacity() const
Definition GraphTreeObject.h:132
int16 _addChild(GraphTreeObject *child)
Function to decompose a string into a series of substrings via indexing.
Definition GraphTreeObject.cpp:132
GraphTreeObject(const char *gt_nme="", GraphTreeObject **storage_array=nullptr, uint32 storage_size=0)
Name-based constructor for GraphTreeObject which will have no children by default.
Definition GraphTreeObject.cpp:23
char _name[MAXIMUM_NAME_CHARS]
String name for object.
Definition GraphTreeObject.h:260
uint8 _rank
Definition GraphTreeObject.h:267
GraphTreeObject * childAtIndex(uint8 i) const
Definition GraphTreeObject.h:109
int16 _removeChild(GraphTreeObject *child)
Function to remove a child from the graph node's children.
Definition GraphTreeObject.cpp:157
virtual int16 str(char *output, size_t size) const
Get object represented as string.
Definition GraphTreeObject.h:157
uint8 rank()
Getter for the object rank.
Definition GraphTreeObject.h:139
const char * name() const
Getter and setter for object name.
Definition GraphTreeObject.h:135
int8 type()
Function to indicate type – -1 by default unless implemented downstream.
Definition GraphTreeObject.h:143
uint8 nChildren() const
Getters for number of children and descendants.
Definition GraphTreeObject.h:130
GraphTreeObject * getRootDataPointer()
Get the pointer to the highest object in the graph tree.
Definition GraphTreeObject.cpp:79
void _recalculateRank()
Function to recursively re-calculate the rank of a given node on the tree.
Definition GraphTreeObject.cpp:324
#define WARN_NOT_LOGGABLE
Definition clockwerkerrors.h:82
#define ERROR_BUFFER_NOT_IMPLEMENTED
Variable to raise an error if an appropriate buffer is not in place.
Definition clockwerkerrors.h:126
#define ERROR_CANNOT_CONVERT_STRING
Error in the case where dynamics model overruns steps or gets out of whack.
Definition clockwerkerrors.h:182
Definition CircularBuffer.hpp:28
graph_tree_types_e
Definition GraphTreeObject.h:47
@ TASK
Definition GraphTreeObject.h:50
@ FRAME
Definition GraphTreeObject.h:52
@ BASE_GRAPH_TREE
Definition GraphTreeObject.h:48
@ DATAIO
Definition GraphTreeObject.h:49
@ EXECUTIVE
Definition GraphTreeObject.h:51
@ NODE
Definition GraphTreeObject.h:54
@ BODY
Definition GraphTreeObject.h:53
half log(half arg)
Definition half.hpp:3050