]> git.llucax.com Git - z.facultad/75.42/plaqui.git/blobdiff - Server/include/plaqui/server/controlserver.h
* Se agrega un Tanque al ejemplo, y ANDA!!!!
[z.facultad/75.42/plaqui.git] / Server / include / plaqui / server / controlserver.h
index 99f8dead3e641de46438f98d2a9ade21afd9472f..25d122453487eb5ee6345178ea779be8f51f3298 100644 (file)
 #define PLAQUI_CONTROLSERVER_H
 
 #include "plaqui/server/connection.h"
 #define PLAQUI_CONTROLSERVER_H
 
 #include "plaqui/server/connection.h"
+#include "plaqui/server/command.h"
+#include "plaqui/server/httpresponse.h"
 #include <socket++/sockinet.h>
 #include <socket++/sockinet.h>
+#include <sigc++/signal.h>
 
 
-namespace Plaqui {
+namespace PlaQui {
+
+namespace Server {
 
        /// Conexión para recibir comandos de control para una planta.
        class ControlServer: public Connection {
 
 
        /// Conexión para recibir comandos de control para una planta.
        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:
 
                        /**
                protected:
 
                        /**
@@ -48,7 +72,7 @@ namespace Plaqui {
                        /**
                         * Destructor.
                         */
                        /**
                         * Destructor.
                         */
-                       virtual ~ControlServer(void) {}
+                       virtual ~ControlServer(void);
 
                        /**
                         * Constructor.
 
                        /**
                         * Constructor.
@@ -57,9 +81,20 @@ namespace Plaqui {
                         */
                        ControlServer(const sockbuf::sockdesc& sd);
 
                         */
                        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);
+
        };
 
 }
 
        };
 
 }
 
+}
 
 #endif // PLAQUI_CONTROLSERVER_H
 
 #endif // PLAQUI_CONTROLSERVER_H