SyTen
syten::T3N::Tree::Tree< T > Class Template Reference
+ Inheritance diagram for syten::T3N::Tree::Tree< T >:
+ Collaboration diagram for syten::T3N::Tree::Tree< T >:

Public Types

using cPtr = const Node *
 An overload. More...
 
using cPtrc = const Node *const
 An overload. More...
 
typedef T3N::Tree::Node< ValueNode
 Shortcut for the Nodes. More...
 
using Ptr = Node *
 Pointer to Node. More...
 
using Ptrc = Node *const
 An overload. More...
 
typedef std::vector< std::tuple< Index, std::vector< Index >, NodeType, Index > > Structure
 Return type of tree information for plotting. More...
 
typedef std::map< int, PositionTranslator
 Translator to call Nodes. More...
 
typedef T Value
 Type of the contained values. More...
 

Public Member Functions

MemoryUsage::MemorySize allocSize () const
 
Structure genStructure () const
 Returns structure for pretty plotting. More...
 
Position left_most () const
 Returns the left-most node. More...
 
template<typename Archive >
void load (Archive &arch, unsigned int const in_version)
 Boost load. More...
 
bool mp () const
 Returns true, if tree only contains physical nodes. More...
 
Treeoperator= (Tree &&other)
 Move assignment operator. More...
 
Treeoperator= (Tree const &other)
 Copy assignment operator. More...
 
template<typename OtherType >
bool operator== (Tree< OtherType > const &other) const
 Compare the structure of two trees. More...
 
Position right_most () const
 Returns the right-most node. More...
 
template<typename Archive >
void save (Archive &arch, unsigned int) const
 Boost save. More...
 
Index size () const
 Counts all Nodes of this tree. More...
 
Index sizeOf (NodeType const type) const
 Counts the number of Nodes w/ the given type. More...
 
 Tree (NodeType root=NodeType::Physical)
 Default constructor. More...
 
template<typename ... Args>
 Tree (NodeType root=NodeType::Physical, Args... args)
 Constructor forwarding the container. More...
 
 Tree (Tree &&other)
 Move constructor. More...
 
 Tree (Tree const &other)
 Copy constructor. More...
 
 ~Tree ()
 Destructor. More...
 
Node access functions
Ptr operator[] (Position const &coordinate) const
 Returns the Ptr to the Node specified through the coordinate vector by the following syntax: More...
 
Ptr operator[] (int const element) const
 

Public Attributes

Ptr Root = nullptr
 Root of the tree. More...
 
Translator translator
 Instance. More...
 

Private Member Functions

void genStructure_rec (std::vector< Index > &pos, std::map< std::vector< Index >, Index > const &inverse_map, Structure &s) const
 Recursive helper for structure generation. More...
 

Visitor function

Visits subtree of ptr recursively until the bottom is reached and applies function f in the desired order.

Parameters
fFunction which shall be applied.
directionPair of directions in which the recursion shall take place. The first one specifies the horizontal direction, the second one the vertical.
ptrPtr to the Node which is to call next.
template<typename Func >
void visit (Func &&func)
 Shortcut. More...
 
template<typename Func >
void visit (Func &&func, Ptr ptr)
 Shortcut. More...
 
template<typename Func >
static void visit (Func &&f, const Pair< IterDirection, IterDirection > directions, Ptr ptr)
 
template<typename Func >
static std::result_of< Func(Ptr)>::type visit (Func &&f, typename std::result_of< Func(Ptr)>::type initial, Pair< IterDirection, IterDirection > directions, Ptr ptr)
 Recursively visits a subtree, bottom-first. More...
 
template<typename Func , typename Op >
static std::result_of< Func(Ptr)>::type visit (Func &&f, Op &&operation, typename std::result_of< Func(Ptr)>::type initial, Pair< IterDirection, IterDirection > directions, Ptr ptr)
 

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