From: Leandro Lucarella Date: Sun, 23 Nov 2003 22:15:10 +0000 (+0000) Subject: Se ponen mas simples algunos SigC::bind() :) X-Git-Tag: svn_import~192 X-Git-Url: https://git.llucax.com/z.facultad/75.42/plaqui.git/commitdiff_plain/49850f467dae860e12c7851a2f8a79132f87721e?ds=sidebyside Se ponen mas simples algunos SigC::bind() :) --- diff --git a/Server/src/plant.cpp b/Server/src/plant.cpp index 970fbab..5704a88 100644 --- a/Server/src/plant.cpp +++ b/Server/src/plant.cpp @@ -139,7 +139,7 @@ bool Plant::transmission_start(string& host, Connection::Port& port) { // return false; } transmissions.push_back(trans); - trans->signal_finished().connect(SigC::bind( + trans->signal_finished().connect(SigC::bind( SigC::slot_class(*this, &Plant::on_transmission_finished), trans)); trans->run(); diff --git a/Server/src/receiver.cpp b/Server/src/receiver.cpp index ad42cfe..9133f85 100644 --- a/Server/src/receiver.cpp +++ b/Server/src/receiver.cpp @@ -55,7 +55,6 @@ Receiver::Receiver(const Connection::Port& port, const string& host) << ": port = " << port << " | host = " << host << endl; #endif // DEBUG - //socket->bind(port); socket->bind(host.c_str(), port); } diff --git a/Server/src/runnable.cpp b/Server/src/runnable.cpp index 9587fd9..6d000ce 100644 --- a/Server/src/runnable.cpp +++ b/Server/src/runnable.cpp @@ -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( - SigC::bind(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(); diff --git a/Server/src/server.cpp b/Server/src/server.cpp index b0d40d3..32b23e5 100644 --- a/Server/src/server.cpp +++ b/Server/src/server.cpp @@ -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); - plants["default"]->signal_finished().connect( - SigC::bind( - 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(); } @@ -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. - connection->signal_command_received().connect( - SigC::bind( - 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; } diff --git a/Server/src/tcpserver.cpp b/Server/src/tcpserver.cpp index d85490c..61d3e11 100644 --- a/Server/src/tcpserver.cpp +++ b/Server/src/tcpserver.cpp @@ -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. - connection->signal_finished().connect( - SigC::bind( - 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(); } }