tree_container

Description

Tree object holding branches.

The name comes from the fact a tree is acting as a node while the branch class is the edge to a leaf or other nodes. A tree holds the branches while the branch either has a leaf or another sub tree.

Vars

std::vector< branch < T, Tree > >

children_

Methods

tree_container ( )

~tree_container ( )

SAW_FORBID_COPY ( tree_container )

SAW_DEFAULT_MOVE ( tree_container )

error_or < void >

reserve ( std::size_t )

error_or < std::size_t >

add ( T )

error_or < std::size_t >

add ( )

std::size_t

size ( )

branch < T, Tree > &

at ( std::size_t )

const branch < T, Tree > &

at ( std::size_t )


Vars Description

std::vector< branch < T, Tree > > children_

Object holding the treeed branch instances

Methods Description

tree_container ( )

Default constructor

~tree_container ( )

Destructor

SAW_FORBID_COPY ( tree_container )


SAW_DEFAULT_MOVE ( tree_container )


error_or < void > reserve ( std::size_t )

Reserve space for siz elements

error_or < std::size_t > add ( T )

Add a branch with a leaf attached to the tree

error_or < std::size_t > add ( )

Add a branch to the tree with a tree attached

std::size_t size ( )

Returns the amount of branches contained within this tree level

branch < T, Tree > & at ( std::size_t )

Returns the branch at i

const branch < T, Tree > & at ( std::size_t )

Returns the branch at i