Implementation class for numeric configuration entries, templated by the integer type.
More...
#include <ConfigEntry.hxx>
|
| constexpr unsigned | end_offset () const |
| |
| TR | read (int fd) const |
| | Reads the data from the configuration file.
|
| |
| TR | read_or_write_trimmed (int fd, TR min_value, TR max_value) |
| | Reads data from configuration file obeying a specific trimming.
|
| |
| TR | read_or_write_default (int fd, TR min_value, TR max_value, TR def_value) |
| | Reads data from configuration file if the value is valid.
|
| |
| void | write (int fd, TR d) const |
| | Writes the data to the configuration file.
|
| |
| 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 |
| |
|
| 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.
|
| |
| unsigned | offset_ |
| | zero-based offset from the beginning of the configuration file.
|
| |
template<class TR>
class openlcb::NumericConfigEntry< TR >
Implementation class for numeric configuration entries, templated by the integer type.
Definition at line 150 of file ConfigEntry.hxx.
◆ config_renderer()
◆ end_offset()
◆ endian_convert() [1/8]
Performs endian conversion.
- Parameters
-
- Returns
- host-byte-order data
Definition at line 212 of file ConfigEntry.hxx.
◆ endian_convert() [2/8]
Performs endian conversion.
- Parameters
-
- Returns
- host-byte-order data
Definition at line 222 of file ConfigEntry.hxx.
◆ endian_convert() [3/8]
Performs endian conversion.
- Parameters
-
- Returns
- host-byte-order data
Definition at line 232 of file ConfigEntry.hxx.
◆ endian_convert() [4/8]
Performs endian conversion.
- Parameters
-
- Returns
- host-byte-order data
Definition at line 202 of file ConfigEntry.hxx.
◆ endian_convert() [5/8]
Performs endian conversion.
- Parameters
-
- Returns
- host-byte-order data
Definition at line 171 of file ConfigEntry.hxx.
◆ endian_convert() [6/8]
Performs endian conversion.
- Parameters
-
- Returns
- host-byte-order data
Definition at line 181 of file ConfigEntry.hxx.
◆ endian_convert() [7/8]
Performs endian conversion.
- Parameters
-
- Returns
- host-byte-order data
Definition at line 191 of file ConfigEntry.hxx.
◆ endian_convert() [8/8]
Performs endian conversion.
- Parameters
-
- Returns
- host-byte-order data
Definition at line 161 of file ConfigEntry.hxx.
◆ read()
Reads the data from the configuration file.
- Parameters
-
| fd | file descriptor of the config file. |
- Returns
- value of the configuration atom that *this represents.
Definition at line 263 of file ConfigEntry.hxx.
◆ read_or_write_default()
Reads data from configuration file if the value is valid.
If the value violates the trimming constraints, the configuration file will be overwritten with the default value.
- Parameters
-
| fd | the descriptor of the config file. |
| min_value | minimum acceptable value |
| max_value | maximum acceptable value |
| def_value | default value to write when out of range |
- Returns
- current value after trimming.
Definition at line 298 of file ConfigEntry.hxx.
◆ read_or_write_trimmed()
Reads data from configuration file obeying a specific trimming.
If the value violates the trimming constraints, the configuration file will be overwritten with a trimmed value.
- Parameters
-
| fd | the descriptor of the config file. |
| min_value | minimum acceptable value |
| max_value | maximum acceptable value |
- Returns
- current value after trimming.
Definition at line 276 of file ConfigEntry.hxx.
◆ size()
Storage bytes occupied by the instance in the config file.
- Returns
- number of bytes that the config parser offset will be incremented by this entry.
Definition at line 242 of file ConfigEntry.hxx.
◆ write()
Writes the data to the configuration file.
- Parameters
-
| fd | file descriptor of the config file. |
| value | of the configuration atom that should be written. |
Definition at line 315 of file ConfigEntry.hxx.
The documentation for this class was generated from the following file: