OverSim
KademliaMessage_m.h
Go to the documentation of this file.
1 //
2 // Generated file, do not edit! Created by opp_msgc 4.2 from overlay/kademlia/KademliaMessage.msg.
3 //
4 
5 #ifndef _KADEMLIAMESSAGE_M_H_
6 #define _KADEMLIAMESSAGE_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 <KademliaNodeHandle.h>
18 #include <OverlayKey.h>
19 #include <CommonMessages_m.h>
20 
21 static const int ALIVEFLAG_L = 8;
22 #define MARKEDNODEHANDLE_L (NODEHANDLE_L + ALIVEFLAG_L)
23 
24 #define KADEMLIAROUTINGINFO_L(msg) (BASEOVERLAY_L(msg) + NODEHANDLE_L + \
25  KEY_L + \
26  msg->getNextHopsArraySize() * \
27  MARKEDNODEHANDLE_L)
28 // }}
29 
30 
31 
44 {
45  protected:
49  unsigned int nextHops_arraysize;
50 
51  private:
52  void copy(const KademliaRoutingInfoMessage& other);
53 
54  protected:
55  // protected and unimplemented operator==(), to prevent accidental usage
57 
58  public:
59  KademliaRoutingInfoMessage(const char *name=NULL, int kind=0);
63  virtual KademliaRoutingInfoMessage *dup() const {return new KademliaRoutingInfoMessage(*this);}
64  virtual void parsimPack(cCommBuffer *b);
65  virtual void parsimUnpack(cCommBuffer *b);
66 
67  // field getter/setter methods
68  virtual NodeHandle& getSrcNode();
69  virtual const NodeHandle& getSrcNode() const {return const_cast<KademliaRoutingInfoMessage*>(this)->getSrcNode();}
70  virtual void setSrcNode(const NodeHandle& srcNode);
71  virtual OverlayKey& getDestKey();
72  virtual const OverlayKey& getDestKey() const {return const_cast<KademliaRoutingInfoMessage*>(this)->getDestKey();}
73  virtual void setDestKey(const OverlayKey& destKey);
74  virtual void setNextHopsArraySize(unsigned int size);
75  virtual unsigned int getNextHopsArraySize() const;
76  virtual MarkedNodeHandle& getNextHops(unsigned int k);
77  virtual const MarkedNodeHandle& getNextHops(unsigned int k) const {return const_cast<KademliaRoutingInfoMessage*>(this)->getNextHops(k);}
78  virtual void setNextHops(unsigned int k, const MarkedNodeHandle& nextHops);
79 };
80 
81 inline void doPacking(cCommBuffer *b, KademliaRoutingInfoMessage& obj) {obj.parsimPack(b);}
82 inline void doUnpacking(cCommBuffer *b, KademliaRoutingInfoMessage& obj) {obj.parsimUnpack(b);}
83 
84 
85 #endif // _KADEMLIAMESSAGE_M_H_