Leosac
0.8.0
Open Source Access Control
|
Internal configuration helper for sysfsgpio module. More...
#include <SysFsGpioConfig.hpp>
Public Member Functions | |
SysFsGpioConfig (const boost::property_tree::ptree &cfg) | |
Construct the general config object from the configuration tree. More... | |
const std::string & | export_path () const |
Returns the absolute path to the "export" sysfs file. More... | |
const std::string & | unexport_path () const |
Returns the absolute path to the "unexport" sysfs file. More... | |
std::string | value_path (int pin_no) const |
Compute the absolute path the "value" file for pin_no. More... | |
std::string | edge_path (int pin_no) const |
Compute the absolute path the "edge" file for pin_no. More... | |
std::string | direction_path (int pin_no) const |
Compute the absolute path the "direction" file for pin_no. More... | |
Private Attributes | |
std::map< int, std::string > | pin_aliases_ |
Maps pin number to file identifier. More... | |
std::string | default_aliases_ |
Default aliases rule, as defined in configuration. More... | |
std::string | cfg_export_path_ |
Absolute path of the "export" sysfs file. More... | |
std::string | cfg_unexport_path_ |
Absolute path of the "unexport" sysfs file. More... | |
std::string | cfg_value_path_ |
Absolute path of the "value file" sysfs file: use __PLACEHOLDER__ as a placeholder for the PIN identifier (likely its number, potentially – prefixed by "gpio" on raspberry pi). More... | |
std::string | cfg_edge_path_ |
Absolute path to the "edge" file. More... | |
std::string | cfg_direction_path_ |
Absolute path to the "direction" file. More... | |
Internal configuration helper for sysfsgpio module.
This class provide a path resolution mechanism and aliases handling. It is implemented as an external object to ease testing.
Definition at line 40 of file SysFsGpioConfig.hpp.
SysFsGpioConfig::SysFsGpioConfig | ( | const boost::property_tree::ptree & | cfg | ) |
Construct the general config object from the configuration tree.
Definition at line 28 of file SysFsGpioConfig.cpp.
std::string SysFsGpioConfig::direction_path | ( | int | pin_no | ) | const |
Compute the absolute path the "direction" file for pin_no.
Definition at line 93 of file SysFsGpioConfig.cpp.
std::string SysFsGpioConfig::edge_path | ( | int | pin_no | ) | const |
Compute the absolute path the "edge" file for pin_no.
Definition at line 83 of file SysFsGpioConfig.cpp.
const std::string & SysFsGpioConfig::export_path | ( | ) | const |
Returns the absolute path to the "export" sysfs file.
Definition at line 63 of file SysFsGpioConfig.cpp.
const std::string & SysFsGpioConfig::unexport_path | ( | ) | const |
Returns the absolute path to the "unexport" sysfs file.
Definition at line 68 of file SysFsGpioConfig.cpp.
std::string SysFsGpioConfig::value_path | ( | int | pin_no | ) | const |
Compute the absolute path the "value" file for pin_no.
Definition at line 73 of file SysFsGpioConfig.cpp.
|
private |
Absolute path to the "direction" file.
Definition at line 111 of file SysFsGpioConfig.hpp.
|
private |
Absolute path to the "edge" file.
Definition at line 106 of file SysFsGpioConfig.hpp.
|
private |
Absolute path of the "export" sysfs file.
Definition at line 88 of file SysFsGpioConfig.hpp.
|
private |
Absolute path of the "unexport" sysfs file.
Definition at line 93 of file SysFsGpioConfig.hpp.
|
private |
Absolute path of the "value file" sysfs file: use __PLACEHOLDER__
as a placeholder for the PIN identifier (likely its number, potentially – prefixed by "gpio" on raspberry pi).
Definition at line 101 of file SysFsGpioConfig.hpp.
|
private |
Default aliases rule, as defined in configuration.
Definition at line 83 of file SysFsGpioConfig.hpp.
|
private |
Maps pin number to file identifier.
Definition at line 78 of file SysFsGpioConfig.hpp.