Add documentation, cleanup
This commit is contained in:
22
app/include/sensor/HwmonSensor.h
Normal file
22
app/include/sensor/HwmonSensor.h
Normal file
@@ -0,0 +1,22 @@
|
||||
#ifndef HWMONSENSOR_H_
|
||||
#define HWMONSENSOR_H_
|
||||
|
||||
#include <sensors/sensors.h>
|
||||
|
||||
#include <sensor/Sensor.h>
|
||||
|
||||
class HwmonSensor : public Sensor {
|
||||
public:
|
||||
HwmonSensor(const sensors_chip_name *chipName, const sensors_feature *feature,
|
||||
const sensors_subfeature *subfeature);
|
||||
|
||||
int value() override;
|
||||
std::string name() override;
|
||||
|
||||
private:
|
||||
const sensors_chip_name *mChipName;
|
||||
const sensors_feature *mFeature;
|
||||
const sensors_subfeature *mSubFeature;
|
||||
};
|
||||
|
||||
#endif // HWMONSENSOR_H_
|
||||
@@ -1,23 +0,0 @@
|
||||
#ifndef HWMONTEMPERATURESENSOR_H_
|
||||
#define HWMONTEMPERATURESENSOR_H_
|
||||
|
||||
#include <sensors/sensors.h>
|
||||
|
||||
#include <sensor/TemperatureSensor.h>
|
||||
|
||||
class HwmonTemperatureSensor : public TemperatureSensor {
|
||||
public:
|
||||
HwmonTemperatureSensor(const sensors_chip_name *chipName,
|
||||
const sensors_feature *feature,
|
||||
const sensors_subfeature *subfeature);
|
||||
|
||||
int temperature() override;
|
||||
std::string name() override;
|
||||
|
||||
private:
|
||||
const sensors_chip_name *mChipName;
|
||||
const sensors_feature *mFeature;
|
||||
const sensors_subfeature *mSubFeature;
|
||||
};
|
||||
|
||||
#endif // HWMONTEMPERATURESENSOR_H_
|
||||
15
app/include/sensor/NvidiaSensor.h
Normal file
15
app/include/sensor/NvidiaSensor.h
Normal file
@@ -0,0 +1,15 @@
|
||||
#ifndef NVIDIASENSOR_H_
|
||||
#define NVIDIASENSOR_H_
|
||||
|
||||
#include <sensor/Sensor.h>
|
||||
|
||||
class NvidiaSensor : public Sensor {
|
||||
public:
|
||||
NvidiaSensor();
|
||||
~NvidiaSensor();
|
||||
|
||||
int value() override;
|
||||
std::string name() override;
|
||||
};
|
||||
|
||||
#endif // NVIDIASENSOR_H_
|
||||
@@ -1,15 +0,0 @@
|
||||
#ifndef NVIDIA_H_
|
||||
#define NVIDIA_H_
|
||||
|
||||
#include <sensor/TemperatureSensor.h>
|
||||
|
||||
class NvidiaTemperatureSensor : public TemperatureSensor {
|
||||
public:
|
||||
NvidiaTemperatureSensor();
|
||||
~NvidiaTemperatureSensor();
|
||||
|
||||
int temperature() override;
|
||||
std::string name() override;
|
||||
};
|
||||
|
||||
#endif // NVIDIA_H_
|
||||
15
app/include/sensor/Sensor.h
Normal file
15
app/include/sensor/Sensor.h
Normal file
@@ -0,0 +1,15 @@
|
||||
#ifndef SENSOR_H_
|
||||
#define SENSOR_H_
|
||||
|
||||
#include <iostream>
|
||||
|
||||
class Sensor {
|
||||
public:
|
||||
// Read the current value
|
||||
virtual int value() = 0;
|
||||
// Name for displaying. Should be descriptive, e.g. "GPU" or the label from
|
||||
// libsensors.
|
||||
virtual std::string name() = 0;
|
||||
};
|
||||
|
||||
#endif // SENSOR_H_
|
||||
@@ -1,12 +0,0 @@
|
||||
#ifndef TEMPERATURESENSOR_H_
|
||||
#define TEMPERATURESENSOR_H_
|
||||
|
||||
#include <iostream>
|
||||
|
||||
class TemperatureSensor {
|
||||
public:
|
||||
virtual int temperature() = 0;
|
||||
virtual std::string name() = 0;
|
||||
};
|
||||
|
||||
#endif // TEMPERATURESENSOR_H_
|
||||
Reference in New Issue
Block a user