//
// Generated file, do not edit! Created by opp_msgc 4.1 from overlay/kademlia/KademliaMessage.msg.
//

#ifndef _KADEMLIAMESSAGE_M_H_
#define _KADEMLIAMESSAGE_M_H_

#include <omnetpp.h>

// opp_msgc version check
#define MSGC_VERSION 0x0401
#if (MSGC_VERSION!=OMNETPP_VERSION)
#    error Version mismatch! Probably this file was generated by an earlier version of opp_msgc: 'make clean' should help.
#endif

// cplusplus {{
#include <NodeHandle.h>
#include <OverlayKey.h>
#include <CommonMessages_m.h>

#define KADEMLIAROUTINGINFO_L(msg) (BASEOVERLAY_L(msg) + NODEHANDLE_L + \
                                    KEY_L + \
                                    msg->getNextHopsArraySize() * NODEHANDLE_L)
// }}



/**
 * Class generated from <tt>overlay/kademlia/KademliaMessage.msg</tt> by opp_msgc.
 * <pre>
 * packet KademliaRoutingInfoMessage extends BaseOverlayMessage
 * {
 *         NodeHandle srcNode;
 *         OverlayKey destKey = OverlayKey::UNSPECIFIED_KEY;
 *         NodeHandle nextHops[];
 * }
 * </pre>
 */
class KademliaRoutingInfoMessage : public ::BaseOverlayMessage
{
  protected:
    ::NodeHandle srcNode_var;
    ::OverlayKey destKey_var;
    ::NodeHandle *nextHops_var; // array ptr
    unsigned int nextHops_arraysize;

    // protected and unimplemented operator==(), to prevent accidental usage
    bool operator==(const KademliaRoutingInfoMessage&);

  public:
    KademliaRoutingInfoMessage(const char *name=NULL, int kind=0);
    KademliaRoutingInfoMessage(const KademliaRoutingInfoMessage& other);
    virtual ~KademliaRoutingInfoMessage();
    KademliaRoutingInfoMessage& operator=(const KademliaRoutingInfoMessage& other);
    virtual KademliaRoutingInfoMessage *dup() const {return new KademliaRoutingInfoMessage(*this);}
    virtual void parsimPack(cCommBuffer *b);
    virtual void parsimUnpack(cCommBuffer *b);

    // field getter/setter methods
    virtual NodeHandle& getSrcNode();
    virtual const NodeHandle& getSrcNode() const {return const_cast<KademliaRoutingInfoMessage*>(this)->getSrcNode();}
    virtual void setSrcNode(const NodeHandle& srcNode_var);
    virtual OverlayKey& getDestKey();
    virtual const OverlayKey& getDestKey() const {return const_cast<KademliaRoutingInfoMessage*>(this)->getDestKey();}
    virtual void setDestKey(const OverlayKey& destKey_var);
    virtual void setNextHopsArraySize(unsigned int size);
    virtual unsigned int getNextHopsArraySize() const;
    virtual NodeHandle& getNextHops(unsigned int k);
    virtual const NodeHandle& getNextHops(unsigned int k) const {return const_cast<KademliaRoutingInfoMessage*>(this)->getNextHops(k);}
    virtual void setNextHops(unsigned int k, const NodeHandle& nextHops_var);
};

inline void doPacking(cCommBuffer *b, KademliaRoutingInfoMessage& obj) {obj.parsimPack(b);}
inline void doUnpacking(cCommBuffer *b, KademliaRoutingInfoMessage& obj) {obj.parsimUnpack(b);}


#endif // _KADEMLIAMESSAGE_M_H_
