mirror of
https://github.com/overte-org/overte.git
synced 2025-08-08 21:36:47 +02:00
moving to only one computer. also a bit of cleanup:
This commit is contained in:
parent
a62f91c7b3
commit
3b448ce1fe
7 changed files with 13 additions and 33 deletions
|
@ -8,9 +8,8 @@
|
||||||
|
|
||||||
#include "AndroidPlatform.h"
|
#include "AndroidPlatform.h"
|
||||||
#include "platformJsonKeys.h"
|
#include "platformJsonKeys.h"
|
||||||
|
|
||||||
#include <GPUIdent.h>
|
#include <GPUIdent.h>
|
||||||
#include <string>
|
|
||||||
using namespace platform;
|
using namespace platform;
|
||||||
|
|
||||||
void AndroidInstance::enumerateCpu() {
|
void AndroidInstance::enumerateCpu() {
|
||||||
|
@ -39,7 +38,7 @@ void AndroidInstance::enumerateMemory() {
|
||||||
_memory.push_back(ram);
|
_memory.push_back(ram);
|
||||||
}
|
}
|
||||||
|
|
||||||
void AndroidInstance::::enumerateComputer(){
|
void AndroidInstance::enumerateComputer(){
|
||||||
//no implememntation at this time
|
//no implememntation at this time
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -9,7 +9,6 @@
|
||||||
#include "LinuxPlatform.h"
|
#include "LinuxPlatform.h"
|
||||||
#include "platformJsonKeys.h"
|
#include "platformJsonKeys.h"
|
||||||
#include <GPUIdent.h>
|
#include <GPUIdent.h>
|
||||||
#include <string>
|
|
||||||
|
|
||||||
using namespace platform;
|
using namespace platform;
|
||||||
void LinuxInstance::enumerateCpu() {
|
void LinuxInstance::enumerateCpu() {
|
||||||
|
@ -41,7 +40,7 @@ void LinuxInstance::enumerateMemory() {
|
||||||
_memory.push_back(ram);
|
_memory.push_back(ram);
|
||||||
}
|
}
|
||||||
|
|
||||||
void LinuxInstance::::enumerateComputer(){
|
void LinuxInstance::enumerateComputer(){
|
||||||
//no implememntation at this time
|
//no implememntation at this time
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -98,12 +98,8 @@ void MACOSInstance::enumerateComputer(){
|
||||||
char* model = (char *) malloc(sizeof(char)*len+1);
|
char* model = (char *) malloc(sizeof(char)*len+1);
|
||||||
sysctlbyname("hw.model", model, &len, NULL,0);
|
sysctlbyname("hw.model", model, &len, NULL,0);
|
||||||
|
|
||||||
|
_computer["computerModel"]=std::string(model);
|
||||||
json computer;
|
|
||||||
computer["computerModel"]=std::string(model);
|
|
||||||
|
|
||||||
_computer.push_back(computer);
|
|
||||||
|
|
||||||
free(model);
|
free(model);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -78,10 +78,6 @@ json platform::getMemory(int index) {
|
||||||
return _instance->getMemory(index);
|
return _instance->getMemory(index);
|
||||||
}
|
}
|
||||||
|
|
||||||
int platform::getNumComputer(){
|
json platform::getComputer(){
|
||||||
return _instance->getNumComputer();
|
return _instance->getComputer();
|
||||||
}
|
|
||||||
|
|
||||||
json platform::getComputer(int index){
|
|
||||||
return _instance->getComputer(index);
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -9,8 +9,7 @@
|
||||||
#ifndef hifi_Platform_h
|
#ifndef hifi_Platform_h
|
||||||
#define hifi_Platform_h
|
#define hifi_Platform_h
|
||||||
|
|
||||||
#include "platformInstance.h"
|
|
||||||
#include <vector>
|
|
||||||
#include <nlohmann/json.hpp>
|
#include <nlohmann/json.hpp>
|
||||||
|
|
||||||
namespace platform {
|
namespace platform {
|
||||||
|
@ -32,8 +31,8 @@ json getDisplay(int index);
|
||||||
int getNumMemory();
|
int getNumMemory();
|
||||||
json getMemory(int index);
|
json getMemory(int index);
|
||||||
|
|
||||||
int getNumComputer();
|
json getComputer();
|
||||||
json getComputer(int index);
|
|
||||||
} // namespace platform
|
} // namespace platform
|
||||||
|
|
||||||
#endif // hifi_platform_h
|
#endif // hifi_platform_h
|
||||||
|
|
|
@ -7,7 +7,6 @@
|
||||||
//
|
//
|
||||||
|
|
||||||
|
|
||||||
#include "platform.h"
|
|
||||||
#include "platformInstance.h"
|
#include "platformInstance.h"
|
||||||
#include <QtGlobal>
|
#include <QtGlobal>
|
||||||
|
|
||||||
|
@ -47,14 +46,6 @@ json Instance::getGPU(int index) {
|
||||||
return _gpu.at(index);
|
return _gpu.at(index);
|
||||||
}
|
}
|
||||||
|
|
||||||
json Instance::getComputer(int index){
|
|
||||||
if(index >= (int)_computer.size()){
|
|
||||||
return json();
|
|
||||||
}
|
|
||||||
|
|
||||||
return _computer.at(index);
|
|
||||||
}
|
|
||||||
|
|
||||||
json Instance::getDisplay(int index) {
|
json Instance::getDisplay(int index) {
|
||||||
assert(index <(int) _display.size());
|
assert(index <(int) _display.size());
|
||||||
|
|
||||||
|
|
|
@ -31,8 +31,8 @@ public:
|
||||||
int getNumDisplay() { return (int)_display.size(); }
|
int getNumDisplay() { return (int)_display.size(); }
|
||||||
json getDisplay(int index);
|
json getDisplay(int index);
|
||||||
|
|
||||||
int getNumComputer() {return (int)_computer.size();}
|
|
||||||
json getComputer(int index);
|
json getComputer() {return _computer;}
|
||||||
|
|
||||||
void virtual enumerateCpu()=0;
|
void virtual enumerateCpu()=0;
|
||||||
void virtual enumerateMemory()=0;
|
void virtual enumerateMemory()=0;
|
||||||
|
@ -46,7 +46,7 @@ protected:
|
||||||
std::vector<json> _memory;
|
std::vector<json> _memory;
|
||||||
std::vector<json> _gpu;
|
std::vector<json> _gpu;
|
||||||
std::vector<json> _display;
|
std::vector<json> _display;
|
||||||
std::vector<json> _computer;
|
json _computer;
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace platform
|
} // namespace platform
|
||||||
|
|
Loading…
Reference in a new issue