Elm  1.0
ELM is a library providing generic data structures, OS-independent interface, plugins and XML.
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
elm::genstruct::Tree< T > Class Template Reference

#include <elm/genstruct/Tree.h>

+ Inheritance diagram for elm::genstruct::Tree< T >:

Classes

class  Iterator
 

Public Member Functions

 Tree (const T &value)
 
const T & data (void) const
 
T & data (void)
 
const Treechildren (void) const
 
Treechildren (void)
 
const Treesibling (void) const
 
Treesibling (void)
 
bool hasChild (Tree *tree) const
 
bool contains (Tree *tree) const
 
int count (void) const
 
bool isEmpty (void) const
 
 operator bool (void) const
 
void prependChild (Tree *child)
 
void appendChild (Tree *child)
 
void addSibling (Tree *newSibling)
 
void add (Tree *child)
 
template<class TT >
void addAll (const TT &coll)
 
void removeChild (Tree *child)
 
void remove (Tree *child)
 
void remove (const Iterator &iter)
 
template<class TT >
void removeAll (const TT &coll)
 
void clear (void)
 

Detailed Description

template<class T>
class elm::genstruct::Tree< T >

This class implements a minimal tree whose children are linked with a simple link list. It provides facilities to store a value on the tree and to access either children, or closer sibling.

Parameters
TType of stored values.

Constructor & Destructor Documentation

template<class T >
elm::genstruct::Tree< T >::Tree ( const T &  value)

Build a new empty tree storing the given value.

Parameters
valueValue to store in the tree.

Member Function Documentation

template<class T >
void elm::genstruct::Tree< T >::add ( Tree< T > *  child)
template<class T >
template<class TT >
void elm::genstruct::Tree< T >::addAll ( const TT &  coll)
template<class T >
void elm::genstruct::Tree< T >::addSibling ( Tree< T > *  newSibling)
template<class T >
void elm::genstruct::Tree< T >::appendChild ( Tree< T > *  child)
template<class T >
const Tree< T > * elm::genstruct::Tree< T >::children ( void  ) const

Get list of children of the tree, that is, the first child.

Returns
First children.

References elm::inhstruct::Tree::children().

template<class T >
Tree< T > * elm::genstruct::Tree< T >::children ( void  )

Get list of children of the tree, that is, the first child.

Returns
First children.

References elm::inhstruct::Tree::children().

template<class T >
void elm::genstruct::Tree< T >::clear ( void  )
template<class T >
bool elm::genstruct::Tree< T >::contains ( Tree< T > *  tree) const
template<class T >
int elm::genstruct::Tree< T >::count ( void  ) const
template<class T >
const T & elm::genstruct::Tree< T >::data ( void  ) const

Get the value stored in the tree.

Returns
Stored value.
template<class T >
T & elm::genstruct::Tree< T >::data ( void  )

Get assignable reference on the value stored in the tree.

Returns
Stored value reference.
template<class T >
bool elm::genstruct::Tree< T >::hasChild ( Tree< T > *  tree) const
template<class T >
bool elm::genstruct::Tree< T >::isEmpty ( void  ) const
template<class T >
elm::genstruct::Tree< T >::operator bool ( void  ) const
template<class T >
void elm::genstruct::Tree< T >::prependChild ( Tree< T > *  child)
template<class T >
void elm::genstruct::Tree< T >::remove ( Tree< T > *  child)
template<class T >
void elm::genstruct::Tree< T >::remove ( const Iterator iter)
template<class T >
template<class TT >
void elm::genstruct::Tree< T >::removeAll ( const TT &  coll)
template<class T >
void elm::genstruct::Tree< T >::removeChild ( Tree< T > *  child)
template<class T >
const Tree< T > * elm::genstruct::Tree< T >::sibling ( void  ) const

Get the next sibling of the current tree.

Returns
Next sibling.

References elm::inhstruct::Tree::sibling().

template<class T >
Tree< T > * elm::genstruct::Tree< T >::sibling ( void  )

Get the next sibling of the current tree.

Returns
Next sibling.

References elm::inhstruct::Tree::sibling().


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