blob: 32ce18e9e9dae983424a2959d55f55708e1a5fdb [file] [log] [blame]
Patrick Venture863b9242018-03-08 08:29:23 -08001#pragma once
2
Patrick Venture863b9242018-03-08 08:29:23 -08003#include "interfaces.hpp"
James Feist0c8223b2019-05-08 15:33:33 -07004#include "util.hpp"
Patrick Venture863b9242018-03-08 08:29:23 -08005
Patrick Ventureda4a5dd2018-08-31 09:42:48 -07006#include <string>
Patrick Venture863b9242018-03-08 08:29:23 -08007
Patrick Venturea0764872020-08-08 07:48:43 -07008namespace pid_control
9{
10
Patrick Venture863b9242018-03-08 08:29:23 -080011/*
12 * A ReadInterface that is expecting a path that's sysfs, but really could be
13 * any filesystem path.
14 */
15class SysFsRead : public ReadInterface
16{
Patrick Ventureda4a5dd2018-08-31 09:42:48 -070017 public:
Patrick Venture3c2564c2020-08-10 12:46:46 -070018 explicit SysFsRead(const std::string& path) :
19 ReadInterface(), _path(FixupPath(path))
Patrick Venturea83a3ec2020-08-04 09:52:05 -070020 {}
Patrick Venture863b9242018-03-08 08:29:23 -080021
Patrick Ventureda4a5dd2018-08-31 09:42:48 -070022 ReadReturn read(void) override;
Patrick Venture863b9242018-03-08 08:29:23 -080023
Patrick Ventureda4a5dd2018-08-31 09:42:48 -070024 private:
25 const std::string _path;
Patrick Venture863b9242018-03-08 08:29:23 -080026};
Patrick Venturea0764872020-08-08 07:48:43 -070027
28} // namespace pid_control