diff --git a/ColumbusInfo.hpp b/ColumbusInfo.hpp index 62c7bfc..ebdbaa2 100644 --- a/ColumbusInfo.hpp +++ b/ColumbusInfo.hpp @@ -4,8 +4,6 @@ #include #endif -#include - namespace Columbus { diff --git a/Info.hpp b/Info.hpp deleted file mode 100644 index 62c7bfc..0000000 --- a/Info.hpp +++ /dev/null @@ -1,65 +0,0 @@ -#ifdef __linux - #define COLUMBUS_PLATFORM_LINUX - #include - #include -#endif - -#include - -namespace Columbus -{ - - class Info - { - public: - static unsigned int getCPUCount(); - - static unsigned long getRAMSize(); - static unsigned long getRAMFree(); - static int getRAMUsage(); - }; - - unsigned int Info::getCPUCount() - { - #ifdef COLUMBUS_PLATFORM_LINUX - return sysconf(_SC_NPROCESSORS_ONLN); - #endif - } - - unsigned long Info::getRAMSize() - { - #ifdef COLUMBUS_PLATFORM_LINUX - struct sysinfo info; - if (sysinfo(&info) == -1) return 0; - return info.totalram / (1024 * 1024); - #endif - } - - unsigned long Info::getRAMFree() - { - #ifdef COLUMBUS_PLATFORM_LINUX - struct sysinfo info; - if (sysinfo(&info) == -1) return 0; - return info.freeram / (1024 * 1024); - #endif - } - - int Info::getRAMUsage() - { - #ifdef COLUMBUS_PLATFORM_LINUX - struct sysinfo info; - if (sysinfo(&info) == -1) return 0; - float usage = static_cast(getRAMFree()) / static_cast(getRAMSize()); - return static_cast(100 - usage * 100); - #endif - } - -} - - -#undef COLUMBUS_PLATFORM_LINUX - - - - -