1863b9246SPatrick Venture #pragma once
2863b9246SPatrick Venture 
3863b9246SPatrick Venture #include "interfaces.hpp"
40c8223b5SJames Feist #include "util.hpp"
5863b9246SPatrick Venture 
6da4a5dd1SPatrick Venture #include <string>
7863b9246SPatrick Venture 
8*a076487aSPatrick Venture namespace pid_control
9*a076487aSPatrick Venture {
10*a076487aSPatrick Venture 
11863b9246SPatrick Venture /*
12863b9246SPatrick Venture  * A WriteInterface that is expecting a path that's sysfs, but really could be
13863b9246SPatrick Venture  * any filesystem path.
14863b9246SPatrick Venture  */
15863b9246SPatrick Venture class SysFsWritePercent : public WriteInterface
16863b9246SPatrick Venture {
17863b9246SPatrick Venture   public:
SysFsWritePercent(const std::string & writePath,int64_t min,int64_t max)18a1c5d374SPatrick Venture     SysFsWritePercent(const std::string& writePath, int64_t min, int64_t max) :
19a1c5d374SPatrick Venture         WriteInterface(min, max), _writePath(FixupPath(writePath))
20a83a3eccSPatrick Venture     {}
21863b9246SPatrick Venture 
22863b9246SPatrick Venture     void write(double value) override;
23863b9246SPatrick Venture 
24863b9246SPatrick Venture   private:
25a1c5d374SPatrick Venture     std::string _writePath;
26863b9246SPatrick Venture };
27863b9246SPatrick Venture 
28863b9246SPatrick Venture class SysFsWrite : public WriteInterface
29863b9246SPatrick Venture {
30863b9246SPatrick Venture   public:
SysFsWrite(const std::string & writePath,int64_t min,int64_t max)31a1c5d374SPatrick Venture     SysFsWrite(const std::string& writePath, int64_t min, int64_t max) :
32a1c5d374SPatrick Venture         WriteInterface(min, max), _writePath(FixupPath(writePath))
33a83a3eccSPatrick Venture     {}
34863b9246SPatrick Venture 
35863b9246SPatrick Venture     void write(double value) override;
36863b9246SPatrick Venture 
37863b9246SPatrick Venture   private:
38a1c5d374SPatrick Venture     std::string _writePath;
39863b9246SPatrick Venture };
40*a076487aSPatrick Venture 
41*a076487aSPatrick Venture } // namespace pid_control
42