From b4f8432c4c40b41361532d0fc6034664a078697f Mon Sep 17 00:00:00 2001 From: ganome Date: Fri, 31 Jan 2025 10:11:12 -0700 Subject: [PATCH] REMOVED all classes and header files dealing with old classes --- src/include/setcpu.h | 30 ---------------- src/include/sethardware.h | 28 --------------- src/lists/cpu.h | 28 --------------- src/lists/hardware.h | 74 --------------------------------------- src/main.cpp | 8 ++--- 5 files changed, 4 insertions(+), 164 deletions(-) delete mode 100644 src/include/setcpu.h delete mode 100644 src/include/sethardware.h delete mode 100644 src/lists/cpu.h delete mode 100644 src/lists/hardware.h diff --git a/src/include/setcpu.h b/src/include/setcpu.h deleted file mode 100644 index fa3b1aa..0000000 --- a/src/include/setcpu.h +++ /dev/null @@ -1,30 +0,0 @@ -// void setCPU(){}; - -/* this function's Incoming arguments are a pointer to the CPU class - "CPU *pCPU" and the new mainclock speed -*/ -void setCPUmainclock(CPU *pCPU, std::string mkey, std::string mmainclock) { -pCPU->HardwareSpecs[mkey] = mmainclock; -} - -void setCPUboostclock(CPU *pCPU, std::string mkey, std::string mboostclock) { -pCPU->HardwareSpecs[mkey] = mboostclock; -} - -void setCPUarch(CPU *pCPU, std::string mkey, std::string march) { -pCPU->HardwareSpecs[mkey] = march; -} - -void setCPUbits(CPU *pCPU, std::string mkey, int mbits) { - pCPU->HardwareSpecs[mkey] = mbits; -} - -void setCPUcores(CPU *pCPU, std::string mkey, int mcores) { -pCPU->HardwareSpecs[mkey] = mcores; -} - -void setCPUthreads(CPU *pCPU, std::string mkey, int mthreads) { -pCPU->HardwareSpecs[mkey] = mthreads; - // create an IF catch to set threads cores * 2 as a fall back -} - diff --git a/src/include/sethardware.h b/src/include/sethardware.h deleted file mode 100644 index 9f229f5..0000000 --- a/src/include/sethardware.h +++ /dev/null @@ -1,28 +0,0 @@ -// void setCPU(){}; - -/* this function's Incoming arguments are a pointer to the Hardware class - "Hardware *pHardware" and the new mainclock speed -*/ -void setHardwaremanufacturer(Hardware *pHardware, std::string mmanufacturer) { -// cout << "Coming from the setHardwaremanufacturer function in setHardware" << endl; - -pHardware->manufacturer = mmanufacturer; -// cout << "Leaving setHardwaremanufacturer()\n\n"; -} - -void setHardwarereleasedyear(Hardware *pHardware, int mreleasedyear) { -pHardware->releasedyear = mreleasedyear; -} - -void setHardwaremodel(Hardware *pHardware, std::string mmodel) { - pHardware->model = mmodel; -} - -void Hardwaredictadd(CPU *pHardware, std::string mkey, std::string mvalue) { - - // cout << "The incoming key/value is: " << mkey << "/" << mvalue << endl; - // cout << "\nThe current manufacturer is: " << pHardware->HardwareSpecs[mkey] << endl; - pHardware->HardwareSpecs[mkey] = mvalue; - // cout << "The new manufacturer is: " << pHardware->HardwareSpecs[mkey]; - -} diff --git a/src/lists/cpu.h b/src/lists/cpu.h deleted file mode 100644 index 6a921f5..0000000 --- a/src/lists/cpu.h +++ /dev/null @@ -1,28 +0,0 @@ -#pragma once -#include -#include - -/* -* THIS PORTION OF CODE WAS DONATED BY szaszmango from brodie's server! -*/ - -// This magic returns a vector which contain all the objects created using the CPU class -std::vector genCPUclasses() { - std::vector resultCpuList; - std::ifstream cpuList{"lists/cpulist", std::ifstream::in}; - - if(cpuList.is_open()) { - std::cout << "File opened\n"; - } - else { std::cout << "Failed to open file!\n"; } - - std::string line; - while (std::getline(cpuList, line)) { - CPU cpu; - cpu.HardwareSpecs["model"] = line; - resultCpuList.push_back(std::move(cpu)); - std::cout << "Loaded CPU: " << line << std::endl; - } - - return resultCpuList; -} diff --git a/src/lists/hardware.h b/src/lists/hardware.h deleted file mode 100644 index 3b9b9c4..0000000 --- a/src/lists/hardware.h +++ /dev/null @@ -1,74 +0,0 @@ -#pragma once -#include -#include -#include - -// #define class struct // Uncomment this line to switch all the classes to structs - -// using namespace std; - -class Hardware { - - public: - std::string manufacturer; - std::string model; - int releasedyear; - - // example of how to set a dictionary item - // std::string myval = HardwareSpecs.at("manufacturer"); - -}; - -class Mobo: public Hardware { - public: - int pciegen; - int piceslots; - int dimmslots; - int dualchannel; // This is an int so 1 = dualchannel and 2 = quad channel - int ramspeed; - std::string comment; - - std::map HardwareSpecs = { - {"manufacturer", "The Gnomes part 2"}, - {"model", "Honey Bomb"}, - {"ReleasedYear", "2025"}, - {"pciegen", "4"}, - {"pcieslots", "3"}, - {"dimmslots", "2"}, - {"ramchannels", "2"}, - {"ramspeed", "6000"}, - {"comment", "If on AM5 platform - update BIOS before booting!"}, - }; -}; - -class CPU: public Hardware { - public: - std::map HardwareSpecs = { - {"manufacturer", "The Gnomes part 2"}, - {"model", "Honey Bomb"}, - {"ReleasedYear", "2025"}, - {"bits", "64"}, - {"igpu", "false"}, - {"igpusize", "N/A"}, - {"cores", "4"}, - {"threads", "8"}, - {"l1cache", "32Mb"}, - {"l2cache", "32Mb"}, - {"l3cache", "32Mb"}, - {"pcielanes", "24"}, - {"maxram", "256Gb"}, - {"mainclock", "3Ghz"}, - {"boostclock", "3.2Ghz"}, - {"architecture", "x86_64"}, - {"memoryrange", "00:00 - set me!"}, - {"microcode", "unchanged"}, - {"kerneldriver", "intel"}, - {"comment", "If on AM5 platform - update BIOS before booting!"}, - }; -}; - -class GPU: public Hardware { - public: - std::map GPUSpecs; - // GPUSpecs["Ram"] = GPU { "Ram", "12Gb" }; -}; diff --git a/src/main.cpp b/src/main.cpp index 2d48fb6..146e016 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -3,10 +3,10 @@ #include #include #include -#include "lists/hardware.h" -#include "lists/cpu.h" -#include "include/setcpu.h" -#include "include/sethardware.h" +// #include "lists/hardware.h" +// #include "lists/cpu.h" +// #include "include/setcpu.h" +// #include "include/sethardware.h" #include // Begin testing of SQLite3