1863b9246SPatrick Venture #pragma once 2863b9246SPatrick Venture 3863b9246SPatrick Venture #include "interfaces.hpp" 4*0c8223b5SJames 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)) 17da4a5dd1SPatrick Venture { 18da4a5dd1SPatrick Venture } 19863b9246SPatrick Venture 20863b9246SPatrick Venture void write(double value) override; 21863b9246SPatrick Venture 22863b9246SPatrick Venture private: 23a1c5d374SPatrick Venture std::string _writePath; 24863b9246SPatrick Venture }; 25863b9246SPatrick Venture 26863b9246SPatrick Venture class SysFsWrite : public WriteInterface 27863b9246SPatrick Venture { 28863b9246SPatrick Venture public: 29a1c5d374SPatrick Venture SysFsWrite(const std::string& writePath, int64_t min, int64_t max) : 30a1c5d374SPatrick Venture WriteInterface(min, max), _writePath(FixupPath(writePath)) 31da4a5dd1SPatrick Venture { 32da4a5dd1SPatrick Venture } 33863b9246SPatrick Venture 34863b9246SPatrick Venture void write(double value) override; 35863b9246SPatrick Venture 36863b9246SPatrick Venture private: 37a1c5d374SPatrick Venture std::string _writePath; 38863b9246SPatrick Venture }; 39