summaryrefslogtreecommitdiffstats
path: root/src/Common
diff options
context:
space:
mode:
authorMatthias Schiffer <matthias@gamezock.de>2009-05-18 19:53:51 +0200
committerMatthias Schiffer <matthias@gamezock.de>2009-05-18 19:53:51 +0200
commitfc3c50063f659584b2145addab8236a479a031b7 (patch)
tree0aa7057cb9fa7523ace98e0776d46609de58954e /src/Common
parenta3e566c4d3631076e29f3651554603184b6351a7 (diff)
downloadmad-fc3c50063f659584b2145addab8236a479a031b7.tar
mad-fc3c50063f659584b2145addab8236a479a031b7.zip
Von sigc++ auf boost-signals migriert
Diffstat (limited to 'src/Common')
-rw-r--r--src/Common/ActionManager.cpp8
-rw-r--r--src/Common/ActionManager.h6
-rw-r--r--src/Common/Base64Encoder.cpp12
-rw-r--r--src/Common/ClientConnection.cpp2
-rw-r--r--src/Common/Connection.cpp2
-rw-r--r--src/Common/Connection.h6
-rw-r--r--src/Common/Makefile.in4
-rw-r--r--src/Common/Request.h9
-rw-r--r--src/Common/RequestHandler.h5
-rw-r--r--src/Common/RequestHandlers/DisconnectRequestHandler.cpp4
-rw-r--r--src/Common/RequestHandlers/FSInfoRequestHandler.cpp10
-rw-r--r--src/Common/RequestHandlers/Makefile.in4
-rw-r--r--src/Common/RequestHandlers/StatusRequestHandler.cpp12
-rw-r--r--src/Common/RequestManager.cpp7
-rw-r--r--src/Common/Requests/Makefile.in4
-rw-r--r--src/Common/SystemBackend.h12
-rw-r--r--src/Common/SystemManager.cpp12
-rw-r--r--src/Common/SystemManager.h14
18 files changed, 66 insertions, 67 deletions
diff --git a/src/Common/ActionManager.cpp b/src/Common/ActionManager.cpp
index 166001a..fc3c034 100644
--- a/src/Common/ActionManager.cpp
+++ b/src/Common/ActionManager.cpp
@@ -23,8 +23,6 @@
#include <fcntl.h>
#include <signal.h>
-#include <sigc++/adaptors/hide.h>
-
namespace Mad {
namespace Common {
@@ -39,7 +37,7 @@ void ActionManager::doInit() {
fcntl(notifyPipe[0], F_SETFL, fcntl(notifyPipe[0], F_GETFL) | O_NONBLOCK);
fcntl(notifyPipe[1], F_SETFL, fcntl(notifyPipe[1], F_GETFL) | O_NONBLOCK);
- Net::FdManager::get()->registerFd(notifyPipe[0], sigc::hide(sigc::mem_fun(this, &ActionManager::run)), POLLIN);
+ Net::FdManager::get()->registerFd(notifyPipe[0], boost::bind(&ActionManager::run, this), POLLIN);
}
void ActionManager::doDeinit() {
@@ -65,7 +63,7 @@ void ActionManager::run() {
return;
}
- sigc::slot<void> action = actions.front();
+ boost::function0<void> action = actions.front();
actions.pop();
sigprocmask(SIG_SETMASK, &oldset, 0);
@@ -74,7 +72,7 @@ void ActionManager::run() {
}
}
-void ActionManager::add(const sigc::slot<void> &action) {
+void ActionManager::add(const boost::function0<void> &action) {
sigset_t set, oldset;
sigfillset(&set);
sigprocmask(SIG_SETMASK, &set, &oldset);
diff --git a/src/Common/ActionManager.h b/src/Common/ActionManager.h
index e47652e..5d3dc15 100644
--- a/src/Common/ActionManager.h
+++ b/src/Common/ActionManager.h
@@ -25,14 +25,14 @@
#include <queue>
#include <unistd.h>
-#include <sigc++/slot.h>
+#include <boost/function.hpp>
namespace Mad {
namespace Common {
class ActionManager : public Initializable {
private:
- std::queue<sigc::slot<void> > actions;
+ std::queue<boost::function0<void> > actions;
int notifyPipe[2];
static ActionManager actionManager;
@@ -45,7 +45,7 @@ class ActionManager : public Initializable {
public:
void run();
- void add(const sigc::slot<void> &action);
+ void add(const boost::function0<void> &action);
static ActionManager *get() {
if(!actionManager.isInitialized())
diff --git a/src/Common/Base64Encoder.cpp b/src/Common/Base64Encoder.cpp
index 9607ec9..a2795d6 100644
--- a/src/Common/Base64Encoder.cpp
+++ b/src/Common/Base64Encoder.cpp
@@ -189,18 +189,18 @@ std::vector<boost::uint8_t> Base64Encoder::decode(const std::string &data) {
boost::uint8_t *ptr = buf.get();
for(size_t in = 0; in < data.length()-1; in += 4) {
- if(b64[data[in]] >= 64 || b64[data[in+1]] >= 64)
+ if(b64[(size_t)data[in]] >= 64 || b64[(size_t)data[in+1]] >= 64)
break;
- *ptr++ = (b64[data[in]] << 2) + (b64[data[in+1]] >> 4);
- if(in >= data.length()-2 || b64[data[in+2]] >= 64)
+ *ptr++ = (b64[(size_t)data[in]] << 2) + (b64[(size_t)data[in+1]] >> 4);
+ if(in >= data.length()-2 || b64[(size_t)data[in+2]] >= 64)
break;
- *ptr++ = (b64[data[in+1]] << 4) + (b64[data[in+2]] >> 2);
- if(in >= data.length()-3 || b64[data[in+3]] >= 64)
+ *ptr++ = (b64[(size_t)data[in+1]] << 4) + (b64[(size_t)data[in+2]] >> 2);
+ if(in >= data.length()-3 || b64[(size_t)data[in+3]] >= 64)
break;
- *ptr++ = (b64[data[in+2]] << 6) + b64[data[in+3]];
+ *ptr++ = (b64[(size_t)data[in+2]] << 6) + b64[(size_t)data[in+3]];
}
return std::vector<boost::uint8_t>(buf.get(), ptr);
diff --git a/src/Common/ClientConnection.cpp b/src/Common/ClientConnection.cpp
index 7b33fb2..381f822 100644
--- a/src/Common/ClientConnection.cpp
+++ b/src/Common/ClientConnection.cpp
@@ -26,7 +26,7 @@ namespace Mad {
namespace Common {
ClientConnection::ClientConnection() : connection(new Net::ClientConnection) {
- connection->signalReceive().connect(sigc::mem_fun(this, &ClientConnection::receive));
+ connection->signalReceive().connect(boost::bind(&ClientConnection::receive, this, _1));
}
bool ClientConnection::send(const Net::Packet &packet) {
diff --git a/src/Common/Connection.cpp b/src/Common/Connection.cpp
index 510731f..f476a68 100644
--- a/src/Common/Connection.cpp
+++ b/src/Common/Connection.cpp
@@ -20,8 +20,6 @@
#include "Connection.h"
#include "XmlPacket.h"
-#include <sigc++/bind.h>
-
namespace Mad {
namespace Common {
diff --git a/src/Common/Connection.h b/src/Common/Connection.h
index 860c044..ea90c4c 100644
--- a/src/Common/Connection.h
+++ b/src/Common/Connection.h
@@ -23,7 +23,7 @@
#include <stdint.h>
#include <sys/types.h>
-#include <sigc++/signal.h>
+#include <boost/signal.hpp>
namespace Mad {
@@ -39,7 +39,7 @@ class Connection {
private:
bool authenticated;
- sigc::signal<void, const XmlPacket&, uint16_t> signal;
+ boost::signal2<void, const XmlPacket&, uint16_t> signal;
// Prevent shallow copy
Connection(const Connection &o);
@@ -57,7 +57,7 @@ class Connection {
bool sendPacket(const XmlPacket &packet, uint16_t requestId);
- sigc::signal<void, const XmlPacket&, uint16_t> signalReceive() const {
+ boost::signal2<void, const XmlPacket&, uint16_t>& signalReceive() {
return signal;
}
diff --git a/src/Common/Makefile.in b/src/Common/Makefile.in
index ef3993d..8b66f20 100644
--- a/src/Common/Makefile.in
+++ b/src/Common/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 \
@@ -97,6 +98,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@
@@ -228,8 +230,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/Common/Request.h b/src/Common/Request.h
index 7ab2816..3979e0c 100644
--- a/src/Common/Request.h
+++ b/src/Common/Request.h
@@ -24,7 +24,8 @@
#include <Net/Exception.h>
#include <memory>
-#include <sigc++/adaptors/hide.h>
+
+#include <boost/bind.hpp>
namespace Mad {
namespace Common {
@@ -33,19 +34,19 @@ class Request : public RequestHandler {
private:
friend class RequestManager;
- sigc::signal<void,const Request&> finished;
+ boost::signal1<void, const Request&> finished;
std::auto_ptr<XmlPacket> res;
Net::Exception exp;
public:
- typedef sigc::slot<void,const Request&> slot_type;
+ typedef boost::function1<void, const Request&> slot_type;
protected:
Request(Connection *connection, uint16_t requestId, slot_type slot)
: RequestHandler(connection, requestId), exp(Net::Exception::NOT_FINISHED) {
finished.connect(slot);
- finished.connect(sigc::hide(signalFinished().make_slot()));
+ finished.connect(boost::bind((void(boost::signal0<void>::*)())&boost::signal0<void>::operator(), &signalFinished()));
}
void finish(std::auto_ptr<XmlPacket> result) {res = result; finished(*this);}
diff --git a/src/Common/RequestHandler.h b/src/Common/RequestHandler.h
index e3ac19f..9c50345 100644
--- a/src/Common/RequestHandler.h
+++ b/src/Common/RequestHandler.h
@@ -23,7 +23,6 @@
#include "Connection.h"
#include "XmlPacket.h"
-#include <sigc++/signal.h>
#include <stdint.h>
namespace Mad {
@@ -34,7 +33,7 @@ class RequestManager;
class RequestHandler {
private:
- sigc::signal<void> finished;
+ boost::signal0<void> finished;
Connection *connection;
uint16_t requestId;
@@ -46,7 +45,7 @@ class RequestHandler {
protected:
RequestHandler(Connection *connection0, uint16_t requestId0) : connection(connection0), requestId(requestId0) {}
- sigc::signal<void> signalFinished() {return finished;}
+ boost::signal0<void>& signalFinished() {return finished;}
Connection* getConnection() const {
return connection;
diff --git a/src/Common/RequestHandlers/DisconnectRequestHandler.cpp b/src/Common/RequestHandlers/DisconnectRequestHandler.cpp
index fa2ad88..163aa75 100644
--- a/src/Common/RequestHandlers/DisconnectRequestHandler.cpp
+++ b/src/Common/RequestHandlers/DisconnectRequestHandler.cpp
@@ -35,7 +35,7 @@ void DisconnectRequestHandler::handlePacket(const XmlPacket &packet) {
sendPacket(ret);
- signalFinished().emit();
+ signalFinished()();
return;
}
@@ -47,7 +47,7 @@ void DisconnectRequestHandler::handlePacket(const XmlPacket &packet) {
getConnection()->disconnect();
- signalFinished().emit();
+ signalFinished()();
}
}
diff --git a/src/Common/RequestHandlers/FSInfoRequestHandler.cpp b/src/Common/RequestHandlers/FSInfoRequestHandler.cpp
index fc98730..ed70a8b 100644
--- a/src/Common/RequestHandlers/FSInfoRequestHandler.cpp
+++ b/src/Common/RequestHandlers/FSInfoRequestHandler.cpp
@@ -21,6 +21,8 @@
#include <Net/Exception.h>
#include "../Logger.h"
+#include <boost/bind.hpp>
+
namespace Mad {
namespace Common {
namespace RequestHandlers {
@@ -35,20 +37,20 @@ void FSInfoRequestHandler::handlePacket(const XmlPacket &packet) {
sendPacket(ret);
- signalFinished().emit();
+ signalFinished()();
return;
}
// TODO Require authentication
- if(!SystemManager::get()->getFSInfo(sigc::mem_fun(this, &FSInfoRequestHandler::fsInfoHandler))) {
+ if(!SystemManager::get()->getFSInfo(boost::bind(&FSInfoRequestHandler::fsInfoHandler, this, _1))) {
XmlPacket ret;
ret.setType("Error");
ret.add("ErrorCode", Net::Exception::NOT_IMPLEMENTED);
sendPacket(ret);
- signalFinished().emit();
+ signalFinished()();
}
}
@@ -69,7 +71,7 @@ void FSInfoRequestHandler::fsInfoHandler(const std::vector<SystemManager::FSInfo
}
sendPacket(ret);
- signalFinished().emit();
+ signalFinished()();
}
}
diff --git a/src/Common/RequestHandlers/Makefile.in b/src/Common/RequestHandlers/Makefile.in
index e5cce2c..22ff596 100644
--- a/src/Common/RequestHandlers/Makefile.in
+++ b/src/Common/RequestHandlers/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@
diff --git a/src/Common/RequestHandlers/StatusRequestHandler.cpp b/src/Common/RequestHandlers/StatusRequestHandler.cpp
index 0cfe025..0c13bd9 100644
--- a/src/Common/RequestHandlers/StatusRequestHandler.cpp
+++ b/src/Common/RequestHandlers/StatusRequestHandler.cpp
@@ -22,6 +22,8 @@
#include "../SystemBackend.h"
#include "../Logger.h"
+#include <boost/bind.hpp>
+
namespace Mad {
namespace Common {
namespace RequestHandlers {
@@ -36,17 +38,17 @@ void StatusRequestHandler::handlePacket(const XmlPacket &packet) {
sendPacket(ret);
- signalFinished().emit();
+ signalFinished()();
return;
}
// TODO Require authentication
- if(!SystemManager::get()->getUptimeInfo(sigc::mem_fun(this, &StatusRequestHandler::uptimeHandler)))
+ if(!SystemManager::get()->getUptimeInfo(boost::bind(&StatusRequestHandler::uptimeHandler, this, _1, _2)))
needUptime = false;
- if(!SystemManager::get()->getMemoryInfo(sigc::mem_fun(this, &StatusRequestHandler::memoryHandler)))
+ if(!SystemManager::get()->getMemoryInfo(boost::bind(&StatusRequestHandler::memoryHandler, this, _1, _2, _3, _4)))
needMemory = false;
- if(!SystemManager::get()->getLoadInfo(sigc::mem_fun(this, &StatusRequestHandler::loadHandler)))
+ if(!SystemManager::get()->getLoadInfo(boost::bind(&StatusRequestHandler::loadHandler, this, _1, _2, _3, _4, _5)))
needLoad = false;
send();
@@ -76,7 +78,7 @@ void StatusRequestHandler::send() {
sent = true;
- signalFinished().emit();
+ signalFinished()();
}
}
diff --git a/src/Common/RequestManager.cpp b/src/Common/RequestManager.cpp
index 08be0a9..c36bd76 100644
--- a/src/Common/RequestManager.cpp
+++ b/src/Common/RequestManager.cpp
@@ -21,8 +21,7 @@
#include "RequestHandlers/DisconnectRequestHandler.h"
#include "Logger.h"
-#include <sigc++/bind.h>
-#include <sigc++/retype_return.h>
+#include <boost/bind.hpp>
namespace Mad {
namespace Common {
@@ -39,7 +38,7 @@ bool RequestManager::RequestMap::addRequest(uint16_t id, RequestHandler *info) {
if(!insert(std::make_pair(id, info)).second)
return false;
- info->signalFinished().connect(sigc::hide_return(sigc::bind(sigc::mem_fun(this, &RequestManager::RequestMap::deleteRequest), id)));
+ info->signalFinished().connect(boost::bind(&RequestManager::RequestMap::deleteRequest, this, id));
return true;
}
@@ -121,7 +120,7 @@ RequestManager::RequestMap* RequestManager::getUnusedRequestId(Connection *conne
void RequestManager::registerConnection(Connection *connection) {
requestMaps.insert(std::make_pair(connection, new RequestMap()));
- connection->signalReceive().connect(sigc::bind<0>(sigc::mem_fun(this, &RequestManager::receiveHandler), connection));
+ connection->signalReceive().connect(boost::bind(&RequestManager::receiveHandler, this, connection, _1, _2));
}
void RequestManager::unregisterConnection(Connection *connection) {
diff --git a/src/Common/Requests/Makefile.in b/src/Common/Requests/Makefile.in
index c809e3c..b36e5b8 100644
--- a/src/Common/Requests/Makefile.in
+++ b/src/Common/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@
diff --git a/src/Common/SystemBackend.h b/src/Common/SystemBackend.h
index 9c3eaa2..ed553c2 100644
--- a/src/Common/SystemBackend.h
+++ b/src/Common/SystemBackend.h
@@ -31,27 +31,27 @@ class SystemBackend {
protected:
friend class SystemManager;
- virtual bool getUptimeInfo(const sigc::slot<void, unsigned long, unsigned long> &callback _UNUSED_PARAMETER_) {
+ virtual bool getUptimeInfo(const boost::function2<void, unsigned long, unsigned long> &callback _UNUSED_PARAMETER_) {
return false;
}
- virtual bool getMemoryInfo(const sigc::slot<void, unsigned long, unsigned long, unsigned long, unsigned long> &callback _UNUSED_PARAMETER_) {
+ virtual bool getMemoryInfo(const boost::function4<void, unsigned long, unsigned long, unsigned long, unsigned long> &callback _UNUSED_PARAMETER_) {
return false;
}
- virtual bool getLoadInfo(const sigc::slot<void, unsigned long, unsigned long, float, float, float> &callback _UNUSED_PARAMETER_) {
+ virtual bool getLoadInfo(const boost::function5<void, unsigned long, unsigned long, float, float, float> &callback _UNUSED_PARAMETER_) {
return false;
}
- virtual bool getFSInfo(const sigc::slot<void, const std::vector<SystemManager::FSInfo>& > &callback _UNUSED_PARAMETER_) {
+ virtual bool getFSInfo(const boost::function1<void, const std::vector<SystemManager::FSInfo>& > &callback _UNUSED_PARAMETER_) {
return false;
}
- virtual bool shutdown(const sigc::slot<void> &callback _UNUSED_PARAMETER_) {
+ virtual bool shutdown(const boost::function0<void> &callback _UNUSED_PARAMETER_) {
return false;
}
- virtual bool reboot(const sigc::slot<void> &callback _UNUSED_PARAMETER_) {
+ virtual bool reboot(const boost::function0<void> &callback _UNUSED_PARAMETER_) {
return false;
}
diff --git a/src/Common/SystemManager.cpp b/src/Common/SystemManager.cpp
index a037bd6..4a549b7 100644
--- a/src/Common/SystemManager.cpp
+++ b/src/Common/SystemManager.cpp
@@ -34,7 +34,7 @@ bool SystemManager::Compare::operator() (const SystemBackend *b1, const SystemBa
}
-bool SystemManager::getUptimeInfo(const sigc::slot<void, unsigned long, unsigned long> &callback) {
+bool SystemManager::getUptimeInfo(const boost::function2<void, unsigned long, unsigned long> &callback) {
for(std::set<SystemBackend*>::iterator backend = backends.begin(); backend != backends.end(); ++backend) {
if((*backend)->getUptimeInfo(callback))
return true;
@@ -43,7 +43,7 @@ bool SystemManager::getUptimeInfo(const sigc::slot<void, unsigned long, unsigned
return false;
}
-bool SystemManager::getMemoryInfo(const sigc::slot<void, unsigned long, unsigned long, unsigned long, unsigned long> &callback) {
+bool SystemManager::getMemoryInfo(const boost::function4<void, unsigned long, unsigned long, unsigned long, unsigned long> &callback) {
for(std::set<SystemBackend*>::iterator backend = backends.begin(); backend != backends.end(); ++backend) {
if((*backend)->getMemoryInfo(callback))
return true;
@@ -52,7 +52,7 @@ bool SystemManager::getMemoryInfo(const sigc::slot<void, unsigned long, unsigned
return false;
}
-bool SystemManager::getLoadInfo(const sigc::slot<void, unsigned long, unsigned long, float, float, float> &callback) {
+bool SystemManager::getLoadInfo(const boost::function5<void, unsigned long, unsigned long, float, float, float> &callback) {
for(std::set<SystemBackend*>::iterator backend = backends.begin(); backend != backends.end(); ++backend) {
if((*backend)->getLoadInfo(callback))
return true;
@@ -61,7 +61,7 @@ bool SystemManager::getLoadInfo(const sigc::slot<void, unsigned long, unsigned l
return false;
}
-bool SystemManager::getFSInfo(const sigc::slot<void, const std::vector<FSInfo>& > &callback) {
+bool SystemManager::getFSInfo(const boost::function1<void, const std::vector<FSInfo>& > &callback) {
for(std::set<SystemBackend*>::iterator backend = backends.begin(); backend != backends.end(); ++backend) {
if((*backend)->getFSInfo(callback))
return true;
@@ -70,7 +70,7 @@ bool SystemManager::getFSInfo(const sigc::slot<void, const std::vector<FSInfo>&
return false;
}
-bool SystemManager::shutdown(const sigc::slot<void> &callback) {
+bool SystemManager::shutdown(const boost::function0<void> &callback) {
for(std::set<SystemBackend*>::iterator backend = backends.begin(); backend != backends.end(); ++backend) {
if((*backend)->shutdown(callback))
return true;
@@ -79,7 +79,7 @@ bool SystemManager::shutdown(const sigc::slot<void> &callback) {
return false;
}
-bool SystemManager::reboot(const sigc::slot<void> &callback) {
+bool SystemManager::reboot(const boost::function0<void> &callback) {
for(std::set<SystemBackend*>::iterator backend = backends.begin(); backend != backends.end(); ++backend) {
if((*backend)->reboot(callback))
return true;
diff --git a/src/Common/SystemManager.h b/src/Common/SystemManager.h
index 5de7180..20d3c05 100644
--- a/src/Common/SystemManager.h
+++ b/src/Common/SystemManager.h
@@ -24,7 +24,7 @@
#include <string>
#include <vector>
-#include <sigc++/slot.h>
+#include <boost/function.hpp>
namespace Mad {
namespace Common {
@@ -62,14 +62,14 @@ class SystemManager {
backends.erase(backend);
}
- bool getUptimeInfo(const sigc::slot<void, unsigned long, unsigned long> &callback);
- bool getMemoryInfo(const sigc::slot<void, unsigned long, unsigned long, unsigned long, unsigned long> &callback);
- bool getLoadInfo(const sigc::slot<void, unsigned long, unsigned long, float, float, float> &callback);
+ bool getUptimeInfo(const boost::function2<void, unsigned long, unsigned long> &callback);
+ bool getMemoryInfo(const boost::function4<void, unsigned long, unsigned long, unsigned long, unsigned long> &callback);
+ bool getLoadInfo(const boost::function5<void, unsigned long, unsigned long, float, float, float> &callback);
- bool getFSInfo(const sigc::slot<void, const std::vector<FSInfo>& > &callback);
+ bool getFSInfo(const boost::function1<void, const std::vector<FSInfo>& > &callback);
- bool shutdown(const sigc::slot<void> &callback);
- bool reboot(const sigc::slot<void> &callback);
+ bool shutdown(const boost::function0<void> &callback);
+ bool reboot(const boost::function0<void> &callback);
static SystemManager *get() {
return &systemManager;