//
// Generated file, do not edit! Created by opp_msgc 4.1 from applications/mydht/MyDHTMessage.msg.
//

#ifndef _MYDHTMESSAGE_M_H_
#define _MYDHTMESSAGE_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 <OverlayKey.h>
#include <IPvXAddress.h>
#include <BinaryValue.h>
#include <NodeHandle.h>
#include <CommonMessages_m.h>

#define SUCCESS_L 8
#define KIND_L 32
#define ID_L 32
#define SEQNO_L 32
#define TTL_L 32
#define HOPS_L 8
#define GROUPID_L 32

#define RESULT_L(msg) (resultValuesBitLength(msg) + msg->getResultArraySize() * (KEY_L + KIND_L + ID_L + SEQNO_L + TTL_L + KEY_L + PUBKEY_L))
#define PUTCALL_L(msg) (BASECALL_L(msg) + AUTHBLOCK_L + msg->getValue().size() * sizeof(char) + (KEY_L + KIND_L + ID_L + SEQNO_L + TTL_L + KEY_L + PUBKEY_L))
#define GETMSG_L(msg) ( KEY_L + KIND_L + ID_L + sizeof(bool) + HOPS_L + GROUPID_L + sizeof(bool))
#define PUTRESPONSE_L(msg) (BASERESPONSE_L(msg) + SUCCESS_L)
#define GETRESPONSE_L(msg) (KEY_L + msg->getHashValue().size() * sizeof(char) + RESULT_L(msg) + HOPS_L)
// }}



/**
 * Class generated from <tt>applications/mydht/MyDHTMessage.msg</tt> by opp_msgc.
 * <pre>
 * packet MyDHTPutCall extends BaseCallMessage
 * {
 *     OverlayKey key;
 *     BinaryValue value;
 *     uint32_t kind;
 *     uint32_t id;
 *     int ttl;
 *     bool isModifiable;
 *     bool maintenance;
 *     NodeHandle ownerNode;
 * }
 * </pre>
 */
class MyDHTPutCall : public ::BaseCallMessage
{
  protected:
    ::OverlayKey key_var;
    ::BinaryValue value_var;
    uint32_t kind_var;
    uint32_t id_var;
    int ttl_var;
    bool isModifiable_var;
    bool maintenance_var;
    ::NodeHandle ownerNode_var;

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

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

    // field getter/setter methods
    virtual OverlayKey& getKey();
    virtual const OverlayKey& getKey() const {return const_cast<MyDHTPutCall*>(this)->getKey();}
    virtual void setKey(const OverlayKey& key_var);
    virtual BinaryValue& getValue();
    virtual const BinaryValue& getValue() const {return const_cast<MyDHTPutCall*>(this)->getValue();}
    virtual void setValue(const BinaryValue& value_var);
    virtual uint32_t getKind() const;
    virtual void setKind(uint32_t kind_var);
    virtual uint32_t getId() const;
    virtual void setId(uint32_t id_var);
    virtual int getTtl() const;
    virtual void setTtl(int ttl_var);
    virtual bool getIsModifiable() const;
    virtual void setIsModifiable(bool isModifiable_var);
    virtual bool getMaintenance() const;
    virtual void setMaintenance(bool maintenance_var);
    virtual NodeHandle& getOwnerNode();
    virtual const NodeHandle& getOwnerNode() const {return const_cast<MyDHTPutCall*>(this)->getOwnerNode();}
    virtual void setOwnerNode(const NodeHandle& ownerNode_var);
};

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

/**
 * Class generated from <tt>applications/mydht/MyDHTMessage.msg</tt> by opp_msgc.
 * <pre>
 * packet MyDHTPutResponse extends BaseResponseMessage
 * {
 *     bool success;
 * }
 * </pre>
 */
class MyDHTPutResponse : public ::BaseResponseMessage
{
  protected:
    bool success_var;

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

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

    // field getter/setter methods
    virtual bool getSuccess() const;
    virtual void setSuccess(bool success_var);
};

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

/**
 * Class generated from <tt>applications/mydht/MyDHTMessage.msg</tt> by opp_msgc.
 * <pre>
 * packet MyDHTGetMessage
 * {
 *     OverlayKey key;
 *     uint32_t kind;
 *     uint32_t id;
 * 	int groupId;
 *     bool isHash;
 * 	unsigned int nonce;
 * 	bool cache;						
 *     NodeHandle cRequesters[];		
 * }
 * </pre>
 */
