Helios++
Helios software for LiDAR simulations
IterableTreeNode< NodeType > Class Template Reference

Class representing an iterable tree node. It is a wrapper for a given tree node type which handles some extra features that can be useful during iteration such as depth level. More...

#include <IterableTreeNode.h>

Public Member Functions

 IterableTreeNode (NodeType *node, int depth=0)
 Construct an iterable tree node. More...
 
NodeType * getNode () const
 Obtain the tree node being wrapped. More...
 
void setNode (NodeType *node)
 Set the tree node being wrapped. More...
 
void setNode (NodeType *node, int const depth)
 Set both the tree node being wrapped and its depth. More...
 
int getDepth () const
 Obtain the depth of wrapped tree node. More...
 
void setDepth (int const depth)
 Set the depth of tree node being wrapped. More...
 

Protected Attributes

NodeType * node
 Tree node being wrapped.
 
int depth
 Depth of tree node being wrapped.
 

Private Member Functions

template<class Archive >
void serialize (Archive &ar, const unsigned int version)
 Serialize a IterableTreeNode to a stream of bytes. More...
 

Friends

class boost::serialization::access
 

Detailed Description

template<typename NodeType>
class IterableTreeNode< NodeType >

Class representing an iterable tree node. It is a wrapper for a given tree node type which handles some extra features that can be useful during iteration such as depth level.

Author
Alberto M. Esmoris Pena
Version
1.0
Template Parameters
NodeTypeTree node type being wrapped

Constructor & Destructor Documentation

◆ IterableTreeNode()

template<typename NodeType >
IterableTreeNode< NodeType >::IterableTreeNode ( NodeType *  node,
int  depth = 0 
)
inline

Construct an iterable tree node.

Parameters
nodeTree node being wrapped
depthNode depth inside the tree
See also
IterableTreeNode::node
IterableTreeNode::depth

Member Function Documentation

◆ getDepth()

template<typename NodeType >
int IterableTreeNode< NodeType >::getDepth ( ) const
inline

Obtain the depth of wrapped tree node.

Returns
Depth of wrapped tree node
See also
IterableNode::depth

◆ getNode()

template<typename NodeType >
NodeType* IterableTreeNode< NodeType >::getNode ( ) const
inline

Obtain the tree node being wrapped.

Returns
Tree node being wrapped
See also
IterableTreeNode::node

◆ serialize()

template<typename NodeType >
template<class Archive >
void IterableTreeNode< NodeType >::serialize ( Archive &  ar,
const unsigned int  version 
)
inlineprivate

Serialize a IterableTreeNode to a stream of bytes.

Template Parameters
ArchiveType of rendering
Parameters
arSpecific rendering for the stream of bytes
versionVersion number for the IterableTreeNode

◆ setDepth()

template<typename NodeType >
void IterableTreeNode< NodeType >::setDepth ( int const  depth)
inline

Set the depth of tree node being wrapped.

Parameters
depthNew depth for tree node being wrapped
See also
IterableNode::depth

◆ setNode() [1/2]

template<typename NodeType >
void IterableTreeNode< NodeType >::setNode ( NodeType *  node)
inline

Set the tree node being wrapped.

Parameters
nodeNew tree node being wrapped
See also
IterableTreeNode::node

◆ setNode() [2/2]

template<typename NodeType >
void IterableTreeNode< NodeType >::setNode ( NodeType *  node,
int const  depth 
)
inline

Set both the tree node being wrapped and its depth.

Parameters
nodeNew tree node being wrapped
depthNew depth for tree node being wrapped
See also
IterableTreeNode::setNode(NodeType *)
IterableTreeNode::setDepth(int const)

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