summaryrefslogtreecommitdiffstats
path: root/src/Common/SystemBackend.h
diff options
context:
space:
mode:
authorMatthias Schiffer <matthias@gamezock.de>2009-04-25 16:27:03 +0200
committerMatthias Schiffer <matthias@gamezock.de>2009-04-25 16:27:03 +0200
commit71dc41a9b7b0e939314a886383daa6fb2e297a55 (patch)
tree583d3b0ef8aeb01b94cb9b3297a3976705f99e6a /src/Common/SystemBackend.h
parentc6f8a170e642b5b1a28bd85857f715846bbadbb4 (diff)
downloadmad-71dc41a9b7b0e939314a886383daa6fb2e297a55.tar
mad-71dc41a9b7b0e939314a886383daa6fb2e297a55.zip
SystemBackend und UserBackend in Backend und Manager aufgeteilt
Diffstat (limited to 'src/Common/SystemBackend.h')
-rw-r--r--src/Common/SystemBackend.h60
1 files changed, 11 insertions, 49 deletions
diff --git a/src/Common/SystemBackend.h b/src/Common/SystemBackend.h
index 944f195..9c3eaa2 100644
--- a/src/Common/SystemBackend.h
+++ b/src/Common/SystemBackend.h
@@ -20,82 +20,44 @@
#ifndef MAD_COMMON_SYSTEMBACKEND_H_
#define MAD_COMMON_SYSTEMBACKEND_H_
-#include <set>
-#include <string>
-#include <vector>
+#include <config.h>
-#include <sigc++/signal.h>
+#include "SystemManager.h"
namespace Mad {
namespace Common {
class SystemBackend {
- private:
- struct Compare {
- bool operator() (const SystemBackend *b1, const SystemBackend *b2) {
- if(b1->getPriority() == b2->getPriority())
- return (b1 > b2);
- else
- return (b1->getPriority() > b2->getPriority());
- }
- };
-
- static std::set<SystemBackend*, Compare> backends;
-
- public:
- struct FSInfo {
- std::string fsName;
- std::string mountedOn;
- long long total;
- long long used;
- long long available;
- };
-
protected:
- SystemBackend() {}
+ friend class SystemManager;
- static void registerBackend(SystemBackend *backend) {
- backends.insert(backend);
+ virtual bool getUptimeInfo(const sigc::slot<void, unsigned long, unsigned long> &callback _UNUSED_PARAMETER_) {
+ return false;
}
- static void unregisterBackend(SystemBackend *backend) {
- backends.erase(backend);
+ virtual bool getMemoryInfo(const sigc::slot<void, unsigned long, unsigned long, unsigned long, unsigned long> &callback _UNUSED_PARAMETER_) {
+ return false;
}
- virtual bool uptimeInfo(const sigc::slot<void, unsigned long, unsigned long>&) {
+ virtual bool getLoadInfo(const sigc::slot<void, unsigned long, unsigned long, float, float, float> &callback _UNUSED_PARAMETER_) {
return false;
}
- virtual bool memoryInfo(const sigc::slot<void, unsigned long, unsigned long, unsigned long, unsigned long>&) {
+ virtual bool getFSInfo(const sigc::slot<void, const std::vector<SystemManager::FSInfo>& > &callback _UNUSED_PARAMETER_) {
return false;
}
- virtual bool loadInfo(const sigc::slot<void, unsigned long, unsigned long, float, float, float>&) {
+ virtual bool shutdown(const sigc::slot<void> &callback _UNUSED_PARAMETER_) {
return false;
}
- virtual bool fsInfo(const sigc::slot<void, const std::vector<FSInfo>& >&) {
+ virtual bool reboot(const sigc::slot<void> &callback _UNUSED_PARAMETER_) {
return false;
}
- virtual bool doShutdown(const sigc::slot<void>&) {return false;}
- virtual bool doReboot(const sigc::slot<void>&) {return false;}
-
virtual int getPriority() const {
return 0;
}
-
- public:
- virtual ~SystemBackend() {}
-
- static bool getUptimeInfo(const sigc::slot<void, unsigned long, unsigned long> &callback);
- static bool getMemoryInfo(const sigc::slot<void, unsigned long, unsigned long, unsigned long, unsigned long> &callback);
- static bool getLoadInfo(const sigc::slot<void, unsigned long, unsigned long, float, float, float> &callback);
-
- static bool getFSInfo(const sigc::slot<void, const std::vector<FSInfo>& > &callback);
-
- static bool shutdown(const sigc::slot<void> &callback);
- static bool reboot(const sigc::slot<void> &callback);
};
}