C++ main module for gpm Package  1.0
GPM_ModelChildNode.h
Go to the documentation of this file.
1 #ifndef GPM_ModelChildNode_H
2 #define GPM_ModelChildNode_H
3 
4 
5 #include "GPM_ModelParentNode.h"
6 
17 
19 
20  SP_OBJECT(GPM_ModelChildNode);
21  // ATTRIBUTES
22 
23 public:
24 
25 
26 
27 private:
28 
29  //ASSOCIATION
30  WV::GPM_ModelParentNode mParents;
31 
32 protected:
33  // METHODS
34 
35  // CONSTRUCTORS
36 
39  GPM_ModelChildNode(void);
40 
41 
42  // DESTRUCTORS
43 
44 
47  virtual ~GPM_ModelChildNode(void);
48 
49 
50 public:
53  inline static SP::GPM_ModelChildNode New() {
54  SP::GPM_ModelChildNode p(new GPM_ModelChildNode(),GPM_ModelChildNode::Delete());
55  p->setThis(p);
56  return p;
57  }
58 
59  // SET Methods
60  // ===========
61 
64  void addToParents(SP::GPM_ModelParentNode parent);
67  void removeFromParents(SP::GPM_ModelParentNode parent);
68 
69 
70  // GET Methods
71  // =============
72 
75  tBoolean isInAscendants(const GPM_ModelParentNode& node) const;
76 
79  inline GPM_ModelParentNode* getParent(const int& index) {
80  return mParents.get(index);
81  }
84  inline const GPM_ModelParentNode* getParent(const int& index) const {
85  return mParents.get(index);
86  }
87 
90  inline int getParentsNumber() const {
91  return mParents.getSize();
92  }
95  virtual void getLeaves(SV::GPM_ModelChildNode& nodes);
96 
99  void remove();
100 };
101 
102 #endif
tBoolean isInAscendants(const GPM_ModelParentNode &node) const
return true if the node in in its ascent
Definition: GPM_ModelChildNode.cpp:41
int getParentsNumber() const
get the parents number
Definition: GPM_ModelChildNode.h:90
static SP::GPM_ModelChildNode New()
create a node
Definition: GPM_ModelChildNode.h:53
This class describes a model parent node for tree.
Definition: GPM_ModelParentNode.h:20
GPM_ModelParentNode * getParent(const int &index)
get the parent for writing
Definition: GPM_ModelChildNode.h:79
GPM_ModelChildNode(void)
create
Definition: GPM_ModelChildNode.cpp:3
#define tBoolean
Definition: types.h:35
DEFINE_SVPTR(GPM_ModelChildNode)
void removeFromParents(SP::GPM_ModelParentNode parent)
remove from parents
Definition: GPM_ModelChildNode.cpp:26
void addToParents(SP::GPM_ModelParentNode parent)
set to parent
Definition: GPM_ModelChildNode.cpp:10
DEFINE_SPTR(GPM_ModelChildNode)
This class describes a model parent node for tree.
Definition: GPM_ModelChildNode.h:18
virtual void getLeaves(SV::GPM_ModelChildNode &nodes)
get the leaves
Definition: GPM_ModelChildNode.cpp:53
const GPM_ModelParentNode * getParent(const int &index) const
get the parent for reading
Definition: GPM_ModelChildNode.h:84
virtual ~GPM_ModelChildNode(void)
destroy
Definition: GPM_ModelChildNode.cpp:6
class Free introduced for deleting a smart pointer
Definition: CORE_Object.h:106