graph  5.0.5
Graph: generic attributed relational graphs
Tree Class Reference

Attributed tree element. More...

#include <graph/tree/tree.h>

Inheritance diagram for Tree:
Collaboration diagram for Tree:

Public Member Functions

 Tree (bool allowChildren=true, const std::string &str="")
 
virtual ~Tree ()
 
virtual bool check (const carto::SyntaxSet &syntax, std::set< std::string > &missing) const
 
std::set< Tree *> getElementsWith (const std::string &, bool recurse=true) const
 
template<class T >
std::set< Tree *> getElementsWith (const std::string &, const T &, bool recurse=true) const
 
virtual size_t size () const __attribute__((__deprecated__))
 deprecated More...
 
virtual size_t childrenSize () const
 Returns the number of children BaseTree the receiver contains. More...
 
Visitor pattern
virtual void accept (TreeVisitor &visitor)
 
virtual void const_accept (ConstTreeVisitor &visitor) const
 
- Public Member Functions inherited from carto::SyntaxedObject< T >
 SyntaxedObject (const std::string &s)
 
 SyntaxedObject (const SyntaxedObject &x)
 
 SyntaxedObject (const SyntaxedObject< PropertySet > &x)
 
- Public Member Functions inherited from BaseTree
 BaseTree (bool allowsChildren=true)
 Constructor. More...
 
virtual ~BaseTree ()
 
const std::list< BaseTree * > & children () const
 
bool getAllowsChildren () const
 Returns true if the receiver allows children. More...
 
BaseTreegetChildAt (unsigned childIndex) const
 Returns the child BaseTree pointer at index childIndex. More...
 
int getIndex (BaseTree *node) const
 Returns the index of node in the receivers children. More...
 
BaseTreegetParent () const
 Returns the parent BaseTree of the receiver. More...
 
BaseTreegetTopParent ()
 Returns the top-level parent BaseTree of the receiver. More...
 
const BaseTreegetTopParent () const
 Returns the top-level parent of the receiver (const version) More...
 
bool isLeaf () const
 Returns true if the receiver is a leaf (terminal node) More...
 
void insert (BaseTree *child, int index=-1)
 Adds child to the receiver at index (default: end) More...
 
void remove (unsigned index)
 Removes the child at index index from the receiver. More...
 
void remove (BaseTree *node)
 Removes node from the receiver. More...
 
void removeFromParent ()
 Removes the receiver from its parent. More...
 
void setParent (BaseTree *newParent)
 Sets the parent of the receiver to newParent. More...
 
void clear ()
 Deletes all children from the tree. More...
 
const_iterator begin () const
 
const_iterator end () const
 
const_reverse_iterator rbegin () const
 
const_reverse_iterator rend () const
 

Additional Inherited Members

- Public Types inherited from carto::SyntaxedObject< T >
typedef internal::SyntaxedObjectSwitch< T, SUPERSUBCLASS(Interface, T)>::ContentType ContentType
 
- Public Types inherited from BaseTree
typedef std::list< BaseTree * >::iterator iterator
 
typedef std::list< BaseTree * >::const_iterator const_iterator
 
typedef std::list< BaseTree * >::reverse_iterator reverse_iterator
 
typedef std::list< BaseTree * >::const_reverse_iterator const_reverse_iterator
 

Detailed Description

Attributed tree element.

Definition at line 60 of file tree.h.

Constructor & Destructor Documentation

◆ Tree()

Tree::Tree ( bool  allowChildren = true,
const std::string &  str = "" 
)
inline

Definition at line 102 of file tree.h.

References BaseTree::begin(), and BaseTree::end().

◆ ~Tree()

virtual Tree::~Tree ( )
virtual

Member Function Documentation

◆ accept()

virtual void Tree::accept ( TreeVisitor visitor)
virtual

◆ check()

virtual bool Tree::check ( const carto::SyntaxSet syntax,
std::set< std::string > &  missing 
) const
virtual

◆ childrenSize()

virtual size_t Tree::childrenSize ( ) const
virtual

Returns the number of children BaseTree the receiver contains.

Reimplemented from BaseTree.

◆ const_accept()

virtual void Tree::const_accept ( ConstTreeVisitor visitor) const
virtual

◆ getElementsWith() [1/2]

std::set< Tree * > Tree::getElementsWith ( const std::string &  ,
bool  recurse = true 
) const

◆ getElementsWith() [2/2]

template<class T >
std::set< Tree *> Tree::getElementsWith ( const std::string &  s,
const T &  t,
bool  recurse = true 
) const
inline

Definition at line 138 of file tree.h.

References DECLARE_GENERIC_OBJECT_TYPE.

◆ size()

virtual size_t Tree::size ( ) const
virtual

deprecated

Reimplemented from BaseTree.


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