Helios++
Helios software for LiDAR simulations
IterableTreeNode.h
1 #pragma once
2 
11 template <typename NodeType>
13 private:
14  // *** SERIALIZATION *** //
15  // *********************** //
16  friend class boost::serialization::access;
23  template<class Archive>
24  void serialize(Archive &ar, const unsigned int version){
25  ar &node;
26  ar &depth;
27  }
28 protected:
29  // *** ATTRIBUTES *** //
30  // ******************** //
34  NodeType *node;
38  int depth;
39 
40 public:
41  // *** CONSTRUCTION / DESTRUCTION *** //
42  // ************************************ //
50  IterableTreeNode(NodeType *node, int depth=0) :
51  node(node),
52  depth(depth)
53  {}
54  virtual ~IterableTreeNode() {}
55 
56  // *** GETTERs and SETTERs *** //
57  // ***************************** //
63  inline NodeType * getNode() const {return node;}
69  inline void setNode(NodeType *node) {this->node = node;}
77  inline void setNode(NodeType *node, int const depth)
84  inline int getDepth() const {return depth;}
90  inline void setDepth(int const depth) {this->depth = depth;}
91 };
Class representing an iterable tree node. It is a wrapper for a given tree node type which handles so...
Definition: IterableTreeNode.h:12
void setNode(NodeType *node, int const depth)
Set both the tree node being wrapped and its depth.
Definition: IterableTreeNode.h:77
IterableTreeNode(NodeType *node, int depth=0)
Construct an iterable tree node.
Definition: IterableTreeNode.h:50
NodeType * node
Tree node being wrapped.
Definition: IterableTreeNode.h:34
int depth
Depth of tree node being wrapped.
Definition: IterableTreeNode.h:38
void setDepth(int const depth)
Set the depth of tree node being wrapped.
Definition: IterableTreeNode.h:90
void serialize(Archive &ar, const unsigned int version)
Serialize a IterableTreeNode to a stream of bytes.
Definition: IterableTreeNode.h:24
NodeType * getNode() const
Obtain the tree node being wrapped.
Definition: IterableTreeNode.h:63
int getDepth() const
Obtain the depth of wrapped tree node.
Definition: IterableTreeNode.h:84
void setNode(NodeType *node)
Set the tree node being wrapped.
Definition: IterableTreeNode.h:69