2.10.0
Freundlich's C++ toolkit
Classes | Functions
fcppt::container::tree Namespace Reference

Classes

struct  is_object
 A meta function testing if the given type is really a tree object. More...
 
class  object
 A tree data structure. More...
 
struct  object< T >>
 A meta function testing if the given type is really a tree object. More...
 
class  pre_order
 Wraps a tree to make it iterable in a pre-order fashion. More...
 
class  to_root
 

Functions

template<typename T >
fcppt::optional::object< fcppt::container::to_iterator_type< T >> child_position (T &_parent, T &_child)
 Returns an iterator pointing to the position in the parent's child container where this object resides. More...
 
template<typename T >
bool operator== (fcppt::container::tree::object< T > const &_a, fcppt::container::tree::object< T > const &_b)
 Compares the values and recursively the values of the children. More...
 
template<typename T >
bool operator!= (fcppt::container::tree::object< T > const &_a, fcppt::container::tree::object< T > const &_b)
 Compares the values and recursively the values of the children. More...
 
template<typename Value >
fcppt::container::tree::object< Value >::size_type depth (fcppt::container::tree::object< Value > const &_tree)
 
template<typename Value >
fcppt::container::tree::object< Value >::size_type level (fcppt::container::tree::object< Value > const &_tree)
 Calculates the level of a tree. More...
 
template<typename Tree >
fcppt::container::tree::pre_order< Tree > make_pre_order (Tree &_tree)
 Creates a pre_order object. More...
 
template<typename Tree >
fcppt::container::tree::to_root< Tree > make_to_root (Tree &_tree)
 Creates a to_root object. More...
 
template<typename Result , typename Value , typename Function >
Result map (fcppt::container::tree::object< Value > const &_tree, Function const &_function)
 Maps a tree to another tree. More...
 
template<typename T >
void swap (fcppt::container::tree::object< T > &, fcppt::container::tree::object< T > &)
 Swaps two trees. More...
 
template<typename Ch , typename Traits , typename Value >
std::basic_ostream< Ch, Traits > & print (std::basic_ostream< Ch, Traits > &_stream, fcppt::container::tree::object< Value > const &_tree)
 

Function Documentation

◆ child_position()

template<typename T >
fcppt::optional::object< fcppt::container::to_iterator_type< T >> fcppt::container::tree::child_position ( T &  _parent,
T &  _child 
)

Returns an iterator pointing to the position in the parent's child container where this object resides.

Parameters
_parentThe parent tree to search
_childThe child to search for

◆ depth()

template<typename Value >
fcppt::container::tree::object< Value>::size_type fcppt::container::tree::depth ( fcppt::container::tree::object< Value > const &  _tree)

◆ operator!=()

template<typename T >
bool fcppt::container::tree::operator!= ( fcppt::container::tree::object< T > const &  _a,
fcppt::container::tree::object< T > const &  _b 
)

Compares the values and recursively the values of the children.

◆ operator==()

template<typename T >
bool fcppt::container::tree::operator== ( fcppt::container::tree::object< T > const &  _a,
fcppt::container::tree::object< T > const &  _b 
)

Compares the values and recursively the values of the children.

◆ print()

template<typename Ch , typename Traits , typename Value >
std::basic_ostream< Ch, Traits>& fcppt::container::tree::print ( std::basic_ostream< Ch, Traits > &  _stream,
fcppt::container::tree::object< Value > const &  _tree 
)

◆ swap()

template<typename T >
void fcppt::container::tree::swap ( fcppt::container::tree::object< T > &  ,
fcppt::container::tree::object< T > &   
)

Swaps two trees.