OverSim
BrooseMessage_m.h
Go to the documentation of this file.
1 //
2 // Generated file, do not edit! Created by opp_msgc 4.2 from overlay/broose/BrooseMessage.msg.
3 //
4 
5 #ifndef _BROOSEMESSAGE_M_H_
6 #define _BROOSEMESSAGE_M_H_
7 
8 #include <omnetpp.h>
9 
10 // opp_msgc version check
11 #define MSGC_VERSION 0x0402
12 #if (MSGC_VERSION!=OMNETPP_VERSION)
13 # error Version mismatch! Probably this file was generated by an earlier version of opp_msgc: 'make clean' should help.
14 #endif
15 
16 // cplusplus {{
17 #include <IPvXAddress.h>
18 #include <NodeHandle.h>
19 #include <CommonMessages_m.h>
20 #include <OverlayKey.h>
21 
22 
23 static const int INDEX_L = 8;
24 static const int BUCKETTYPE_L = 2;
25 static const int PROTOSTATE_L = 2;
26 static const int STEP_L = 8;
27 static const int RIGHTSHIFTING_L = 1;
28 static const int NODENUM_L = 8;
29 
30 #define BUCKETCALL_L(msg) (BASECALL_L(msg) + INDEX_L + BUCKETTYPE_L + PROTOSTATE_L)
31 #define BUCKETRESPONSE_L(msg) (BASERESPONSE_L(msg) + NODENUM_L \
32  + msg->getNodesArraySize() * NODEHANDLE_L)
33 #define BROOSEFINDNODEEXTMESSAGE_L (KEY_L + STEP_L + RIGHTSHIFTING_L + NODEHANDLE_L)
34 // }}
35 
36 
37 
50 enum BucketType {
51  RIGHT = 0,
52  LEFT = 1,
53  BROTHER = 2
54 };
55 
69 enum ProState {
70  PINIT = 0,
71  PRSET = 1,
72  PBSET = 2,
73  PREADY = 3
74 };
75 
88 {
89  protected:
93 
94  private:
95  void copy(const BucketCall& other);
96 
97  protected:
98  // protected and unimplemented operator==(), to prevent accidental usage
99  bool operator==(const BucketCall&);
100 
101  public:
102  BucketCall(const char *name=NULL, int kind=0);
103  BucketCall(const BucketCall& other);
104  virtual ~BucketCall();
105  BucketCall& operator=(const BucketCall& other);
106  virtual BucketCall *dup() const {return new BucketCall(*this);}
107  virtual void parsimPack(cCommBuffer *b);
108  virtual void parsimUnpack(cCommBuffer *b);
109 
110  // field getter/setter methods
111  virtual int getBucketType() const;
112  virtual void setBucketType(int bucketType);
113  virtual int getBucketIndex() const;
114  virtual void setBucketIndex(int bucketIndex);
115  virtual int getProState() const;
116  virtual void setProState(int proState);
117 };
118 
119 inline void doPacking(cCommBuffer *b, BucketCall& obj) {obj.parsimPack(b);}
120 inline void doUnpacking(cCommBuffer *b, BucketCall& obj) {obj.parsimUnpack(b);}
121 
132 {
133  protected:
134  NodeHandle *nodes_var; // array ptr
135  unsigned int nodes_arraysize;
136 
137  private:
138  void copy(const BucketResponse& other);
139 
140  protected:
141  // protected and unimplemented operator==(), to prevent accidental usage
142  bool operator==(const BucketResponse&);
143 
144  public:
145  BucketResponse(const char *name=NULL, int kind=0);
146  BucketResponse(const BucketResponse& other);
147  virtual ~BucketResponse();
148  BucketResponse& operator=(const BucketResponse& other);
149  virtual BucketResponse *dup() const {return new BucketResponse(*this);}
150  virtual void parsimPack(cCommBuffer *b);
151  virtual void parsimUnpack(cCommBuffer *b);
152 
153  // field getter/setter methods
154  virtual void setNodesArraySize(unsigned int size);
155  virtual unsigned int getNodesArraySize() const;
156  virtual NodeHandle& getNodes(unsigned int k);
157  virtual const NodeHandle& getNodes(unsigned int k) const {return const_cast<BucketResponse*>(this)->getNodes(k);}
158  virtual void setNodes(unsigned int k, const NodeHandle& nodes);
159 };
160 
161 inline void doPacking(cCommBuffer *b, BucketResponse& obj) {obj.parsimPack(b);}
162 inline void doUnpacking(cCommBuffer *b, BucketResponse& obj) {obj.parsimUnpack(b);}
163 
177 class BrooseFindNodeExtMessage : public ::cPacket
178 {
179  protected:
181  int step_var;
185 
186  private:
187  void copy(const BrooseFindNodeExtMessage& other);
188 
189  protected:
190  // protected and unimplemented operator==(), to prevent accidental usage
192 
193  public:
194  BrooseFindNodeExtMessage(const char *name=NULL, int kind=0);
196  virtual ~BrooseFindNodeExtMessage();
198  virtual BrooseFindNodeExtMessage *dup() const {return new BrooseFindNodeExtMessage(*this);}
199  virtual void parsimPack(cCommBuffer *b);
200  virtual void parsimUnpack(cCommBuffer *b);
201 
202  // field getter/setter methods
203  virtual OverlayKey& getRouteKey();
204  virtual const OverlayKey& getRouteKey() const {return const_cast<BrooseFindNodeExtMessage*>(this)->getRouteKey();}
205  virtual void setRouteKey(const OverlayKey& routeKey);
206  virtual int getStep() const;
207  virtual void setStep(int step);
208  virtual int getMaxDistance() const;
209  virtual void setMaxDistance(int maxDistance);
210  virtual bool getRightShifting() const;
211  virtual void setRightShifting(bool rightShifting);
212  virtual NodeHandle& getLastNode();
213  virtual const NodeHandle& getLastNode() const {return const_cast<BrooseFindNodeExtMessage*>(this)->getLastNode();}
214  virtual void setLastNode(const NodeHandle& lastNode);
215 };
216 
217 inline void doPacking(cCommBuffer *b, BrooseFindNodeExtMessage& obj) {obj.parsimPack(b);}
218 inline void doUnpacking(cCommBuffer *b, BrooseFindNodeExtMessage& obj) {obj.parsimUnpack(b);}
219 
220 
221 #endif // _BROOSEMESSAGE_M_H_