00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00043
00098 #ifndef _GROUPGATENODE_H
00099 #define _GROUPGATENODE_H
00100
00101 #include "../OpenTracker.h"
00102 #include "GroupGateModule.h"
00103
00104 #include <string>
00105 #include <vector>
00106
00107
00108 #ifndef OT_NO_GROUPGATE_SUPPORT
00109
00110
00111 namespace ot {
00112
00113 typedef std::vector<std::string> NeighborsVector;
00114 typedef std::vector<Node *> NeighborPtrsVector;
00115
00121 class OPENTRACKER_API GroupGateNode : public Node
00122 {
00123 private:
00124 int Number;
00125 GroupGateGroup *Owner;
00126 std::string Name;
00127 NeighborsVector Neighbors;
00128 NeighborPtrsVector NeighborPtrs;
00129 bool IsActive;
00130
00131 protected:
00132
00134 GroupGateNode(const char *name, GroupGateGroup *owner);
00135 ~GroupGateNode();
00136
00137 void setNumber(int num);
00138 int getNumber();
00139 void addNeighbor(const char *neighbor);
00140 bool isActive();
00141 void activate();
00142 void deactivate();
00143 const char *getGroupGateName();
00144
00145 public:
00146 virtual int isEventGenerator()
00147 {
00148 return 1;
00149 }
00150
00151 virtual void onEventGenerated(Event &event, Node &generator);
00152
00153 friend class GroupGateModule;
00154 friend class GroupGateGroup;
00155 };
00156
00157
00158 class OPENTRACKER_API Override : public Node
00159 {
00160 protected:
00161 Override() : Node()
00162 {
00163 }
00164
00165 public:
00166
00167 virtual int isNodePort()
00168 {
00169 return 1;
00170 }
00171
00172 virtual void onEventGenerated(Event &event, Node &generator)
00173 {
00174 updateObservers(event);
00175 }
00176
00177 friend class GroupGateModule;
00178 };
00179
00185 class OPENTRACKER_API ActiveGateNode : public Node
00186 {
00187 private:
00188 Event event;
00189
00190 protected:
00191
00192 ActiveGateNode() : Node()
00193 {
00194 }
00195
00196 public:
00197
00198 virtual int isEventGenerator()
00199 {
00200 return 1;
00201 }
00202
00203 void pushEvent(unsigned short groupgatenum)
00204 {
00205 event.getButton() = groupgatenum;
00206 event.timeStamp();
00207 updateObservers(event);
00208 }
00209
00210 friend class GroupGateModule;
00211 friend class GroupGateGroup;
00212 };
00213
00214 }
00215
00216
00217 #endif // OT_NO_GROUPGATE_SUPPORT
00218
00219 #endif
00220
00221
00222
00223
00224
00225
00226
00227
00228
00229
00230
00231
00232
00233
00234
00235
00236