X-Git-Url: https://git.llucax.com/z.facultad/75.42/plaqui.git/blobdiff_plain/00cffd5f7c35a915c09d55e6292775e9e01bdeec..a0481d50f6da9cac5efd3502c3657b3fc461ec0d:/Server/include/plaqui/server/server.h?ds=sidebyside diff --git a/Server/include/plaqui/server/server.h b/Server/include/plaqui/server/server.h index 3776cc7..1179fdc 100644 --- a/Server/include/plaqui/server/server.h +++ b/Server/include/plaqui/server/server.h @@ -31,6 +31,8 @@ #include "plaqui/server/tcpserver.h" #include "plaqui/server/controlserver.h" #include "plaqui/server/transmitter.h" +#include "plaqui/server/plant.h" +#include "plaqui/server/command.h" #include #include #include @@ -52,8 +54,8 @@ namespace Server { /// Lista de conexiones de control. typedef std::list TransmitterList; - // TODO: - // typedef std::list PlantList; + /// Lista de plantas químicas. + typedef std::list PlantList; // Atributos. @@ -62,8 +64,14 @@ namespace Server { /// Transmisiones del estado de las plantas. TransmitterList transmissions; - // TODO: - // PlantList plants; + /// Mutex para las transmisiones. + Glib::Mutex transmissions_mutex; + + // Plantas disponibles en el servidor. + PlantList plants; + + /// Mutex para las plantas. + Glib::Mutex plants_mutex; // Métodos. @@ -78,6 +86,21 @@ namespace Server { */ virtual Connection* new_connection(const sockbuf::sockdesc& sd); + /** + * Maneja el comando server/status. + */ + HTTPResponse* cmd_server_status(void) const; + + /** + * Maneja el comando connection/list. + */ + HTTPResponse* cmd_connection_list(void); + + /** + * Maneja el comando connection/stop. + */ + HTTPResponse* cmd_connection_stop(const Command& command); + public: /** @@ -121,10 +144,9 @@ namespace Server { /** * Maneja los comandos recibidos por las conexiones. - * - * \todo Hacer un tipo Command abstracto o algo así. */ - void on_control_command_received(void* command); + void on_control_command_received(const Command& command, + ControlServer* controlserver); };