#include <hierarchyobject.h>
Iterator Class to run through all the elements of a HierarchyObjectRef in a linear manner.
Example usage:
Since the iterator is templated you can easily filter the hierarchy for certain types. In this example OSWindowRef is (amongst others) derived from HierarchyObjectRef. By passing the type <OSWindowRef> to the iterator you will get only these objects - no matter where they are located in the hierarchy.
Please note that the HierarchyObjectIterator automatically gives you the correct typed object. This saves you from manually checking for the correct type and the do a (potential risky) cast to the target type like in this (not recommended) example.
Public Member Functions | |
HierarchyObjectIterator () | |
HierarchyObjectIterator (const HierarchyObjectIterator &src) | |
HierarchyObjectIterator (HierarchyObjectIterator &&src) | |
MAXON_OPERATOR_COPY_ASSIGNMENT (HierarchyObjectIterator) | |
MAXON_OPERATOR_MOVE_ASSIGNMENT (HierarchyObjectIterator) | |
HierarchyObjectIterator (const HierarchyObjectRef<> &first) | |
void | operator++ () |
operator Bool () const | |
const REFTYPE & | operator* () |
const REFTYPE * | operator-> () |
Public Member Functions inherited from ForEachIterator< HierarchyObjectIterator< REFTYPE > > | |
MAXON_ATTRIBUTE_FORCE_INLINE | ForEachIterator (ARGS &&... args) |
String | ToString (const FormatStatement *formatStatement=nullptr) |
HierarchyObjectIterator< REFTYPE > & | Find (const T &v) |
Int | FindIndex (const T &v) |
MAXON_ATTRIBUTE_FORCE_INLINE Bool | Contains (const T &v) |
MAXON_ATTRIBUTE_FORCE_INLINE Wrapper | begin () |
Private Attributes | |
HierarchyObjectInterface * | _last |
HierarchyObjectRef | _parent |
Additional Inherited Members | |
Public Types inherited from ForEachIterator< HierarchyObjectIterator< REFTYPE > > | |
using | IsForEachIterator = std::true_type |
Static Public Member Functions inherited from ForEachIterator< HierarchyObjectIterator< REFTYPE > > | |
static MAXON_ATTRIBUTE_FORCE_INLINE | PRIVATE_MAXON_RBF_SENTINEL (Wrapper) end() |
HierarchyObjectIterator | ( | const HierarchyObjectIterator< REFTYPE > & | src | ) |
HierarchyObjectIterator | ( | HierarchyObjectIterator< REFTYPE > && | src | ) |
|
explicit |
MAXON_OPERATOR_COPY_ASSIGNMENT | ( | HierarchyObjectIterator< REFTYPE > | ) |
MAXON_OPERATOR_MOVE_ASSIGNMENT | ( | HierarchyObjectIterator< REFTYPE > | ) |
void operator++ | ( | ) |
|
explicit |
const REFTYPE& operator* | ( | ) |
const REFTYPE* operator-> | ( | ) |
|
private |
|
private |