moving to only one computer. also a bit of cleanup:

This commit is contained in:
amerhifi 2019-05-16 16:38:59 -07:00
parent a62f91c7b3
commit 3b448ce1fe
7 changed files with 13 additions and 33 deletions

View file

@ -8,9 +8,8 @@
#include "AndroidPlatform.h"
#include "platformJsonKeys.h"
#include <GPUIdent.h>
#include <string>
using namespace platform;
void AndroidInstance::enumerateCpu() {
@ -39,7 +38,7 @@ void AndroidInstance::enumerateMemory() {
_memory.push_back(ram);
}
void AndroidInstance::::enumerateComputer(){
void AndroidInstance::enumerateComputer(){
//no implememntation at this time
}

View file

@ -9,7 +9,6 @@
#include "LinuxPlatform.h"
#include "platformJsonKeys.h"
#include <GPUIdent.h>
#include <string>
using namespace platform;
void LinuxInstance::enumerateCpu() {
@ -41,7 +40,7 @@ void LinuxInstance::enumerateMemory() {
_memory.push_back(ram);
}
void LinuxInstance::::enumerateComputer(){
void LinuxInstance::enumerateComputer(){
//no implememntation at this time
}

View file

@ -98,12 +98,8 @@ void MACOSInstance::enumerateComputer(){
char* model = (char *) malloc(sizeof(char)*len+1);
sysctlbyname("hw.model", model, &len, NULL,0);
json computer;
computer["computerModel"]=std::string(model);
_computer.push_back(computer);
_computer["computerModel"]=std::string(model);
free(model);
#endif

View file

@ -78,10 +78,6 @@ json platform::getMemory(int index) {
return _instance->getMemory(index);
}
int platform::getNumComputer(){
return _instance->getNumComputer();
}
json platform::getComputer(int index){
return _instance->getComputer(index);
json platform::getComputer(){
return _instance->getComputer();
}

View file

@ -9,8 +9,7 @@
#ifndef hifi_Platform_h
#define hifi_Platform_h
#include "platformInstance.h"
#include <vector>
#include <nlohmann/json.hpp>
namespace platform {
@ -32,8 +31,8 @@ json getDisplay(int index);
int getNumMemory();
json getMemory(int index);
int getNumComputer();
json getComputer(int index);
json getComputer();
} // namespace platform
#endif // hifi_platform_h

View file

@ -7,7 +7,6 @@
//
#include "platform.h"
#include "platformInstance.h"
#include <QtGlobal>
@ -47,14 +46,6 @@ json Instance::getGPU(int 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) {
assert(index <(int) _display.size());

View file

@ -31,8 +31,8 @@ public:
int getNumDisplay() { return (int)_display.size(); }
json getDisplay(int index);
int getNumComputer() {return (int)_computer.size();}
json getComputer(int index);
json getComputer() {return _computer;}
void virtual enumerateCpu()=0;
void virtual enumerateMemory()=0;
@ -46,7 +46,7 @@ protected:
std::vector<json> _memory;
std::vector<json> _gpu;
std::vector<json> _display;
std::vector<json> _computer;
json _computer;
};
} // namespace platform