#ifndef _MESSAGE_PROCESSOR_H #define _MESSAGE_PROCESSOR_H #include #include "MessageContainer.h" using namespace std; class MessageProcessor { private: int lastUsedId; // map from message ids to maps from player addresses to message info map > sentMessages; // map from message ids to the time each mesage was acked map ackedMessages; unsigned long pid; public: MessageProcessor(); ~MessageProcessor(); int sendMessage(NETWORK_MSG *msg, int sock, struct sockaddr_in *dest, ofstream* outputLog = NULL); int receiveMessage(NETWORK_MSG *msg, int sock, struct sockaddr_in *dest, ofstream* outputLog = NULL); void resendUnackedMessages(int sock, ofstream* outputLog = NULL); void cleanAckedMessages(ofstream* outputLog = NULL); map >& getSentMessages(); map& getAckedMessages(); }; #endif