/* */ #ifndef _D_ALLOWED_FAST_MESSAGE_H_ #define _D_ALLOWED_FAST_MESSAGE_H_ #include "SimplePeerMessage.h" class AllowedFastMessage : public SimplePeerMessage { private: int index; // for check int pieces; char msg[9]; protected: virtual void onSendComplete(); public: AllowedFastMessage(int index = 0) :SimplePeerMessage(), index(index), pieces(0) {} virtual ~AllowedFastMessage() {} enum ID_t { ID = 17 }; void setIndex(int index) { this->index = index; } int getIndex() const { return index; } void setPieces(int pieces) { this->pieces = pieces; } int getPieces() const { return pieces;} static AllowedFastMessage* create(const char* data, int dataLength); virtual int getId() const { return ID; } virtual void receivedAction(); virtual const char* getMessage(); virtual int getMessageLength(); virtual void check() const; virtual string toString() const; }; #endif // _D_ALLOWED_FAST_MESSAGE_H_