diff --git a/include/setcpu.h b/include/setcpu.h index 5fa124f..2188c5a 100644 --- a/include/setcpu.h +++ b/include/setcpu.h @@ -28,8 +28,4 @@ void setCPUthreads(CPU *pCPU, int mthreads) { pCPU->threads = mthreads; // create an IF catch to set threads cores * 2 as a fall back } -void setCPUmanufacturer(CPU *pCPU, std::string mmanufacturer) { - pCPU->manufacturer = mmanufacturer; -} - diff --git a/include/sethardware.h b/include/sethardware.h new file mode 100644 index 0000000..0e14393 --- /dev/null +++ b/include/sethardware.h @@ -0,0 +1,28 @@ +// 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, 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, string mmodel) { + pHardware->model = mmodel; +} + +void Hardwaredictadd(CPU *pHardware, string mkey, 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/lists/hardware.h b/lists/hardware.h index 77b5717..74e3dd1 100644 --- a/lists/hardware.h +++ b/lists/hardware.h @@ -1,5 +1,10 @@ - #pragma once +#include +#include +#include + +// #define class struct // Uncomment this line to switch all the classes to structs + using namespace std; class Hardware { @@ -7,7 +12,17 @@ class Hardware { public: std::string manufacturer; std::string model; - int ReleasedYear; + int releasedyear; + + std::map HardwareSpecs = { + {"manufacturer", "The Gnomes"}, + {"model", "Honey Bomb"}, + {"ReleasedYear", "2025"}, + }; + + std::string myval = HardwareSpecs.at("manufacturer"); + // HardwareSpecs.at("manufacturer") = "tester"; + }; class Mobo: public Hardware { @@ -21,7 +36,7 @@ class Mobo: public Hardware { Mobo() { manufacturer = "Forest Gnomes"; model = "HoneyJar"; - ReleasedYear = 2025; + releasedyear = 2025; pciegen = 4; piceslots = 3; dimmslots = 2; @@ -54,7 +69,7 @@ class CPU: public Hardware { CPU() { manufacturer = "Forest Gnomes"; model = "HoneyPot"; - ReleasedYear = 2025; + releasedyear = 2025; bits64 = true; igpu = false; igpusize = 0; @@ -74,3 +89,9 @@ class CPU: public Hardware { comment = ""; }; }; + +class GPU: public Hardware { + public: + map GPUSpecs; + // GPUSpecs["Ram"] = GPU { "Ram", "12Gb" }; +}; diff --git a/main.cpp b/main.cpp index 1362803..63cd6ab 100644 --- a/main.cpp +++ b/main.cpp @@ -3,6 +3,7 @@ #include "lists/hardware.h" #include "lists/cpu.h" #include "include/setcpu.h" +#include "include/sethardware.h" void* ptr = &A7800x3d; @@ -21,18 +22,22 @@ int main() { // A7800x3d->manufacturer = "AMD"; // Cat out both CPU's that have been created for sanity - cout << "IIi75820k manufacturer is: " << Ii75820k->manufacturer << endl; + cout << "i75820k manufacturer is: " << Ii75820k->manufacturer << endl; cout << "A7800x3d manufacturer is: " << A7800x3d->manufacturer << endl; cout << "Lets try the setCPU function!\n"; cout << "A7800x3d main clock speed is: " << A7800x3d->mainclock << endl; - setCPUmanufacturer(A7800x3d, "AMD"); + setHardwaremanufacturer(A7800x3d, "AMD"); setCPUcores(A7800x3d, 8); setCPUthreads(A7800x3d, 16); setCPUclock(A7800x3d, 4.8, 5.1); // clock is base, boost cout << "A7800x3d new main clock speed is: " << A7800x3d->mainclock << endl; - cout << "A7800x3d manufacturer is: " << A7800x3d->manufacturer << endl; + cout << "A7800x3d manufacturer is: " << A7800x3d->manufacturer << "\n\n\n"; + +// Start of Hardware Dictionary Test +// Hardwaredictadd(A7800x3d, "manufacturer", "Ganome Himself"); + system("sleep 3s"); return 0; }