C++ main module for gpm Package  1.0
GPM_Port.h
Go to the documentation of this file.
1 #ifndef GPM_Port_H
2 #define GPM_Port_H
3 
4 #include "GPM_Vertex.h"
5 
7 
15 
16 class GPM_Port : public GPM_Vertex {
17  SP_OBJECT(GPM_Port);
18  // ATTRIBUTES
19 
20 private:
21 
22  tBoolean mAreCoordAutomatic;
23 
24 
25 protected:
26  // METHODS
27 
28  // CONSTRUCTORS
29 
31  GPM_Port(void);
32 
33 
34 
35  // DESTRUCTORS
36 
37 
40  virtual ~GPM_Port(void);
41 
42 
43 public:
44 
45  // NEW methods
46 
49  static inline SP::GPM_Port New() {
50  SP::GPM_Port p(new GPM_Port(),GPM_Port::Delete());
51  p->setThis(p);
52  return p;
53  }
56  static inline SP::GPM_Port New(const int& id) {
57  SP::GPM_Port p=New();
58  p->setId(id);
59  return p;
60  }
63  static inline SP::GPM_Port New(const tString& groupName,const int& id) {
64  SP::GPM_Port p=New(id);
65  p->setGroupName(groupName);
66  return p;
67  }
68 
71  virtual SP::GPM_GraphElement NewInstance() const {
72  return New();
73  }
76  virtual SP::GPM_Port NewCopyInstance() const {
77  SP::GPM_Port p=New();
78  p->copy(*this);
79  return p;
80  }
81 
84  virtual void copy(const GPM_GraphElement& node);
85 
88  virtual tString getGroupTypeName() const {
89  return "PORT";
90  }
91 
95  return mAreCoordAutomatic;
96  }
99  inline void setAreCoordinatesComputedByDefault(const tBoolean& isAutomatic) {
100  mAreCoordAutomatic=isAutomatic;
101  }
102 
105  virtual tBoolean setTriggerCoordinate(const tFlag& action,const int& k,const double& v) {
107  return GPM_Vertex::setTriggerCoordinate(action,k,v);
108 
109 
110  }
111  /* \brief set trigger coordinate action
112  */
113  virtual tBoolean setTriggerCoordinates(const tFlag& action,const double* value) {
115  return GPM_Vertex::setTriggerCoordinates(action,value);
116 
117  }
118 
121  virtual tBoolean loadFromStream(tString& tokenizer);
122 
125  virtual tString toString() const;
126 
127 };
128 
129 #endif
virtual tString getGroupTypeName() const
get the default group type name
Definition: GPM_Port.h:88
virtual tBoolean setTriggerCoordinates(const tFlag &action, const double *value)
set trigger coordinate action
DEFINE_SVPTR(GPM_Port)
#define tBoolean
Definition: types.h:35
virtual ~GPM_Port(void)
destroy an object.
Definition: GPM_Port.cpp:10
virtual tBoolean setTriggerCoordinate(const tFlag &action, const int &k, const double &v)
set trigger coordinates action
Definition: GPM_Port.h:105
tBoolean areCoordinatesComputedByDefault() const
return true if the coordiantes of port are those computed by default
Definition: GPM_Port.h:94
This class describes a node.
Definition: GPM_Vertex.h:16
This class describes a port.
Definition: GPM_Port.h:16
static SP::GPM_Port New(const tString &groupName, const int &id)
create a port
Definition: GPM_Port.h:63
virtual tBoolean setTriggerCoordinates(const tFlag &action, const double *value)
set trigger coordinate action
Definition: GPM_Port.h:113
virtual SP::GPM_GraphElement NewInstance() const
create a new instance
Definition: GPM_Port.h:71
virtual tString toString() const
turn the class into string
Definition: GPM_Port.cpp:48
static SP::GPM_Port New(const int &id)
create a port
Definition: GPM_Port.h:56
static SP::GPM_Port New()
create a port
Definition: GPM_Port.h:49
DEFINE_SPTR(GPM_Port)
virtual SP::GPM_Port NewCopyInstance() const
create a new instance
Definition: GPM_Port.h:76
virtual void copy(const GPM_GraphElement &node)
copy
Definition: GPM_Port.cpp:14
#define tString
Definition: types.h:36
virtual tBoolean loadFromStream(tString &tokenizer)
Definition: GPM_Port.cpp:22
virtual tBoolean setTriggerCoordinate(const tFlag &action, const int &k, const double &v)
set trigger coordinates action
Definition: GPM_Vertex.cpp:63
void setAreCoordinatesComputedByDefault(const tBoolean &isAutomatic)
set to true if the coordiantes of port are computed by default
Definition: GPM_Port.h:99
This class describes an element of a graph.
Definition: GPM_GraphElement.h:17
GPM_Port(void)
create an object
Definition: GPM_Port.cpp:3
class Free introduced for deleting a smart pointer
Definition: CORE_Object.h:106
#define tFlag
Definition: types.h:14