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