Iterator to navigate through all the nodes. More...
#include <GeometryCore.h>
Classes | |
| struct | NodeInfo_t |
Public Member Functions | |
| ROOTGeoNodeForwardIterator (TGeoNode const *start_node) | |
| Constructor: start from this node. More... | |
| TGeoNode const * | operator* () const |
| Returns the pointer to the current node, or nullptr if none. More... | |
| ROOTGeoNodeForwardIterator & | operator++ () |
| Points to the next node, or to nullptr if there are no more. More... | |
| std::vector< TGeoNode const * > | get_path () const |
| Returns the full path of the current node. More... | |
Protected Types | |
| using | Node_t = TGeoNode const * |
Protected Member Functions | |
| void | reach_deepest_descendant () |
| void | init (TGeoNode const *start_node) |
Protected Attributes | |
| std::vector< NodeInfo_t > | current_path |
| which node, which sibling? More... | |
Iterator to navigate through all the nodes.
Note that this is not a fully standard forward iterator in that it lacks of the postfix operator. The reason is that it's too expensive and it should be avoided. Also I did not bother declaring the standard type definitions (that's just laziness).
An example of iteration:
TGeoNode const* pCurrentNode;
ROOTGeoNodeForwardIterator iNode(geom->ROOTGeoManager()->GetTopNode());
while ((pCurrentNode = *iNode)) {
// do something with pCurrentNode
++iNode;
} // while
These iterators are one use only, and they can't be reset after a loop is completed.
Definition at line 1310 of file GeometryCore.h.
|
protected |
Definition at line 1325 of file GeometryCore.h.
|
inline |
Constructor: start from this node.
Definition at line 1313 of file GeometryCore.h.
| std::vector< TGeoNode const * > gar::geo::ROOTGeoNodeForwardIterator::get_path | ( | ) | const |
Returns the full path of the current node.
Definition at line 2013 of file GeometryCore.cxx.
|
protected |
Definition at line 2034 of file GeometryCore.cxx.
|
inline |
Returns the pointer to the current node, or nullptr if none.
Definition at line 1316 of file GeometryCore.h.
| ROOTGeoNodeForwardIterator & gar::geo::ROOTGeoNodeForwardIterator::operator++ | ( | ) |
Points to the next node, or to nullptr if there are no more.
Definition at line 1994 of file GeometryCore.cxx.
|
protected |
Definition at line 2025 of file GeometryCore.cxx.
|
protected |
which node, which sibling?
Definition at line 1333 of file GeometryCore.h.
1.8.11