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