C++ main module for gpm Package  1.0
GPM_Node.h
Go to the documentation of this file.
1 #ifndef GPM_Node_H
2 #define GPM_Node_H
3 
4 #include "GPM_Vertex.h"
5 
13 
14 class GPM_Node : public GPM_Vertex {
15  SP_OBJECT(GPM_Node);
16  // ATTRIBUTES
17 
18 private:
19 
20 
21 
22 
23 protected:
24  // METHODS
25 
26  // CONSTRUCTORS
27 
29  GPM_Node(void);
30 
31 
32 
33  // DESTRUCTORS
34 
35 
38  virtual ~GPM_Node(void);
39 
40 
41 public:
42 
43  // NEW methods
44 
47  static inline SP::GPM_Node New() {
48  SP::GPM_Node p(new GPM_Node(),
50  p->setThis(p);
51  return p;
52  }
55  static inline SP::GPM_Node New(const int& id) {
56  SP::GPM_Node p=New();
57  p->setId(id);
58  return p;
59  }
62  static inline SP::GPM_Node New(const tString& groupName,const int& id) {
63  SP::GPM_Node p=New(id);
64  p->setGroupName(groupName);
65  return p;
66  }
69  virtual SP::GPM_GraphElement NewInstance() const {
70  return New();
71  }
74  virtual SP::GPM_Node NewCopyInstance() const {
75  SP::GPM_Node p=New();
76  p->copy(*this);
77  return p;
78  }
79 
80  // SET & GET methods
81 
84  virtual void copy(const GPM_GraphElement& node);
85 
86  // always hace a coordinate variable
87 
90  virtual void clearVariables() {
92  }
93 
94  // GROUP ID
95  // ==========
96 
99  virtual tString getGroupTypeName() const {
100  return "NODE";
101  }
102 
103 
104 
105 
106 
107 
108  // IO methods
109 
112  virtual tString toString() const;
113 
114 
115 
116 };
117 
118 #endif
virtual SP::GPM_GraphElement NewInstance() const
create a new instance
Definition: GPM_Node.h:69
static SP::GPM_Node New(const tString &groupName, const int &id)
create a node
Definition: GPM_Node.h:62
static SP::GPM_Node New(const int &id)
create a node
Definition: GPM_Node.h:55
virtual void clearVariables()
clear the variables
Definition: GPM_Node.h:90
static SP::GPM_Node New()
create a node
Definition: GPM_Node.h:47
This class describes a node.
Definition: GPM_Vertex.h:16
GPM_Node(void)
create an object
Definition: GPM_Node.cpp:8
DEFINE_SVPTR(GPM_Node)
virtual tString getGroupTypeName() const
get the default group type name
Definition: GPM_Node.h:99
virtual tString toString() const
to string
Definition: GPM_Node.cpp:25
virtual SP::GPM_Node NewCopyInstance() const
create a new instance
Definition: GPM_Node.h:74
#define tString
Definition: types.h:36
DEFINE_SPTR(GPM_Node)
virtual void clearVariables()
clear the variables
Definition: GPM_GraphElement.h:210
virtual void copy(const GPM_GraphElement &node)
copy
Definition: GPM_Node.cpp:19
virtual ~GPM_Node(void)
destroy an object.
Definition: GPM_Node.cpp:16
This class describes an element of a graph.
Definition: GPM_GraphElement.h:17
This class describes a node.
Definition: GPM_Node.h:14
class Free introduced for deleting a smart pointer
Definition: CORE_Object.h:106