]> git.llucax.com Git - z.facultad/75.42/plaqui.git/commitdiff
Se ponen mas simples algunos SigC::bind() :)
authorLeandro Lucarella <llucax@gmail.com>
Sun, 23 Nov 2003 22:15:10 +0000 (22:15 +0000)
committerLeandro Lucarella <llucax@gmail.com>
Sun, 23 Nov 2003 22:15:10 +0000 (22:15 +0000)
Server/src/plant.cpp
Server/src/receiver.cpp
Server/src/runnable.cpp
Server/src/server.cpp
Server/src/tcpserver.cpp

index 970fbabbb2fd2be308659ff40e4bf177584c0882..5704a88ddb16fefb9db741fdd6b3c6a9a201779c 100644 (file)
@@ -139,7 +139,7 @@ bool Plant::transmission_start(string& host, Connection::Port& port) {
 //             return false;
        }
        transmissions.push_back(trans);
 //             return false;
        }
        transmissions.push_back(trans);
-       trans->signal_finished().connect(SigC::bind<Transmitter*>(
+       trans->signal_finished().connect(SigC::bind(
                                SigC::slot_class(*this, &Plant::on_transmission_finished),
                                trans));
        trans->run();
                                SigC::slot_class(*this, &Plant::on_transmission_finished),
                                trans));
        trans->run();
index ad42cfe26fcc53c12a34c82b357a2891493ed275..9133f85d4ed000bc1ab7e4d110861c8cd2aa363f 100644 (file)
@@ -55,7 +55,6 @@ Receiver::Receiver(const Connection::Port& port, const string& host)
                << ": port = " << port
                << " | host = " << host << endl;
 #endif // DEBUG
                << ": port = " << port
                << " | host = " << host << endl;
 #endif // DEBUG
-       //socket->bind(port);
        socket->bind(host.c_str(), port);
 }
 
        socket->bind(host.c_str(), port);
 }
 
index 9587fd9e6691088d5e815a2dedd666fdb8850630..6d000ce9c6d68f6adc47b271680ce537619222ee 100644 (file)
@@ -74,8 +74,7 @@ void Runnable::run(bool detach) {
                // Corremos el thread en una funcion estática para poder destruirlo al
                // finalizar, pasandole el puntero al objeto.
                _thread = Glib::Thread::create(
                // Corremos el thread en una funcion estática para poder destruirlo al
                // finalizar, pasandole el puntero al objeto.
                _thread = Glib::Thread::create(
-                               SigC::bind<Runnable*>(SigC::slot(&Runnable::static_run), this),
-                               false);
+                               SigC::bind(SigC::slot(&Runnable::static_run), this), false);
        // Si no corremos la tarea normalmente.
        } else {
                real_run();
        // Si no corremos la tarea normalmente.
        } else {
                real_run();
index b0d40d31b23e27a2d99a9a5e954de9cc9f35246a..32b23e5daa7d68b59e32ee854d8641e5d9447bb8 100644 (file)
@@ -73,10 +73,9 @@ Server::Server(const string& plant_filename, const Connection::Port& port)
        // FIXME - hacer que se puedan cargar mas plantas bien.
        Glib::Mutex::Lock lock(plants_mutex);
        plants["default"] = new Plant(plant_filename);
        // FIXME - hacer que se puedan cargar mas plantas bien.
        Glib::Mutex::Lock lock(plants_mutex);
        plants["default"] = new Plant(plant_filename);
-       plants["default"]->signal_finished().connect(
-                       SigC::bind<const char*>(
-                               SigC::slot_class(*this, &Server::on_plant_finished),
-                               "default"));
+       plants["default"]->signal_finished().connect(SigC::bind(
+                       SigC::slot_class(*this, &Server::on_plant_finished),
+                       "default"));
        plants["default"]->run();
 }
 
        plants["default"]->run();
 }
 
@@ -88,10 +87,9 @@ Connection* Server::new_connection(const sockbuf::sockdesc& sd) {
 #endif // DEBUG
        ControlServer* connection = new ControlServer(sd);
        // TODO verificar si el new se hace bien? no creo.
 #endif // DEBUG
        ControlServer* connection = new ControlServer(sd);
        // TODO verificar si el new se hace bien? no creo.
-       connection->signal_command_received().connect(
-                       SigC::bind<ControlServer*>(
-                               SigC::slot_class(*this, &Server::on_control_command_received),
-                               connection));
+       connection->signal_command_received().connect(SigC::bind(
+                       SigC::slot_class(*this, &Server::on_control_command_received),
+                       connection));
        // TODO: 
        return connection;
 }
        // TODO: 
        return connection;
 }
index d85490c78bce214e1edcf45b7f75b4bc0b24adab..61d3e11753e7413ea10cca0a948f25e1a518a220 100644 (file)
@@ -156,11 +156,9 @@ void TCPServer::real_run(void) throw() {
                // XXX connections_mutex.unlock(); // Si pongo el mutex antes del run(),
                //                                    muere.
                // Conecto la señal para cuando termina una conexión, borrarla.
                // XXX connections_mutex.unlock(); // Si pongo el mutex antes del run(),
                //                                    muere.
                // Conecto la señal para cuando termina una conexión, borrarla.
-               connection->signal_finished().connect(
-                               SigC::bind<Connection*>(
-                                       SigC::slot_class(*this,
-                                               &TCPServer::on_connection_finished),
-                                       connection));
+               connection->signal_finished().connect(SigC::bind(
+                               SigC::slot_class(*this, &TCPServer::on_connection_finished),
+                               connection));
                connection->run();
        }
 }
                connection->run();
        }
 }