1863b9246SPatrick Venture #pragma once 2863b9246SPatrick Venture 3863b9246SPatrick Venture #include "interfaces.hpp" 40c8223b5SJames Feist #include "util.hpp" 5863b9246SPatrick Venture 6da4a5dd1SPatrick Venture #include <string> 7863b9246SPatrick Venture 8863b9246SPatrick Venture /* 9863b9246SPatrick Venture * A WriteInterface that is expecting a path that's sysfs, but really could be 10863b9246SPatrick Venture * any filesystem path. 11863b9246SPatrick Venture */ 12863b9246SPatrick Venture class SysFsWritePercent : public WriteInterface 13863b9246SPatrick Venture { 14863b9246SPatrick Venture public: 15a1c5d374SPatrick Venture SysFsWritePercent(const std::string& writePath, int64_t min, int64_t max) : 16a1c5d374SPatrick Venture WriteInterface(min, max), _writePath(FixupPath(writePath)) 17*a83a3eccSPatrick Venture {} 18863b9246SPatrick Venture 19863b9246SPatrick Venture void write(double value) override; 20863b9246SPatrick Venture 21863b9246SPatrick Venture private: 22a1c5d374SPatrick Venture std::string _writePath; 23863b9246SPatrick Venture }; 24863b9246SPatrick Venture 25863b9246SPatrick Venture class SysFsWrite : public WriteInterface 26863b9246SPatrick Venture { 27863b9246SPatrick Venture public: 28a1c5d374SPatrick Venture SysFsWrite(const std::string& writePath, int64_t min, int64_t max) : 29a1c5d374SPatrick Venture WriteInterface(min, max), _writePath(FixupPath(writePath)) 30*a83a3eccSPatrick Venture {} 31863b9246SPatrick Venture 32863b9246SPatrick Venture void write(double value) override; 33863b9246SPatrick Venture 34863b9246SPatrick Venture private: 35a1c5d374SPatrick Venture std::string _writePath; 36863b9246SPatrick Venture }; 37