summaryrefslogtreecommitdiffstats
path: root/src/modules/SystemBackendProc
diff options
context:
space:
mode:
Diffstat (limited to 'src/modules/SystemBackendProc')
-rw-r--r--src/modules/SystemBackendProc/SystemBackendProc.cpp24
-rw-r--r--src/modules/SystemBackendProc/SystemBackendProc.h6
2 files changed, 15 insertions, 15 deletions
diff --git a/src/modules/SystemBackendProc/SystemBackendProc.cpp b/src/modules/SystemBackendProc/SystemBackendProc.cpp
index ab074b2..e8b45cd 100644
--- a/src/modules/SystemBackendProc/SystemBackendProc.cpp
+++ b/src/modules/SystemBackendProc/SystemBackendProc.cpp
@@ -19,7 +19,7 @@
#include "SystemBackendProc.h"
-#include <Net/ThreadManager.h>
+#include <Core/ThreadManager.h>
#include <cstdio>
#include <cstring>
@@ -29,18 +29,18 @@ namespace Modules {
boost::shared_ptr<SystemBackendProc> SystemBackendProc::backend;
-void SystemBackendProc::getUptimeInfo(unsigned long *uptime, unsigned long *idleTime) throw(Net::Exception) {
- Net::ThreadManager::get()->detach();
+void SystemBackendProc::getUptimeInfo(unsigned long *uptime, unsigned long *idleTime) throw(Core::Exception) {
+ Core::ThreadManager::get()->detach();
uptimeFile.seekg(0, std::ios::beg);
if(!uptimeFile.good())
- throw(Net::Exception(Net::Exception::NOT_AVAILABLE));
+ throw(Core::Exception(Core::Exception::NOT_AVAILABLE));
float f;
uptimeFile >> f;
if(!uptimeFile.good())
- throw(Net::Exception(Net::Exception::NOT_AVAILABLE));
+ throw(Core::Exception(Core::Exception::NOT_AVAILABLE));
if(uptime)
*uptime = (unsigned long)f;
@@ -50,8 +50,8 @@ void SystemBackendProc::getUptimeInfo(unsigned long *uptime, unsigned long *idle
*idleTime = (unsigned long)f;
}
-void SystemBackendProc::getMemoryInfo(unsigned long *totalMem, unsigned long *freeMem, unsigned long *totalSwap, unsigned long *freeSwap) throw(Net::Exception) {
- Net::ThreadManager::get()->detach();
+void SystemBackendProc::getMemoryInfo(unsigned long *totalMem, unsigned long *freeMem, unsigned long *totalSwap, unsigned long *freeSwap) throw(Core::Exception) {
+ Core::ThreadManager::get()->detach();
if(totalMem)
*totalMem = 0;
@@ -65,7 +65,7 @@ void SystemBackendProc::getMemoryInfo(unsigned long *totalMem, unsigned long *fr
meminfoFile.seekg(0, std::ios::beg);
if(!meminfoFile.good())
- throw(Net::Exception(Net::Exception::NOT_AVAILABLE));
+ throw(Core::Exception(Core::Exception::NOT_AVAILABLE));
while(!meminfoFile.eof() && meminfoFile.good()) {
std::string line;
@@ -92,8 +92,8 @@ void SystemBackendProc::getMemoryInfo(unsigned long *totalMem, unsigned long *fr
}
}
-void SystemBackendProc::getLoadInfo(unsigned long *currentLoad, unsigned long *nProcesses, float *loadAvg1, float *loadAvg5, float *loadAvg15) throw(Net::Exception) {
- Net::ThreadManager::get()->detach();
+void SystemBackendProc::getLoadInfo(unsigned long *currentLoad, unsigned long *nProcesses, float *loadAvg1, float *loadAvg5, float *loadAvg15) throw(Core::Exception) {
+ Core::ThreadManager::get()->detach();
unsigned long currentLoadValue = 0, nProcessesValue = 0;
float loadAvg1Value = 0, loadAvg5Value = 0, loadAvg15Value = 0;
@@ -101,13 +101,13 @@ void SystemBackendProc::getLoadInfo(unsigned long *currentLoad, unsigned long *n
loadFile.seekg(0, std::ios::beg);
if(!loadFile.good())
- throw(Net::Exception(Net::Exception::NOT_AVAILABLE));
+ throw(Core::Exception(Core::Exception::NOT_AVAILABLE));
std::string line;
std::getline(loadFile, line);
if(line.empty())
- throw(Net::Exception(Net::Exception::NOT_AVAILABLE));
+ throw(Core::Exception(Core::Exception::NOT_AVAILABLE));
std::sscanf(line.c_str(), "%f %f %f %lu/%lu", &loadAvg1Value, &loadAvg5Value, &loadAvg15Value, &currentLoadValue, &nProcessesValue);
diff --git a/src/modules/SystemBackendProc/SystemBackendProc.h b/src/modules/SystemBackendProc/SystemBackendProc.h
index eb2f8a6..9a0cb71 100644
--- a/src/modules/SystemBackendProc/SystemBackendProc.h
+++ b/src/modules/SystemBackendProc/SystemBackendProc.h
@@ -39,9 +39,9 @@ class SystemBackendProc : public Common::SystemBackend, boost::noncopyable {
SystemBackendProc() : uptimeFile("/proc/uptime"), meminfoFile("/proc/meminfo"), loadFile("/proc/loadavg") {}
protected:
- virtual void getUptimeInfo(unsigned long *uptime, unsigned long *idleTime) throw(Net::Exception);
- virtual void getMemoryInfo(unsigned long *totalMem, unsigned long *freeMem, unsigned long *totalSwap, unsigned long *freeSwap) throw(Net::Exception);
- virtual void getLoadInfo(unsigned long *currentLoad, unsigned long *nProcesses, float *loadAvg1, float *loadAvg5, float *loadAvg15) throw(Net::Exception);
+ virtual void getUptimeInfo(unsigned long *uptime, unsigned long *idleTime) throw(Core::Exception);
+ virtual void getMemoryInfo(unsigned long *totalMem, unsigned long *freeMem, unsigned long *totalSwap, unsigned long *freeSwap) throw(Core::Exception);
+ virtual void getLoadInfo(unsigned long *currentLoad, unsigned long *nProcesses, float *loadAvg1, float *loadAvg5, float *loadAvg15) throw(Core::Exception);
public:
static void registerBackend() {