/* * rmpaClientProtocol.h * * Gouverneur Th. - Cuisinier Gi. * * Declare the protocol RMPA and * his implementation * */ #ifndef RMPA_CLIENT_PROTOCOL_H #define RMPA_CLIENT_PROTOCOL_H #include #include #include /* * this class is a sort-of "storing class" * containing the different method, called * when a message is received from network * by the client sideo. * * Also, this class cannot be in the librairy, * indeed, this class make the link between * the parser (general), and the protocol * that is implemented in THIS client/server. * * this class can also be used internally, * for storing somes "global vars" that should * be accessible from protocol function * such as the state of authentification of * the client * */ class RMPAClientProtocol { public: static bool waiting; /* char-oriented */ static void cmdLClients (Message *); static void cmdSusps (Message *); static void cmdStops (Message *); /* bytes-oriented */ /* NOT YET IMPLEMENTED */ /* protocol-exceptions */ struct exWantExit : Exception { exWantExit() : Exception("Userinput: Asked to exit program.") {} ; }; struct exUnknownOpt : Exception { exUnknownOpt() : Exception("Unknown option from menu..") {} ; }; /* menu actions */ static bool execOption(int, Sock_Client *); /* returns: if we should wait for an response or not. */ static bool execLClients (Sock_Client *); static bool execSusps (Sock_Client *); static bool execStops (Sock_Client *); }; #endif