Moved CPU declarations back into main.
This commit is contained in:
parent
1f8cafa30c
commit
cae63ebe2a
16
lists/cpu.h
16
lists/cpu.h
@ -1,14 +1,24 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
#include "hardware.h"
|
#include "hardware.h"
|
||||||
|
using namespace std;
|
||||||
|
|
||||||
|
CPU i75820k;
|
||||||
|
|
||||||
|
|
||||||
void a7800x3d(){CPU A7800x3d;};
|
// Testing a function to create the class - cant access the class from main function though.
|
||||||
|
void a7800x3d(){
|
||||||
|
CPU A7800x3d;
|
||||||
|
cout << "Initial Main Clock: " << A7800x3d.mainclock << "\n" << A7800x3d.boostclock << endl;
|
||||||
|
};
|
||||||
|
|
||||||
float a7800x3d(float mainclock, float boostclock){
|
void a7800x3d(float mainclock, float boostclock){
|
||||||
CPU A7800x3d;
|
CPU A7800x3d;
|
||||||
A7800x3d.mainclock = mainclock;
|
A7800x3d.mainclock = mainclock;
|
||||||
A7800x3d.boostclock = boostclock;
|
A7800x3d.boostclock = boostclock;
|
||||||
return mainclock,boostclock;
|
|
||||||
|
std::cout << "Main clock is: " << A7800x3d.mainclock << "\nBoost clock is: " << A7800x3d.boostclock << endl;
|
||||||
|
|
||||||
|
// return mainclock, boostclock;
|
||||||
};
|
};
|
||||||
|
|
||||||
std::string a7800x3d(std::string man){
|
std::string a7800x3d(std::string man){
|
||||||
|
|||||||
@ -20,6 +20,7 @@ class CPU: public Hardware {
|
|||||||
float mainclock;
|
float mainclock;
|
||||||
float boostclock;
|
float boostclock;
|
||||||
std::string architecture;
|
std::string architecture;
|
||||||
|
std::string memoryrange;
|
||||||
|
|
||||||
std::string getmanufacturer(std::string manufacturer){
|
std::string getmanufacturer(std::string manufacturer){
|
||||||
return manufacturer;
|
return manufacturer;
|
||||||
|
|||||||
20
main.cpp
20
main.cpp
@ -3,6 +3,14 @@
|
|||||||
#include "lists/hardware.h"
|
#include "lists/hardware.h"
|
||||||
#include "lists/cpu.h"
|
#include "lists/cpu.h"
|
||||||
|
|
||||||
|
void setupCPU(std::string model, float mainclock, int cores){
|
||||||
|
i75820k.model = model;
|
||||||
|
i75820k.mainclock = mainclock;
|
||||||
|
i75820k.cores = cores;
|
||||||
|
};
|
||||||
|
//
|
||||||
|
|
||||||
|
|
||||||
int main() {
|
int main() {
|
||||||
|
|
||||||
using namespace std;
|
using namespace std;
|
||||||
@ -15,11 +23,15 @@ int main() {
|
|||||||
A7800x3d.boostclock = 5.2;
|
A7800x3d.boostclock = 5.2;
|
||||||
A7800x3d.mainclock = 4.8;
|
A7800x3d.mainclock = 4.8;
|
||||||
*/
|
*/
|
||||||
// referencing the function a7800x3d from cpu.h
|
// referencing the function a7800x3d from cpu.h and initialize the class
|
||||||
a7800x3d("AMD");
|
// a7800x3d();
|
||||||
|
// a7800x3d(4.8, 5.2);
|
||||||
|
|
||||||
cout << "Setting 7800x3d Manufacturer to AMD : " << a7800x3d("test") << endl;
|
setupCPU("i75820k", 3.2, 6);
|
||||||
cout << "Setting the clock speeds to: Main: " << a7800x3d(4.8,5.2) << endl;
|
cout << "cores: " << i75820k.cores << endl;
|
||||||
|
|
||||||
|
// cout << "Setting 7800x3d Manufacturer to AMD : " << a7800x3d("test") << endl;
|
||||||
|
// cout << "Setting the clock speeds to: Main: " << a7800x3d(4.8,5.2) << endl;
|
||||||
|
|
||||||
// cout << "The Manufacturer is: " << A7800x3d.manufacturer << endl;
|
// cout << "The Manufacturer is: " << A7800x3d.manufacturer << endl;
|
||||||
// cout << "The Main Clock Speed is: " << A7800x3d.mainclock << endl;
|
// cout << "The Main Clock Speed is: " << A7800x3d.mainclock << endl;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user