Working on making the project modular - being able to fetch cpu,gpu
seperately. and keep everything clean
This commit is contained in:
parent
788982fe4e
commit
fc7454b099
10
lists/cpu.h
Normal file
10
lists/cpu.h
Normal file
@ -0,0 +1,10 @@
|
||||
#pragma once
|
||||
#include "hardware.h"
|
||||
|
||||
CPU A7800x3d;
|
||||
A7800x3d.manufacturer = "AMD";
|
||||
A7800x3d.ReleasedYear = 2024;
|
||||
A7800x3d.architecture = "Zen 4";
|
||||
A7800x3d.boostclock = 5.2;
|
||||
A7800x3d.mainclock = 4.8;
|
||||
|
||||
40
lists/hardware.h
Normal file
40
lists/hardware.h
Normal file
@ -0,0 +1,40 @@
|
||||
|
||||
#pragma once
|
||||
using namespace std;
|
||||
|
||||
class Hardware {
|
||||
|
||||
public:
|
||||
std::string manufacturer;
|
||||
std::string model;
|
||||
int ReleasedYear;
|
||||
};
|
||||
|
||||
class CPU: public Hardware {
|
||||
public:
|
||||
bool Bit64;
|
||||
int cores;
|
||||
int threads;
|
||||
int pcielanes;
|
||||
int maxram;
|
||||
float mainclock;
|
||||
float boostclock;
|
||||
std::string architecture;
|
||||
|
||||
std::string getmanufacturer(std::string manufacturer){
|
||||
return manufacturer;
|
||||
};
|
||||
};
|
||||
|
||||
std::string a7800x3d(std::string man){
|
||||
CPU A7800x3d;
|
||||
A7800x3d.manufacturer = "AMD";
|
||||
return man;
|
||||
};
|
||||
|
||||
// CPU A7800x3d;
|
||||
// A7800x3d.manufacturer = "AMD";
|
||||
// A7800x3d.ReleasedYear = 2024;
|
||||
// A7800x3d.architecture = "Zen 4";
|
||||
// A7800x3d.boostclock = 5.2;
|
||||
// A7800x3d.mainclock = 4.8;
|
||||
44
main.cpp
44
main.cpp
@ -1,39 +1,29 @@
|
||||
#include <iostream>
|
||||
#include <string>
|
||||
#include "lists/hardware.h"
|
||||
|
||||
class Hardware {
|
||||
public:
|
||||
std::string manufacturer;
|
||||
std::string model;
|
||||
int ReleasedYear;
|
||||
};
|
||||
|
||||
class CPU: public Hardware {
|
||||
public:
|
||||
bool Bit64;
|
||||
int cores;
|
||||
int threads;
|
||||
int pcielanes;
|
||||
int maxram;
|
||||
float mainclock;
|
||||
float boostclock;
|
||||
std::string architecture;
|
||||
};
|
||||
// std::string a7800x3d(std::string man){
|
||||
// CPU A7800x3d;
|
||||
// A7800x3d.manufacturer = "AMD";
|
||||
// return man;
|
||||
// };
|
||||
|
||||
int main() {
|
||||
|
||||
using namespace std;
|
||||
|
||||
// CPU A7800x3d;
|
||||
// A7800x3d.manufacturer = "AMD";
|
||||
// A7800x3d.ReleasedYear = 2024;
|
||||
// A7800x3d.architecture = "Zen 4";
|
||||
// A7800x3d.boostclock = 5.2;
|
||||
// A7800x3d.mainclock = 4.8;
|
||||
|
||||
CPU A7800x3d;
|
||||
A7800x3d.manufacturer = "AMD";
|
||||
A7800x3d.ReleasedYear = 2024;
|
||||
A7800x3d.architecture = "Zen 4";
|
||||
A7800x3d.boostclock = 5.2;
|
||||
A7800x3d.mainclock = 4.8;
|
||||
cout << a7800x3d("AMD");
|
||||
|
||||
cout << "The Manufacturer is: " << A7800x3d.manufacturer << endl;
|
||||
cout << "The Main Clock Speed is: " << A7800x3d.mainclock << endl;
|
||||
cout << "The Boost Clock Speed is: " << A7800x3d.boostclock << endl;
|
||||
// cout << "The Manufacturer is: " << A7800x3d.manufacturer << endl;
|
||||
// cout << "The Main Clock Speed is: " << A7800x3d.mainclock << endl;
|
||||
// cout << "The Boost Clock Speed is: " << A7800x3d.boostclock << endl;
|
||||
|
||||
system("sleep 3s");
|
||||
return 0;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user