Go to the documentation of this file.00001
00002
00003
00004
00005 #ifndef _VAST_M_H_
00006 #define _VAST_M_H_
00007
00008 #include <omnetpp.h>
00009
00010
00011 #define MSGC_VERSION 0x0401
00012 #if (MSGC_VERSION!=OMNETPP_VERSION)
00013 # error Version mismatch! Probably this file was generated by an earlier version of opp_msgc: 'make clean' should help.
00014 #endif
00015
00016
00017 #include <NodeHandle.h>
00018 #include <OverlayKey.h>
00019 #include <Vector2D.h>
00020 #include <CommonMessages_m.h>
00021
00022
00023 static const int VASTCOMMAND_L = 8;
00024 static const int POSITION_L = 128;
00025 static const int ENTRYCOUNT_L = 32;
00026 static const int COUNT_L = 32;
00027 static const int FLAG_L = 8;
00028
00029 #define VAST_L(msg) (VASTCOMMAND_L + NODEHANDLE_L + KEY_L + POSITION_L + COUNT_L)
00030 #define VASTLIST_L(msg) (VAST_L(msg) + ENTRYCOUNT_L + FLAG_L + msg->getNeighborNodeArraySize() * (NODEHANDLE_L + POSITION_L))
00031 #define VASTMOVE_L(msg) (VAST_L(msg) + POSITION_L + 2 * FLAG_L)
00032 #define VASTDISCARD_L(msg) (VAST_L(msg) + NODEHANDLE_L)
00033
00034
00035
00036
00056 enum VASTCommand {
00057 JOIN_REQUEST = 0,
00058 JOIN_ACKNOWLEDGE = 1,
00059 NODE_MOVE = 2,
00060 NEW_NEIGHBORS = 3,
00061 NODE_LEAVE = 4,
00062 ENCLOSING_NEIGHBORS_REQUEST = 5,
00063 BACKUP_NEIGHBORS = 6,
00064 PING = 7,
00065 PONG = 8,
00066 DISCARD_NODE = 9,
00067 VAST_EVENT = 10
00068 };
00069
00083 class VastMessage : public ::BaseOverlayMessage
00084 {
00085 protected:
00086 int command_var;
00087 ::NodeHandle sourceNode_var;
00088 ::OverlayKey destKey_var;
00089 ::Vector2D pos_var;
00090 int neighborCount_var;
00091
00092
00093 bool operator==(const VastMessage&);
00094
00095 public:
00096 VastMessage(const char *name=NULL, int kind=0);
00097 VastMessage(const VastMessage& other);
00098 virtual ~VastMessage();
00099 VastMessage& operator=(const VastMessage& other);
00100 virtual VastMessage *dup() const {return new VastMessage(*this);}
00101 virtual void parsimPack(cCommBuffer *b);
00102 virtual void parsimUnpack(cCommBuffer *b);
00103
00104
00105 virtual int getCommand() const;
00106 virtual void setCommand(int command_var);
00107 virtual NodeHandle& getSourceNode();
00108 virtual const NodeHandle& getSourceNode() const {return const_cast<VastMessage*>(this)->getSourceNode();}
00109 virtual void setSourceNode(const NodeHandle& sourceNode_var);
00110 virtual OverlayKey& getDestKey();
00111 virtual const OverlayKey& getDestKey() const {return const_cast<VastMessage*>(this)->getDestKey();}
00112 virtual void setDestKey(const OverlayKey& destKey_var);
00113 virtual Vector2D& getPos();
00114 virtual const Vector2D& getPos() const {return const_cast<VastMessage*>(this)->getPos();}
00115 virtual void setPos(const Vector2D& pos_var);
00116 virtual int getNeighborCount() const;
00117 virtual void setNeighborCount(int neighborCount_var);
00118 };
00119
00120 inline void doPacking(cCommBuffer *b, VastMessage& obj) {obj.parsimPack(b);}
00121 inline void doUnpacking(cCommBuffer *b, VastMessage& obj) {obj.parsimUnpack(b);}
00122
00134 class VastListMessage : public ::VastMessage
00135 {
00136 protected:
00137 ::NodeHandle *neighborNode_var;
00138 unsigned int neighborNode_arraysize;
00139 ::Vector2D *neighborPos_var;
00140 unsigned int neighborPos_arraysize;
00141 bool requestEnclosingNeighbors_var;
00142
00143
00144 bool operator==(const VastListMessage&);
00145
00146 public:
00147 VastListMessage(const char *name=NULL, int kind=0);
00148 VastListMessage(const VastListMessage& other);
00149 virtual ~VastListMessage();
00150 VastListMessage& operator=(const VastListMessage& other);
00151 virtual VastListMessage *dup() const {return new VastListMessage(*this);}
00152 virtual void parsimPack(cCommBuffer *b);
00153 virtual void parsimUnpack(cCommBuffer *b);
00154
00155
00156 virtual void setNeighborNodeArraySize(unsigned int size);
00157 virtual unsigned int getNeighborNodeArraySize() const;
00158 virtual NodeHandle& getNeighborNode(unsigned int k);
00159 virtual const NodeHandle& getNeighborNode(unsigned int k) const {return const_cast<VastListMessage*>(this)->getNeighborNode(k);}
00160 virtual void setNeighborNode(unsigned int k, const NodeHandle& neighborNode_var);
00161 virtual void setNeighborPosArraySize(unsigned int size);
00162 virtual unsigned int getNeighborPosArraySize() const;
00163 virtual Vector2D& getNeighborPos(unsigned int k);
00164 virtual const Vector2D& getNeighborPos(unsigned int k) const {return const_cast<VastListMessage*>(this)->getNeighborPos(k);}
00165 virtual void setNeighborPos(unsigned int k, const Vector2D& neighborPos_var);
00166 virtual bool getRequestEnclosingNeighbors() const;
00167 virtual void setRequestEnclosingNeighbors(bool requestEnclosingNeighbors_var);
00168 };
00169
00170 inline void doPacking(cCommBuffer *b, VastListMessage& obj) {obj.parsimPack(b);}
00171 inline void doUnpacking(cCommBuffer *b, VastListMessage& obj) {obj.parsimUnpack(b);}
00172
00184 class VastMoveMessage : public ::VastMessage
00185 {
00186 protected:
00187 ::Vector2D newPos_var;
00188 bool is_boundary_var;
00189 bool request_list_var;
00190
00191
00192 bool operator==(const VastMoveMessage&);
00193
00194 public:
00195 VastMoveMessage(const char *name=NULL, int kind=0);
00196 VastMoveMessage(const VastMoveMessage& other);
00197 virtual ~VastMoveMessage();
00198 VastMoveMessage& operator=(const VastMoveMessage& other);
00199 virtual VastMoveMessage *dup() const {return new VastMoveMessage(*this);}
00200 virtual void parsimPack(cCommBuffer *b);
00201 virtual void parsimUnpack(cCommBuffer *b);
00202
00203
00204 virtual Vector2D& getNewPos();
00205 virtual const Vector2D& getNewPos() const {return const_cast<VastMoveMessage*>(this)->getNewPos();}
00206 virtual void setNewPos(const Vector2D& newPos_var);
00207 virtual bool getIs_boundary() const;
00208 virtual void setIs_boundary(bool is_boundary_var);
00209 virtual bool getRequest_list() const;
00210 virtual void setRequest_list(bool request_list_var);
00211 };
00212
00213 inline void doPacking(cCommBuffer *b, VastMoveMessage& obj) {obj.parsimPack(b);}
00214 inline void doUnpacking(cCommBuffer *b, VastMoveMessage& obj) {obj.parsimUnpack(b);}
00215
00225 class VastDiscardMessage : public ::VastMessage
00226 {
00227 protected:
00228 ::NodeHandle discardNode_var;
00229
00230
00231 bool operator==(const VastDiscardMessage&);
00232
00233 public:
00234 VastDiscardMessage(const char *name=NULL, int kind=0);
00235 VastDiscardMessage(const VastDiscardMessage& other);
00236 virtual ~VastDiscardMessage();
00237 VastDiscardMessage& operator=(const VastDiscardMessage& other);
00238 virtual VastDiscardMessage *dup() const {return new VastDiscardMessage(*this);}
00239 virtual void parsimPack(cCommBuffer *b);
00240 virtual void parsimUnpack(cCommBuffer *b);
00241
00242
00243 virtual NodeHandle& getDiscardNode();
00244 virtual const NodeHandle& getDiscardNode() const {return const_cast<VastDiscardMessage*>(this)->getDiscardNode();}
00245 virtual void setDiscardNode(const NodeHandle& discardNode_var);
00246 };
00247
00248 inline void doPacking(cCommBuffer *b, VastDiscardMessage& obj) {obj.parsimPack(b);}
00249 inline void doUnpacking(cCommBuffer *b, VastDiscardMessage& obj) {obj.parsimUnpack(b);}
00250
00259 class VastEventMessage : public ::VastMessage
00260 {
00261 protected:
00262
00263
00264 bool operator==(const VastEventMessage&);
00265
00266 public:
00267 VastEventMessage(const char *name=NULL, int kind=0);
00268 VastEventMessage(const VastEventMessage& other);
00269 virtual ~VastEventMessage();
00270 VastEventMessage& operator=(const VastEventMessage& other);
00271 virtual VastEventMessage *dup() const {return new VastEventMessage(*this);}
00272 virtual void parsimPack(cCommBuffer *b);
00273 virtual void parsimUnpack(cCommBuffer *b);
00274
00275
00276 };
00277
00278 inline void doPacking(cCommBuffer *b, VastEventMessage& obj) {obj.parsimPack(b);}
00279 inline void doUnpacking(cCommBuffer *b, VastEventMessage& obj) {obj.parsimUnpack(b);}
00280
00281
00282 #endif // _VAST_M_H_