Hasty Badger
Small UI library (a branch of Turbo Badger)
 All Classes Namespaces Functions Variables Enumerations Enumerator Friends Groups Pages
tb::TBNodeRefTree Class Reference

TBNodeRefTree is a named TBNode. More...

#include <tb_node_ref_tree.h>

Inheritance diagram for tb::TBNodeRefTree:
tb::TBLinkOf< TBNodeRefTree > tb::TBLink

Public Member Functions

 TBNodeRefTree (const char *name)
 
const TBStrGetName () const
 
const TBIDGetNameID () const
 
bool ReadFile (const char *filename)
 Read the data file. More...
 
void ReadData (const char *data)
 
void AddListener (TBNodeRefTreeListener *listener)
 Add a listener that is invoked on changes in this tree. More...
 
void RemoveListener (TBNodeRefTreeListener *listener)
 Remove a change listener from this tree. More...
 
virtual void SetValue (const char *request, const TBValue &value)
 Set the value for the given request and invoke the change listener. More...
 
virtual TBValueGetValue (const char *request)
 Get the value of the given request. More...
 

Static Public Member Functions

static TBValueGetValueFromTree (const char *request)
 Get the value of the given tree name and request (>noderequest). More...
 
static TBNodeRefTreeGetRefTree (const char *name, int name_len)
 Return the tree with the given name, or nullptr if no matching tree exists. More...
 
static void ResolveConditions (TBNode *parent_node)
 Go through the tree of nodes recursively and include or remove branches depending on any conditions. More...
 

Friends

class TBNode
 
class TBNodeTarget
 

Additional Inherited Members

Detailed Description

TBNodeRefTree is a named TBNode.

Nodes under this node may be referenced from other nodes, either when requesting a value (TBNode::GetValueFollowRef), or while parsing the node tree. While parsing, the values can be used for branch conditions or branches of nodes can be included.

Member Function Documentation

void tb::TBNodeRefTree::AddListener ( TBNodeRefTreeListener listener)
inline

Add a listener that is invoked on changes in this tree.

TBNodeRefTree * tb::TBNodeRefTree::GetRefTree ( const char *  name,
int  name_len 
)
static

Return the tree with the given name, or nullptr if no matching tree exists.

TBValue & tb::TBNodeRefTree::GetValue ( const char *  request)
virtual

Get the value of the given request.

Follows references if any. Returns a null value if the request doesn't exist.

TBValue & tb::TBNodeRefTree::GetValueFromTree ( const char *  request)
static

Get the value of the given tree name and request (>noderequest).

Returns a null value if the given tree or request doesn't exist.

bool tb::TBNodeRefTree::ReadFile ( const char *  filename)
inline

Read the data file.

This will not invoke any change listener!

void tb::TBNodeRefTree::RemoveListener ( TBNodeRefTreeListener listener)
inline

Remove a change listener from this tree.

void tb::TBNodeRefTree::ResolveConditions ( TBNode parent_node)
static

Go through the tree of nodes recursively and include or remove branches depending on any conditions.

void tb::TBNodeRefTree::SetValue ( const char *  request,
const TBValue value 
)
virtual

Set the value for the given request and invoke the change listener.

Creates the nodes that doesn't exist.


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