1 #pragma once
2 
3 #include <string>
4 
5 #include "interfaces.hpp"
6 #include "sysfs/util.hpp"
7 
8 
9 /*
10  * A WriteInterface that is expecting a path that's sysfs, but really could be
11  * any filesystem path.
12  */
13 class SysFsWritePercent : public WriteInterface
14 {
15     public:
16         SysFsWritePercent(const std::string& writepath, int64_t min,
17                           int64_t max)
18             : WriteInterface(min, max),
19               _writepath(FixupPath(writepath))
20         { }
21 
22         void write(double value) override;
23 
24     private:
25         std::string _writepath;
26 };
27 
28 class SysFsWrite : public WriteInterface
29 {
30     public:
31         SysFsWrite(const std::string& writepath, int64_t min, int64_t max)
32             : WriteInterface(min, max),
33               _writepath(FixupPath(writepath))
34         { }
35 
36         void write(double value) override;
37 
38     private:
39         std::string _writepath;
40 };
41