summaryrefslogtreecommitdiffstats
path: root/src/Common/SystemBackend.h
diff options
context:
space:
mode:
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);
};
}