Patrick Venture | 863b924 | 2018-03-08 08:29:23 -0800 | [diff] [blame] | 1 | #pragma once |
2 | |||||
Patrick Venture | 863b924 | 2018-03-08 08:29:23 -0800 | [diff] [blame] | 3 | #include "interfaces.hpp" |
James Feist | 0c8223b | 2019-05-08 15:33:33 -0700 | [diff] [blame] | 4 | #include "util.hpp" |
Patrick Venture | 863b924 | 2018-03-08 08:29:23 -0800 | [diff] [blame] | 5 | |
Patrick Venture | da4a5dd | 2018-08-31 09:42:48 -0700 | [diff] [blame] | 6 | #include <string> |
Patrick Venture | 863b924 | 2018-03-08 08:29:23 -0800 | [diff] [blame] | 7 | |
Patrick Venture | a076487 | 2020-08-08 07:48:43 -0700 | [diff] [blame] | 8 | namespace pid_control |
9 | { | ||||
10 | |||||
Patrick Venture | 863b924 | 2018-03-08 08:29:23 -0800 | [diff] [blame] | 11 | /* |
12 | * A ReadInterface that is expecting a path that's sysfs, but really could be | ||||
13 | * any filesystem path. | ||||
14 | */ | ||||
15 | class SysFsRead : public ReadInterface | ||||
16 | { | ||||
Patrick Venture | da4a5dd | 2018-08-31 09:42:48 -0700 | [diff] [blame] | 17 | public: |
Patrick Venture | 3c2564c | 2020-08-10 12:46:46 -0700 | [diff] [blame] | 18 | explicit SysFsRead(const std::string& path) : |
19 | ReadInterface(), _path(FixupPath(path)) | ||||
Patrick Venture | a83a3ec | 2020-08-04 09:52:05 -0700 | [diff] [blame] | 20 | {} |
Patrick Venture | 863b924 | 2018-03-08 08:29:23 -0800 | [diff] [blame] | 21 | |
Patrick Venture | da4a5dd | 2018-08-31 09:42:48 -0700 | [diff] [blame] | 22 | ReadReturn read(void) override; |
Patrick Venture | 863b924 | 2018-03-08 08:29:23 -0800 | [diff] [blame] | 23 | |
Patrick Venture | da4a5dd | 2018-08-31 09:42:48 -0700 | [diff] [blame] | 24 | private: |
25 | const std::string _path; | ||||
Patrick Venture | 863b924 | 2018-03-08 08:29:23 -0800 | [diff] [blame] | 26 | }; |
Patrick Venture | a076487 | 2020-08-08 07:48:43 -0700 | [diff] [blame] | 27 | |
28 | } // namespace pid_control |