Perpairing for refractor to make everything work more as a library

This commit is contained in:
Ben
2018-12-18 17:37:37 +00:00
parent 9afe3d7437
commit fa0b075722
3 changed files with 6 additions and 4 deletions

View File

@@ -14,7 +14,7 @@ struct Sys {
class System {
public:
System();
Sys* getSystemSpec();
Sys getSystemSpec();
virtual ~System();
private:
Sys* m_Sys;

View File

@@ -14,8 +14,10 @@ System::System() {
}
Sys* System::getSystemSpec() {
return m_Sys;
Sys System::getSystemSpec() {
Sys temp;
memcpy(&temp, m_Sys, sizeof(Sys));
return temp;
}
System::~System() {

View File

@@ -14,7 +14,7 @@ int main(int argc, char** argv) {
sleep(1);
std::cout << std::endl;
Sys* sys = System_Instance->getSystemSpec();
Sys sys = System_Instance->getSystemSpec();
while(1) {
sleep(1);