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

#ifndef _DHTMESSAGE_M_H_
#define _DHTMESSAGE_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 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 GETCALL_L(msg) (BASECALL_L(msg) + KEY_L + KIND_L + ID_L + sizeof(bool))
#define PUTRESPONSE_L(msg) (BASERESPONSE_L(msg) + SUCCESS_L)
#define GETRESPONSE_L(msg) (BASERESPONSE_L(msg) + KEY_L + msg->getHashValue().size() * sizeof(char) \
                            + RESULT_L(msg))
// }}



/**
 * Class generated from <tt>applications/dht/DHTMessage.msg</tt> by opp_msgc.
 * <pre>
 * packet DHTPutCall extends BaseCallMessage
 * {
 *     OverlayKey key;
 *     BinaryValue value;
 *     uint32_t kind;
 *     uint32_t id;
 *     int ttl;
 *     bool isModifiable;
 *     bool maintenance;
 *     NodeHandle ownerNode;
 * }
 * </pre>
 */
class DHTPutCall : 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 DHTPutCall&);

  public:
    DHTPutCall(const char *name=NULL, int kind=0);
    DHTPutCall(const DHTPutCall& other);
    virtual ~DHTPutCall();
    DHTPutCall& operator=(const DHTPutCall& other);
    virtual DHTPutCall *dup() const {return new DHTPutCall(*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<DHTPutCall*>(this)->getKey();}
    virtual void setKey(const OverlayKey& key_var);
    virtual BinaryValue& getValue();
    virtual const BinaryValue& getValue() const {return const_cast<DHTPutCall*>(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<DHTPutCall*>(this)->getOwnerNode();}
    virtual void setOwnerNode(const NodeHandle& ownerNode_var);
};

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

/**
 * Class generated from <tt>applications/dht/DHTMessage.msg</tt> by opp_msgc.
 * <pre>
 * packet DHTGetCall extends BaseCallMessage
 * {
 *     OverlayKey key;
 *     uint32_t kind;
 *     uint32_t id;
 *     bool isHash;
 * }
 * </pre>
 */
class DHTGetCall : public ::BaseCallMessage
{
  protected:
    ::OverlayKey key_var;
    uint32_t kind_var;
    uint32_t id_var;
    bool isHash_var;

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

  public:
    DHTGetCall(const char *name=NULL, int kind=0);
    DHTGetCall(const DHTGetCall& other);
    virtual ~DHTGetCall();
    DHTGetCall& operator=(const DHTGetCall& other);
    virtual DHTGetCall *dup() const {return new DHTGetCall(*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<DHTGetCall*>(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 bool getIsHash() const;
    virtual void setIsHash(bool isHash_var);
};

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

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

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

  public:
    DHTPutResponse(const char *name=NULL, int kind=0);
    DHTPutResponse(const DHTPutResponse& other);
    virtual ~DHTPutResponse();
    DHTPutResponse& operator=(const DHTPutResponse& other);
    virtual DHTPutResponse *dup() const {return new DHTPutResponse(*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, DHTPutResponse& obj) {obj.parsimPack(b);}
inline void doUnpacking(cCommBuffer *b, DHTPutResponse& obj) {obj.parsimUnpack(b);}

/**
 * Class generated from <tt>applications/dht/DHTMessage.msg</tt> by opp_msgc.
 * <pre>
 * packet DHTGetResponse extends BaseResponseMessage
 * {
 *     OverlayKey key;
 *     BinaryValue hashValue;    
 *     bool isHash;
 *     DhtDumpEntry result[];
 * }
 * </pre>
 */
class DHTGetResponse : public ::BaseResponseMessage
{
  protected:
    ::OverlayKey key_var;
    ::BinaryValue hashValue_var;
    bool isHash_var;
    ::DhtDumpEntry *result_var; // array ptr
    unsigned int result_arraysize;

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

  public:
    DHTGetResponse(const char *name=NULL, int kind=0);
    DHTGetResponse(const DHTGetResponse& other);
    virtual ~DHTGetResponse();
    DHTGetResponse& operator=(const DHTGetResponse& other);
    virtual DHTGetResponse *dup() const {return new DHTGetResponse(*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<DHTGetResponse*>(this)->getKey();}
    virtual void setKey(const OverlayKey& key_var);
    virtual BinaryValue& getHashValue();
    virtual const BinaryValue& getHashValue() const {return const_cast<DHTGetResponse*>(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<DHTGetResponse*>(this)->getResult(k);}
    virtual void setResult(unsigned int k, const DhtDumpEntry& result_var);
};

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

/**
 * Class generated from <tt>applications/dht/DHTMessage.msg</tt> by opp_msgc.
 * <pre>
 * message DHTTtlTimer
 * {
 *     OverlayKey key;
 *     uint32_t kind;
 *     uint32_t id;
 * }
 * </pre>
 */
class DHTTtlTimer : 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 DHTTtlTimer&);

  public:
    DHTTtlTimer(const char *name=NULL, int kind=0);
    DHTTtlTimer(const DHTTtlTimer& other);
    virtual ~DHTTtlTimer();
    DHTTtlTimer& operator=(const DHTTtlTimer& other);
    virtual DHTTtlTimer *dup() const {return new DHTTtlTimer(*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<DHTTtlTimer*>(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, DHTTtlTimer& obj) {obj.parsimPack(b);}
inline void doUnpacking(cCommBuffer *b, DHTTtlTimer& obj) {obj.parsimUnpack(b);}


#endif // _DHTMESSAGE_M_H_
