]> git.llucax.com Git - z.facultad/75.42/plaqui.git/blobdiff - Server/include/plaqui/server/server.h
* Se agrega el TIP de luca
[z.facultad/75.42/plaqui.git] / Server / include / plaqui / server / server.h
index 611ac232c54401cf6522d9c332cb853d0ee0ad1f..cae6f7cc7eb2de37bf2cc567dfa93d78f4d15e0a 100644 (file)
 
 #include "plaqui/server/tcpserver.h"
 #include "plaqui/server/controlserver.h"
 
 #include "plaqui/server/tcpserver.h"
 #include "plaqui/server/controlserver.h"
-#include "plaqui/server/transmitter.h"
+//#include "plaqui/server/transmitter.h"
 #include "plaqui/server/plant.h"
 #include "plaqui/server/command.h"
 #include "plaqui/server/plant.h"
 #include "plaqui/server/command.h"
+#include "plaqui/server/response.h"
 #include <socket++/sockinet.h>
 #include <string>
 #include <map>
 #include <socket++/sockinet.h>
 #include <string>
 #include <map>
@@ -81,69 +82,69 @@ namespace Server {
                        virtual Connection* new_connection(const sockbuf::sockdesc& sd);
 
                        /**
                        virtual Connection* new_connection(const sockbuf::sockdesc& sd);
 
                        /**
-                        * Maneja el comando server/status.
+                        * Maneja el comando server/info.
                         */
                         */
-                       HTTPResponse* cmd_server_status(void) const;
+                       Response* cmd_server_info(void) const;
 
                        /**
                         * Maneja el comando connection/list.
                         */
 
                        /**
                         * Maneja el comando connection/list.
                         */
-                       HTTPResponse* cmd_connection_list(void);
+                       Response* cmd_connection_list(void);
 
                        /**
                         * Maneja el comando connection/stop.
                         */
 
                        /**
                         * Maneja el comando connection/stop.
                         */
-                       HTTPResponse* cmd_connection_stop(const Command& command);
+                       Response* cmd_connection_stop(const Command& command);
 
                        /**
                         * Maneja el comando transmission/list.
                         */
 
                        /**
                         * Maneja el comando transmission/list.
                         */
-                       HTTPResponse* cmd_transmission_list(void);
+                       Response* cmd_transmission_list(void);
 
                        /**
                         * Maneja el comando transmission/start.
                         */
 
                        /**
                         * Maneja el comando transmission/start.
                         */
-                       HTTPResponse* cmd_transmission_start(const Command& command);
+                       Response* cmd_transmission_start(const Command& command);
 
                        /**
                         * Maneja el comando transmission/stop.
                         */
 
                        /**
                         * Maneja el comando transmission/stop.
                         */
-                       HTTPResponse* cmd_transmission_stop(const Command& command);
+                       Response* cmd_transmission_stop(const Command& command);
 
                        /**
                         * Maneja el comando plant/list.
                         */
 
                        /**
                         * Maneja el comando plant/list.
                         */
-                       HTTPResponse* cmd_plant_list(void);
+                       Response* cmd_plant_list(void);
 
                        /**
                         * Maneja el comando plant/get.
                         */
 
                        /**
                         * Maneja el comando plant/get.
                         */
-                       HTTPResponse* cmd_plant_get(const Command& command);
+                       Response* cmd_plant_get(const Command& command);
 
                        /**
                         * Maneja el comando plant/set.
                         */
 
                        /**
                         * Maneja el comando plant/set.
                         */
-                       HTTPResponse* cmd_plant_set(const Command& command);
+                       Response* cmd_plant_set(const Command& command);
 
                        /**
                         * Maneja el comando plant/set_frequency.
                         */
 
                        /**
                         * Maneja el comando plant/set_frequency.
                         */
-                       HTTPResponse* cmd_plant_set_frequency(const Command& command);
+                       Response* cmd_plant_set_frequency(const Command& command);
 
                        /**
                         * Maneja el comando plant/start.
                         */
 
                        /**
                         * Maneja el comando plant/start.
                         */
-                       HTTPResponse* cmd_plant_start(const Command& command);
+                       Response* cmd_plant_start(const Command& command);
 
                        /**
                         * Maneja el comando plant/stop.
                         */
 
                        /**
                         * Maneja el comando plant/stop.
                         */
-                       HTTPResponse* cmd_plant_stop(const Command& command);
+                       Response* cmd_plant_stop(const Command& command);
 
                        /**
                         * Maneja el comando plant/remove.
                         */
 
                        /**
                         * Maneja el comando plant/remove.
                         */
-                       HTTPResponse* cmd_plant_remove(const Command& command);
+                       Response* cmd_plant_remove(const Command& command);
 
                public:
 
 
                public:
 
@@ -155,11 +156,21 @@ namespace Server {
                        /**
                         * Constructor.
                         *
                        /**
                         * Constructor.
                         *
-                        * \param plant_filename Nombre del archivo con la planta a cargar.
-                        * \param port           Puerto en el cual escuchar.
+                        * \param port Puerto en el cual escuchar.
                         */
                         */
-                       Server(const std::string& plant_filename,
-                                       const Connection::Port& port = 7522) throw(sockerr);
+                       Server(const Connection::Port& port = 7522) throw(sockerr);
+
+                       /**
+                        * Agrega una planta al servidor.
+                        *
+                        * \param name     Nombre que utilizará el servidor para identificar
+                        *                 a la planta.
+                        * \param filename Nombre del archivo con la planta a cargar.
+                        * \return true si se agregó la planta, false si ya existía una
+                        *         planta con ese nombre.
+                        */
+                       bool add_plant(const std::string& name,
+                                       const std::string& filename);
 
                        /**
                         * Maneja los comandos recibidos por las conexiones.
 
                        /**
                         * Maneja los comandos recibidos por las conexiones.