]> git.llucax.com Git - z.facultad/75.42/plaqui.git/blobdiff - Server/include/plaqui/server/controlserver.h
arregle un poquito la and
[z.facultad/75.42/plaqui.git] / Server / include / plaqui / server / controlserver.h
index 8a646c659fcbf797ddb25deda7a11a88d899c30e..25d122453487eb5ee6345178ea779be8f51f3298 100644 (file)
 #ifndef PLAQUI_CONTROLSERVER_H
 #define PLAQUI_CONTROLSERVER_H
 
-#include "plaqui/server/serverconnection.h"
+#include "plaqui/server/connection.h"
+#include "plaqui/server/command.h"
+#include "plaqui/server/httpresponse.h"
 #include <socket++/sockinet.h>
+#include <sigc++/signal.h>
 
 namespace PlaQui {
 
 namespace Server {
 
        /// Conexión para recibir comandos de control para una planta.
-       class ControlServer: public ServerConnection {
+       class ControlServer: public Connection {
+
+
+               // Tipos.
+
+               public:
+
+                       /// Tipo de señal para indicar que se recibió un comando.
+                       typedef SigC::Signal1<void, const Command&> SignalCommandReceived;
+
+
+               // Atributos.
+
+               private:
+
+                       /// Señal para indicar que se recibió un comando.
+                       SignalCommandReceived command_received;
+
+
+               // Métodos.
 
                protected:
 
@@ -50,7 +72,7 @@ namespace Server {
                        /**
                         * Destructor.
                         */
-                       virtual ~ControlServer(void) {}
+                       virtual ~ControlServer(void);
 
                        /**
                         * Constructor.
@@ -59,6 +81,16 @@ namespace Server {
                         */
                        ControlServer(const sockbuf::sockdesc& sd);
 
+                       /**
+                        * Envia una respuesta.
+                        */
+                       void send(const HTTPResponse& response);
+
+                       /**
+                        * Obtiene la señal que avisa cuando se recibió un comando.
+                        */
+                       SignalCommandReceived& signal_command_received(void);
+
        };
 
 }