diff options
author | arjan <arjan@arjan-desktop.localdomain> | 2010-08-24 14:42:43 -0700 |
---|---|---|
committer | arjan <arjan@arjan-desktop.localdomain> | 2010-08-24 14:42:43 -0700 |
commit | 885057d7a70bad099a8a209f27b23cfe20048630 (patch) | |
tree | 6b99f83eb44eef19e237e57d319987f4bb1d8c65 /cpu | |
parent | 89f3241736d3d73b4abbd3fef9bff0470a5bcc8f (diff) | |
download | powertop-885057d7a70bad099a8a209f27b23cfe20048630.tar.gz |
allow for multiple result inputs into the power function
Diffstat (limited to 'cpu')
-rw-r--r-- | cpu/cpudevice.cpp | 20 | ||||
-rw-r--r-- | cpu/cpudevice.h | 28 |
2 files changed, 48 insertions, 0 deletions
diff --git a/cpu/cpudevice.cpp b/cpu/cpudevice.cpp new file mode 100644 index 0000000..7f7dd8d --- /dev/null +++ b/cpu/cpudevice.cpp @@ -0,0 +1,20 @@ +#include "cpudevice.h" +#include <string.h> + + +cpudevice::cpudevice(const char *classname, const char *device_name) +{ + strcpy(_class, classname); + strcpy(_cpuname, device_name); +} + + +double cpudevice::power_usage(struct result_bundle *result, struct parameter_bundle *bundle) +{ + double power = 0; + + double factor; + + return 0; +} + diff --git a/cpu/cpudevice.h b/cpu/cpudevice.h new file mode 100644 index 0000000..b8fe7f1 --- /dev/null +++ b/cpu/cpudevice.h @@ -0,0 +1,28 @@ +#ifndef _INCLUDE_GUARD_CPUDEVICE_H +#define _INCLUDE_GUARD_CPUDEVICE_H + +#include <vector> +#include <string> + +using namespace std; + +#include "../devices/device.h" + +class cpudevice: public device { + char _class[128]; + char _cpuname[128]; + + vector<string> params; +public: + cpudevice(const char *classname = "cpu", const char *device_name = "cpu0"); + virtual const char * class_name(void) { return _class;}; + + virtual const char * device_name(void) {return _cpuname;}; + + virtual double power_usage(struct result_bundle *result, struct parameter_bundle *bundle); + + void give_param(string param); +}; + + +#endif
\ No newline at end of file |