C++ main module for gpm Package  1.0
GPM_ModelEdge.h
Go to the documentation of this file.
1 #ifndef GPM_ModelEdge_H
2 #define GPM_ModelEdge_H
3 
4 
5 #include "GPM_Edge.h"
6 
8 
18 class GPM_ModelEdge : public virtual GPM_Edge , public virtual GPM_ModelGraphElement{
19 
20  SP_OBJECT(GPM_ModelEdge);
21  // ATTRIBUTES
22 
23 public:
24 
25 
26 
27 private:
28 
29 protected:
30  // METHODS
31 
32  // CONSTRUCTORS
33 
36  GPM_ModelEdge(SP::GPM_Vertex source,SP::GPM_Vertex target);
37 
38 
39 
40  // DESTRUCTORS
41 
42 
45  virtual ~GPM_ModelEdge(void);
46 
47 
48 
49 public:
52  inline static SP::GPM_ModelEdge New(SP::GPM_Vertex source,
53  SP::GPM_Vertex target) {
54  SP::GPM_ModelEdge p(new GPM_ModelEdge(source,target),GPM_ModelEdge::Delete());
55  p->setThis(p);
56  return p;
57  };
60  static inline SP::GPM_ModelEdge New(const int& id) {
61  SP::GPM_Vertex edge,target;
62  SP::GPM_ModelEdge p=GPM_ModelEdge::New(edge,target);
63  p->setId(id);
64  return p;
65  }
68  static inline SP::GPM_ModelEdge New() {
69  SP::GPM_Vertex edge,target;
70  return GPM_ModelEdge::New(edge,target);
71  }
74  virtual SP::GPM_GraphElement NewInstance() const {
75  return New();
76  }
77 
78  // SET & GET methods
81  virtual void copy(const GPM_GraphElement& node) {
82  GPM_Edge::copy(node);
83  const GPM_ModelGraphElement *modelGraphElement=dynamic_cast<const GPM_ModelGraphElement*>(&node);
84  if (modelGraphElement!=null) GPM_ModelGraphElement::copy(*modelGraphElement);
85  }
88  virtual void updateEnvironment(const map<tString,SP::GPM_Variable>& env) {
91 
92  }
93 
94 
95 };
96 
97 #endif
virtual void copy(const GPM_GraphElement &node)
copy
Definition: GPM_GraphElement.cpp:34
virtual ~GPM_ModelEdge(void)
destroy
Definition: GPM_ModelEdge.cpp:7
This class describes a model GraphElement interface.
Definition: GPM_ModelGraphElement.h:21
virtual void updateEnvironment(const map< tString, SP::GPM_Variable > &env)
update the environment
Definition: GPM_ModelGraphElement.cpp:29
#define null
Definition: types.h:13
GPM_ModelEdge(SP::GPM_Vertex source, SP::GPM_Vertex target)
create
Definition: GPM_ModelEdge.cpp:4
This class describes a model Edge.
Definition: GPM_ModelEdge.h:18
This class describes a edge.
Definition: GPM_Edge.h:15
DEFINE_SPTR(GPM_ModelEdge)
static SP::GPM_ModelEdge New(const int &id)
create an edge
Definition: GPM_ModelEdge.h:60
virtual void updateEnvironment(const map< tString, SP::GPM_Variable > &env)
update environment
Definition: GPM_GraphElement.cpp:114
static SP::GPM_ModelEdge New()
create an edge
Definition: GPM_ModelEdge.h:68
virtual void updateEnvironment(const map< tString, SP::GPM_Variable > &env)
update the environment
Definition: GPM_ModelEdge.h:88
virtual SP::GPM_GraphElement NewInstance() const
create a new instance
Definition: GPM_ModelEdge.h:74
This class describes an element of a graph.
Definition: GPM_GraphElement.h:17
virtual void copy(const GPM_ModelGraphElement &vertex)
copy
Definition: GPM_ModelGraphElement.cpp:13
virtual void copy(const GPM_GraphElement &node)
copy
Definition: GPM_ModelEdge.h:81
class Free introduced for deleting a smart pointer
Definition: CORE_Object.h:106
static SP::GPM_ModelEdge New(SP::GPM_Vertex source, SP::GPM_Vertex target)
create a test class
Definition: GPM_ModelEdge.h:52