Kea 2.7.6
|
A template class that stores named elements of a given data type. More...
#include <dhcp_parsers.h>
Public Member Functions | |
void | clear () |
Deletes all of the entries from the store. | |
void | delParam (const std::string &name) |
Remove the parameter from the store. | |
ValueType | getOptionalParam (const std::string &name, const ValueType &default_value) const |
Returns the data value for an optional parameter. | |
ValueType | getParam (const std::string &name) const |
Returns the data value for the given parameter. | |
const data::Element::Position & | getPosition (const std::string &name, const data::ConstElementPtr parent=data::ConstElementPtr()) const |
Returns position of the data element in the configuration string. | |
void | setParam (const std::string &name, const ValueType &value, const data::Element::Position &position) |
Stores the parameter, its value and the position in the store. | |
A template class that stores named elements of a given data type.
This template class is provides data value storage for configuration parameters of a given data type. The values are stored by parameter name and as instances of type "ValueType". Each value held in the storage has a corresponding position within a configuration string (file) specified as a: file name, line number and position within the line. The position information is used for logging when the particular configuration value causes a configuration error.
ValueType | is the data type of the elements to store. |
Definition at line 56 of file dhcp_parsers.h.
|
inline |
Deletes all of the entries from the store.
Definition at line 156 of file dhcp_parsers.h.
|
inline |
Remove the parameter from the store.
Deletes the entry for the given parameter from the store if it exists.
name | is the name of the parameter to delete. |
Definition at line 149 of file dhcp_parsers.h.
|
inline |
Returns the data value for an optional parameter.
Finds and returns the data value for the given parameter or a supplied default value if it is not found.
name | is the name of the parameter for which the data value is desired. |
default_value | value to use the default |
ValueType
. Definition at line 131 of file dhcp_parsers.h.
|
inline |
Returns the data value for the given parameter.
Finds and returns the data value for the given parameter.
name | is the name of the parameter for which the data value is desired. |
ValueType
. DhcpConfigError | if the parameter is not found. |
Definition at line 83 of file dhcp_parsers.h.
References isc_throw.
|
inline |
Returns position of the data element in the configuration string.
The returned object comprises file name, line number and the position within the particular line of the configuration string where the data element holding a particular value is located.
name | is the name of the parameter which position is desired. |
parent | Pointer to a data element which position should be returned when position of the specified parameter is not found. |
Definition at line 109 of file dhcp_parsers.h.
References isc::data::Element::ZERO_POSITION().
|
inline |
Stores the parameter, its value and the position in the store.
If the parameter does not exist in the store, then it will be added, otherwise its data value and the position will be updated with the given values.
name | is the name of the parameter to store. |
value | is the data value to store. |
position | is the position of the data element within a configuration string (file). |
Definition at line 69 of file dhcp_parsers.h.