/* */ #ifndef _D_BT_REJECT_MESSAGE_H_ #define _D_BT_REJECT_MESSAGE_H_ #include "SimpleBtMessage.h" namespace aria2 { class BtRejectMessage; typedef SharedHandle BtRejectMessageHandle; class BtRejectMessage : public SimpleBtMessage { private: size_t index; uint32_t begin; size_t length; unsigned char* msg; static size_t MESSAGE_LENGTH; public: BtRejectMessage(size_t index = 0, uint32_t begin = 0, size_t length = 0) :index(index), begin(begin), length(length), msg(0) {} virtual ~BtRejectMessage() { delete [] msg; } static const uint8_t ID = 16; size_t getIndex() const { return index; } void setIndex(size_t index) { this->index = index; } uint32_t getBegin() const { return begin; } void setBegin(uint32_t begin) { this->begin = begin; } size_t getLength() const { return length; } void setLength(size_t length) { this->length = length; } static BtRejectMessageHandle create(const unsigned char* data, size_t dataLength); virtual uint8_t getId() { return ID; } virtual void doReceivedAction(); virtual const unsigned char* getMessage(); virtual size_t getMessageLength(); virtual std::string toString() const; }; } // namespace aria2 #endif // _D_BT_REJECT_MESSAGE_H_