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