![]() |
Kea
1.5.0
|
This template specifies a parameter value. More...
#include <triplet.h>
Public Member Functions | |
| Triplet () | |
| Constructor without parameters. More... | |
| Triplet (T min, T def, T max) | |
| Sets the default value and thresholds. More... | |
| Triplet (T value) | |
| Sets a fixed value. More... | |
| T | get () const |
| Returns the default value. More... | |
| T | get (T hint) const |
| Returns value with a hint. More... | |
| T | getMax () const |
| Returns a maximum allowed value. More... | |
| T | getMin () const |
| Returns a minimum allowed value. More... | |
| operator T () const | |
| Triplet to base type conversion. More... | |
| Triplet< T > & | operator= (T other) |
| Base type to Triplet conversion. More... | |
| bool | unspecified () const |
| Check if the value has been specified. More... | |
This template specifies a parameter value.
This template class is used to store configuration parameters, like lifetime or T1. It defines 3 parameters: min, default, and max value. If the particular configuration parameter is not mandatory, it is possible to mark the parameter described by a Triplet "unspecified". For example, the T1 and T2 values in DHCPv4 server are optional and may be not specified in the configuration. The Triplets describing these parameters will be marked "unspecified". If the server finds that the particular parameter is unspecified it will not include it (e.g. option 58 or 59) in the message to a client.
There are 3 constructors:
It will be used with integer types. It provides necessary operators, so it can be assigned to a plain integer or integer assigned to a Triplet. See TripletTest.operator test for details on an easy Triplet usage.
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
Returns value with a hint.
DHCP protocol treats any values sent by a client as hints. This is a method that implements that. We can assign any value from configured range that client asks.
| hint | A value being returned when if it is within the range between min and max value of Triplet. If the hint value is lower than min value, the min value is returned. if the hint is greater than max value, the max value is returned. |
|
inline |
|
inline |
|
inline |
|
inline |
Base type to Triplet conversion.
Typically: uint32_t to Triplet assignment. It is very convenient to be able to simply write Triplet<uint32_t> x = 7;
| other | A number to be assigned as min, max and default value. |
|
inline |
Check if the value has been specified.
Definition at line 128 of file triplet.h.
Referenced by isc::dhcp::Subnet4ConfigParser::initSubnet().