From fc3c50063f659584b2145addab8236a479a031b7 Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Mon, 18 May 2009 19:53:51 +0200 Subject: Von sigc++ auf boost-signals migriert --- src/Client/CommandManager.h | 6 +++--- src/Client/CommandParser.cpp | 21 +++++++++++---------- src/Client/InformationManager.cpp | 6 +++--- src/Client/Makefile.in | 4 ++-- src/Client/Requests/Makefile.in | 4 ++-- 5 files changed, 21 insertions(+), 20 deletions(-) (limited to 'src/Client') diff --git a/src/Client/CommandManager.h b/src/Client/CommandManager.h index f1689b1..7635542 100644 --- a/src/Client/CommandManager.h +++ b/src/Client/CommandManager.h @@ -20,7 +20,7 @@ #ifndef MAD_CLIENT_COMMANDMANAGER_H_ #define MAD_CLIENT_COMMANDMANAGER_H_ -#include +#include namespace Mad { @@ -39,7 +39,7 @@ class CommandManager { unsigned int activeRequests; - sigc::signal finished; + boost::signal0 finished; bool disconnect; @@ -71,7 +71,7 @@ class CommandManager { bool requestsActive() {return (activeRequests > 0);} bool willDisconnect() {return disconnect;} - sigc::signal signalFinished() const {return finished;} + boost::signal0& signalFinished() {return finished;} }; } diff --git a/src/Client/CommandParser.cpp b/src/Client/CommandParser.cpp index 1b40046..78b3570 100644 --- a/src/Client/CommandParser.cpp +++ b/src/Client/CommandParser.cpp @@ -33,7 +33,8 @@ #include #include -#include + +#include namespace Mad { namespace Client { @@ -111,9 +112,9 @@ std::map CommandParser::parseHostList(const std:: void CommandParser::fsinfoCommand(const std::vector &args) { if(args.size() == 1) - Common::RequestManager::get()->sendRequest(connection, sigc::mem_fun(CommandManager::get(), &CommandManager::fsInfoRequestFinished)); + Common::RequestManager::get()->sendRequest(connection, boost::bind(&CommandManager::fsInfoRequestFinished, CommandManager::get(), _1)); else if(args.size() == 2) - Common::RequestManager::get()->sendRequest(connection, sigc::mem_fun(CommandManager::get(), &CommandManager::daemonFSInfoRequestFinished), args[1]); + Common::RequestManager::get()->sendRequest(connection, boost::bind(&CommandManager::daemonFSInfoRequestFinished, CommandManager::get(), _1), args[1]); else { Common::Logger::logf(Common::Logger::ERROR, "%s: Too many arguments.", args[0].c_str()); printUsage("fsinfo"); @@ -215,7 +216,7 @@ void CommandParser::rebootCommand(const std::vector &args) { for(std::map::iterator host = hosts.begin(); host != hosts.end(); ++host) { Common::RequestManager::get()->sendRequest(connection, - sigc::mem_fun(CommandManager::get(), &CommandManager::daemonCommandRequestFinished), host->first, true + boost::bind(&CommandManager::daemonCommandRequestFinished, CommandManager::get(), _1), host->first, true ); ++CommandManager::get()->activeRequests; @@ -233,7 +234,7 @@ void CommandParser::shutdownCommand(const std::vector &args) { for(std::map::iterator host = hosts.begin(); host != hosts.end(); ++host) { Common::RequestManager::get()->sendRequest(connection, - sigc::mem_fun(CommandManager::get(), &CommandManager::daemonCommandRequestFinished), host->first, false + boost::bind(&CommandManager::daemonCommandRequestFinished, CommandManager::get(), _1), host->first, false ); ++CommandManager::get()->activeRequests; @@ -243,10 +244,10 @@ void CommandParser::shutdownCommand(const std::vector &args) { void CommandParser::statusCommand(const std::vector &args) { if(args.size() == 1) Common::RequestManager::get()->sendRequest(connection, - sigc::mem_fun(CommandManager::get(), &CommandManager::statusRequestFinished)); + boost::bind(&CommandManager::statusRequestFinished, CommandManager::get(), _1)); else if(args.size() == 2) Common::RequestManager::get()->sendRequest(connection, - sigc::mem_fun(CommandManager::get(), &CommandManager::daemonStatusRequestFinished), args[1]); + boost::bind(&CommandManager::daemonStatusRequestFinished, CommandManager::get(), _1), args[1]); else { Common::Logger::logf(Common::Logger::ERROR, "%s: Too many arguments.", args[0].c_str()); printUsage("status"); @@ -279,21 +280,21 @@ void CommandParser::userInfoCommand(const std::vector &args) { ++CommandManager::get()->activeRequests; Common::RequestManager::get()->sendRequest(connection, - sigc::mem_fun(CommandManager::get(), &CommandManager::userInfoRequestFinished), uid); + boost::bind(&CommandManager::userInfoRequestFinished, CommandManager::get(), _1), uid); } void CommandParser::listUsersCommand(const std::vector&) { ++CommandManager::get()->activeRequests; Common::RequestManager::get()->sendRequest(connection, - sigc::mem_fun(CommandManager::get(), &CommandManager::userListRequestFinished)); + boost::bind(&CommandManager::userListRequestFinished, CommandManager::get(), _1)); } void CommandParser::exitCommand(const std::vector&) { ++CommandManager::get()->activeRequests; Common::RequestManager::get()->sendRequest(connection, - sigc::mem_fun(CommandManager::get(), &CommandManager::disconnectRequestFinished)); + boost::bind(&CommandManager::disconnectRequestFinished, CommandManager::get(), _1)); } bool CommandParser::parse(const std::string &cmd) { diff --git a/src/Client/InformationManager.cpp b/src/Client/InformationManager.cpp index 6c36495..f1627f4 100644 --- a/src/Client/InformationManager.cpp +++ b/src/Client/InformationManager.cpp @@ -39,7 +39,7 @@ void InformationManager::DaemonStateUpdateRequestHandler::handlePacket(const Com sendPacket(ret); - signalFinished().emit(); + signalFinished()(); return; } @@ -55,7 +55,7 @@ void InformationManager::DaemonStateUpdateRequestHandler::handlePacket(const Com ret.setType("OK"); sendPacket(ret); - signalFinished().emit(); + signalFinished()(); } @@ -72,7 +72,7 @@ void InformationManager::updateDaemonList(Common::Connection *con) { return; Common::RequestManager::get()->sendRequest(con, - sigc::mem_fun(this, &InformationManager::daemonListRequestFinished)); + boost::bind(&InformationManager::daemonListRequestFinished, this, _1)); updating = true; } diff --git a/src/Client/Makefile.in b/src/Client/Makefile.in index 94a059f..29cec75 100644 --- a/src/Client/Makefile.in +++ b/src/Client/Makefile.in @@ -39,6 +39,7 @@ DIST_COMMON = $(noinst_HEADERS) $(srcdir)/Makefile.am \ ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/argz.m4 \ $(top_srcdir)/m4/ax_boost_base.m4 \ + $(top_srcdir)/m4/ax_boost_signals.m4 \ $(top_srcdir)/m4/ax_boost_thread.m4 \ $(top_srcdir)/m4/ax_lib_mysql.m4 $(top_srcdir)/m4/libtool.m4 \ $(top_srcdir)/m4/ltdl.m4 $(top_srcdir)/m4/ltoptions.m4 \ @@ -93,6 +94,7 @@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BOOST_CPPFLAGS = @BOOST_CPPFLAGS@ BOOST_LDFLAGS = @BOOST_LDFLAGS@ +BOOST_SIGNALS_LIB = @BOOST_SIGNALS_LIB@ BOOST_THREAD_LIB = @BOOST_THREAD_LIB@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ @@ -224,8 +226,6 @@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ -sigc_CFLAGS = @sigc_CFLAGS@ -sigc_LIBS = @sigc_LIBS@ srcdir = @srcdir@ sys_symbol_underscore = @sys_symbol_underscore@ sysconfdir = @sysconfdir@ diff --git a/src/Client/Requests/Makefile.in b/src/Client/Requests/Makefile.in index 820cb4d..01665de 100644 --- a/src/Client/Requests/Makefile.in +++ b/src/Client/Requests/Makefile.in @@ -39,6 +39,7 @@ DIST_COMMON = $(noinst_HEADERS) $(srcdir)/Makefile.am \ ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/argz.m4 \ $(top_srcdir)/m4/ax_boost_base.m4 \ + $(top_srcdir)/m4/ax_boost_signals.m4 \ $(top_srcdir)/m4/ax_boost_thread.m4 \ $(top_srcdir)/m4/ax_lib_mysql.m4 $(top_srcdir)/m4/libtool.m4 \ $(top_srcdir)/m4/ltdl.m4 $(top_srcdir)/m4/ltoptions.m4 \ @@ -83,6 +84,7 @@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BOOST_CPPFLAGS = @BOOST_CPPFLAGS@ BOOST_LDFLAGS = @BOOST_LDFLAGS@ +BOOST_SIGNALS_LIB = @BOOST_SIGNALS_LIB@ BOOST_THREAD_LIB = @BOOST_THREAD_LIB@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ @@ -214,8 +216,6 @@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ -sigc_CFLAGS = @sigc_CFLAGS@ -sigc_LIBS = @sigc_LIBS@ srcdir = @srcdir@ sys_symbol_underscore = @sys_symbol_underscore@ sysconfdir = @sysconfdir@ -- cgit v1.2.3