|
Open Model Railroad Network (OpenMRN)
|
Base class for individual configuration entries. More...
#include <ConfigEntry.hxx>
Static Public Member Functions | |
| template<typename... Args> | |
| static constexpr GroupConfigOptions | group_opts (Args... args) |
| static void | handle_events (const EventOffsetCallback &fn) |
Protected Member Functions | |
| template<class T > | |
| T | raw_read (int fd) const |
| Reads a given typed variable from the configuration file. | |
| template<class T > | |
| void | raw_write (int fd, const T &value) const |
| Writes a given typed variable to the configuration file. | |
| void | repeated_read (int fd, void *buf, size_t size) const |
| Performs a reliable read from the given FD. | |
| void | repeated_write (int fd, const void *buf, size_t size) const |
| Performs a reliable write to the given FD. | |
Additional Inherited Members | |
Public Member Functions inherited from openlcb::ConfigReference | |
| constexpr | ConfigReference (unsigned offset) |
| Initializes the config reference from a configuration space offset. | |
| constexpr | ConfigReference (const ConfigReference &ref) |
| Initializes the config reference from an existing config reference. | |
| constexpr unsigned | offset () const |
Protected Attributes inherited from openlcb::ConfigReference | |
| unsigned | offset_ |
| zero-based offset from the beginning of the configuration file. | |
Base class for individual configuration entries.
Defines helper methods for reading and writing.
Definition at line 91 of file ConfigEntry.hxx.
|
inlinestaticconstexpr |
Definition at line 97 of file ConfigEntry.hxx.
|
inlinestatic |
Definition at line 102 of file ConfigEntry.hxx.
|
inlineprotected |
Reads a given typed variable from the configuration file.
DOes not do any binary conversion (only reads raw data).
| fd | file to read data from. |
Definition at line 112 of file ConfigEntry.hxx.
|
inlineprotected |
Writes a given typed variable to the configuration file.
Does not do any binary conversion.
| fd | file to write data to. |
| value | the raw value to write to the configuration file. |
Definition at line 126 of file ConfigEntry.hxx.
|
protected |
Performs a reliable read from the given FD.
Crashes if the read fails.
| fd | the file to read data from |
| buf | the location to write data to |
| size | how many bytes to read |
Definition at line 45 of file ConfigEntry.cxx.
|
protected |
Performs a reliable write to the given FD.
Crashes if the write fails.
| fd | the file to write data to |
| buf | the location of the data to write |
| size | how many bytes to write |
Definition at line 52 of file ConfigEntry.cxx.