IMultiTreeNode.h
Go to the documentation of this file.
1 
2 #pragma once
3 
4 #include "ionTypes.h"
5 
6 
7 namespace ion
8 {
9 
14  template <typename Implementation>
16  {
17 
18  public:
19 
20  set<Implementation *> const & GetChildren() const
21  {
22  return Children;
23  }
24 
25  void AddChild(Implementation * Child)
26  {
27  Children.insert(static_cast<Implementation *>(Child));
28  }
29 
30  void RemoveChild(Implementation * Child)
31  {
32  Children.erase(static_cast<Implementation *>(Child));
33  }
34 
36  {
37  Children.clear();
38  }
39 
40  template <typename Return>
41  void RecurseOnChildren(Return(Implementation::* Function)())
42  {
43  for (auto Child : Children)
44  (Child->*Function)();
45  }
46 
47  template <typename Return, typename P1>
48  void RecurseOnChildren(Return(Implementation::* Function)(P1), P1 p1)
49  {
50  for (auto Child : Children)
51  (Child->*Function)(p1);
52  }
53 
54  template <typename Return, typename P1, typename P2>
55  void RecurseOnChildren(Return(Implementation::* Function)(P1, P2), P1 p1, P2 p2)
56  {
57  for (auto Child : Children)
58  (Child->*Function)(p1, p2);
59  }
60 
61  protected:
62 
64  {}
65 
66  set<Implementation *> Children;
67 
68  };
69 
70 }
void RemoveAllChildren()
Definition: IMultiTreeNode.h:35
void RecurseOnChildren(Return(Implementation::*Function)(P1, P2), P1 p1, P2 p2)
Definition: IMultiTreeNode.h:55
set< Implementation * > const & GetChildren() const
Definition: IMultiTreeNode.h:20
IMultiTreeNode()
Definition: IMultiTreeNode.h:63
Definition: CCatmullRomAdvancedSplineInterpolator.h:7
set< Implementation * > Children
Definition: IMultiTreeNode.h:66
void RemoveChild(Implementation *Child)
Definition: IMultiTreeNode.h:30
Defines typedefs for integer and floating point types.
void RecurseOnChildren(Return(Implementation::*Function)())
Definition: IMultiTreeNode.h:41
void AddChild(Implementation *Child)
Definition: IMultiTreeNode.h:25
void RecurseOnChildren(Return(Implementation::*Function)(P1), P1 p1)
Definition: IMultiTreeNode.h:48
Variant of ITreeNode that doesn&#39;t require a single parent relationship.
Definition: IMultiTreeNode.h:15