1 #pragma once
2 
3 #include "interfaces.hpp"
4 #include "util.hpp"
5 
6 #include <string>
7 
8 namespace pid_control
9 {
10 
11 /*
12  * A WriteInterface that is expecting a path that's sysfs, but really could be
13  * any filesystem path.
14  */
15 class SysFsWritePercent : public WriteInterface
16 {
17   public:
SysFsWritePercent(const std::string & writePath,int64_t min,int64_t max)18     SysFsWritePercent(const std::string& writePath, int64_t min, int64_t max) :
19         WriteInterface(min, max), _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:
SysFsWrite(const std::string & writePath,int64_t min,int64_t max)31     SysFsWrite(const std::string& writePath, int64_t min, int64_t max) :
32         WriteInterface(min, max), _writePath(FixupPath(writePath))
33     {}
34 
35     void write(double value) override;
36 
37   private:
38     std::string _writePath;
39 };
40 
41 } // namespace pid_control
42