/* */ #ifndef _D_SUGGEST_PIECE_MESSAGE_H_ #define _D_SUGGEST_PIECE_MESSAGE_H_ #include "SimplePeerMessage.h" class SuggestPieceMessage : public SimplePeerMessage { private: int index; // for check int pieces; char msg[9]; public: SuggestPieceMessage():SimplePeerMessage(), index(0), pieces(0) {} virtual ~SuggestPieceMessage() {} enum ID_t { ID = 13 }; 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 SuggestPieceMessage* 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_SUGGEST_PIECE_MESSAGE_H_