Helios++
Helios software for LiDAR simulations
GroveTreeWrapper.h
1 #ifndef _GROVE_TREE_WRAPPER_H_
2 #define _GROVE_TREE_WRAPPER_H_
3 
4 template <typename Tree> class StaticGrove;
5 
6 #include <memory>
7 
16 template <typename Tree>
18 protected:
19  // *** ATTRIBUTES *** //
20  // ******************** //
28  size_t index;
29 
30 public:
31  // *** CONSTRUCTION / DESTRUCTION *** //
32  // ************************************ //
39  virtual ~GroveTreeWrapper() = default;
40 
41  // *** FOR-EACH LOOP OPERATORS *** //
42  // ********************************* //
52  bool operator!=(GroveTreeWrapper const &b) const;
57  const std::shared_ptr<Tree> operator*() const;
58 
59 };
60 
61 
62 #include <GroveTreeWrapper.tpp>
63 #endif
Wrapper for trees belonging to a StaticGrove so for-each loop can be used.
Definition: GroveTreeWrapper.h:17
StaticGrove< Tree > & grove
The grove where the tree belongs to.
Definition: GroveTreeWrapper.h:24
GroveTreeWrapper operator++()
Incremental operator to handle forward iterations in for-each loops.
const std::shared_ptr< Tree > operator*() const
Operator to obtain the tree corresponding to current for-each loop iteration.
size_t index
Index of the tree inside the grove.
Definition: GroveTreeWrapper.h:28
GroveTreeWrapper(StaticGrove< Tree > &grove, size_t const index)
Build a wrapper for the tree at given index.
bool operator!=(GroveTreeWrapper const &b) const
Comparison operator to handle last iteration detection in for-each loops.
A StaticGrove is an abstract class which declares methods to handle a set of trees.
Definition: StaticGrove.h:68