/* */ #ifndef _D_PEER_MESSAGE_H_ #define _D_PEER_MESSAGE_H_ #include "common.h" #include "Logger.h" #include "Peer.h" #include class PeerInteraction; class PeerMessage { protected: bool inProgress; int cuid; Peer* peer; PeerInteraction* peerInteraction; const Logger* logger; public: PeerMessage(); virtual ~PeerMessage() {} bool isInProgress() const { return inProgress; } int getCuid() const { return cuid; } void setCuid(int cuid) { this->cuid = cuid; } Peer* getPeer() const { return this->peer; } void setPeer(Peer* peer) { this->peer = peer; } PeerInteraction* getPeerInteraction() const { return peerInteraction; } void setPeerInteraction(PeerInteraction* peerInteraction) { this->peerInteraction = peerInteraction; } virtual int getId() const = 0; virtual void receivedAction() = 0; virtual void send() = 0; virtual void check() const {} virtual string toString() const = 0; }; #endif // _D_PEER_MESSAGE_H_