class MyDHTGetMessage : public ::cPacket
{
  protected:
    ::OverlayKey key_var;
    uint32_t kind_var;
    uint32_t id_var;
    int groupId_var;
    bool isHash_var;
    unsigned int nonce_var;
    bool cache_var;
    ::NodeHandle *cRequesters_var; // array ptr
    unsigned int cRequesters_arraysize;

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

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

    // field getter/setter methods
    virtual OverlayKey& getKey();
    virtual const OverlayKey& getKey() const {return const_cast<MyDHTGetMessage*>(this)->getKey();}
    virtual void setKey(const OverlayKey& key_var);
    virtual uint32_t getKind() const;
    virtual void setKind(uint32_t kind_var);
    virtual uint32_t getId() const;
    virtual void setId(uint32_t id_var);
    virtual int getGroupId() const;
    virtual void setGroupId(int groupId_var);
    virtual bool getIsHash() const;
    virtual void setIsHash(bool isHash_var);
    virtual unsigned int getNonce() const;
    virtual void setNonce(unsigned int nonce_var);
    virtual bool getCache() const;
    virtual void setCache(bool cache_var);
    virtual void setCRequestersArraySize(unsigned int size);
    virtual unsigned int getCRequestersArraySize() const;
    virtual NodeHandle& getCRequesters(unsigned int k);
    virtual const NodeHandle& getCRequesters(unsigned int k) const {return const_cast<MyDHTGetMessage*>(this)->getCRequesters(k);}
    virtual void setCRequesters(unsigned int k, const NodeHandle& cRequesters_var);
};

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

/**
 * Class generated from <tt>applications/mydht/MyDHTMessage.msg</tt> by opp_msgc.
 * <pre>
 * packet MyDHTGetResMessage
 * {
 *     OverlayKey key;
 *     BinaryValue hashValue;    
 *     bool isHash;
 *     DhtDumpEntry result[];
 * 	unsigned int nonce;
 * 	uint32_t hopCount;
 * 	simtime_t rtt;
 * }
 * </pre>
 */
class MyDHTGetResMessage : public ::cPacket
{
  protected:
    ::OverlayKey key_var;
    ::BinaryValue hashValue_var;
    bool isHash_var;
    ::DhtDumpEntry *result_var; // array ptr
    unsigned int result_arraysize;
    unsigned int nonce_var;
    uint32_t hopCount_var;
    simtime_t rtt_var;

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

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

    // field getter/setter methods
    virtual OverlayKey& getKey();
    virtual const OverlayKey& getKey() const {return const_cast<MyDHTGetResMessage*>(this)->getKey();}
    virtual void setKey(const OverlayKey& key_var);
    virtual BinaryValue& getHashValue();
    virtual const BinaryValue& getHashValue() const {return const_cast<MyDHTGetResMessage*>(this)->getHashValue();}
    virtual void setHashValue(const BinaryValue& hashValue_var);
    virtual bool getIsHash() const;
    virtual void setIsHash(bool isHash_var);
    virtual void setResultArraySize(unsigned int size);
    virtual unsigned int getResultArraySize() const;
    virtual DhtDumpEntry& getResult(unsigned int k);
    virtual const DhtDumpEntry& getResult(unsigned int k) const {return const_cast<MyDHTGetResMessage*>(this)->getResult(k);}
    virtual void setResult(unsigned int k, const DhtDumpEntry& result_var);
    virtual unsigned int getNonce() const;
    virtual void setNonce(unsigned int nonce_var);
    virtual uint32_t getHopCount() const;
    virtual void setHopCount(uint32_t hopCount_var);
    virtual simtime_t getRtt() const;
    virtual void setRtt(simtime_t rtt_var);
};

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

/**
 * Class generated from <tt>applications/mydht/MyDHTMessage.msg</tt> by opp_msgc.
 * <pre>
 * message MyDHTTtlTimer
 * {
 *     OverlayKey key;
 *     uint32_t kind;
 *     uint32_t id;
 * }
 * </pre>
 */
class MyDHTTtlTimer : public ::cMessage
{
  protected:
    ::OverlayKey key_var;
    uint32_t kind_var;
    uint32_t id_var;

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

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

    // field getter/setter methods
    virtual OverlayKey& getKey();
    virtual const OverlayKey& getKey() const {return const_cast<MyDHTTtlTimer*>(this)->getKey();}
    virtual void setKey(const OverlayKey& key_var);
    virtual uint32_t getKind() const;
    virtual void setKind(uint32_t kind_var);
    virtual uint32_t getId() const;
    virtual void setId(uint32_t id_var);
};

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


#endif // _MYDHTMESSAGE_M_H_
