Scopira  20080306
scopira::tool::treenode Class Reference

#include <tree.h>

Inheritance diagram for scopira::tool::treenode:

Public Types

typedef scopira::tool::iterator_g< const std::string &> key_iterator

Public Member Functions

 treenode (scopira::tool::object *o=0)
virtual ~treenode ()
scopira::tool::objectget_object (void)
 gets the object
void set (const std::string &name, treenode *nd)
 sets a node, returns created node
treenodeget (const std::string &name)
 gets a node, might return null
void set_path (const std::string &path_name, treenode *nd)
key_iterator get_key_iterator (void)
- Public Member Functions inherited from scopira::tool::object
virtual ~object ()
int add_ref (void) const
bool sub_ref (void) const
void auto_ref (void) const
int current_ref (void) const
virtual scopira::tool::oflow_iprint (scopira::tool::oflow_i &o) const
virtual bool load (scopira::tool::iobjflow_i &in)
virtual void save (scopira::tool::oobjflow_i &out) const
bool is_alive_object (void) const
bool is_dead_object (void) const

Protected Attributes

nodemap_t dm_nodes
scopira::tool::count_ptr< scopira::tool::objectdm_data

Additional Inherited Members

- Protected Member Functions inherited from scopira::tool::object
 object (void)
 object (bool neverusecounter)

Detailed Description

A recursive tree structure, useful for building menus and other light systems.

Each node can have an associated (reference counted) data object and name.

Aleksander Demko

Member Function Documentation

◆ get_key_iterator()

key_iterator scopira::tool::treenode::get_key_iterator ( void  )

Get an iterator of all the childeren.

Aleksander Demko

Referenced by get_object().

◆ set_path()

void scopira::tool::treenode::set_path ( const std::string &  path_name,
treenode nd 

Parses the path (with / deliminating sub nodes) and inserts the node into the tree.

nd is ref counted.

Aleksander Demko

Referenced by get_object().

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