Kea 2.7.6
|
Token representing an unsigned 32 bit integer. More...
#include <token.h>
Public Member Functions | |
TokenInteger (const uint32_t value) | |
Integer value set during construction. | |
uint32_t | getInteger () const |
Returns integer value. | |
Public Member Functions inherited from isc::dhcp::TokenString | |
TokenString (const std::string &str) | |
Value is set during token construction. | |
virtual unsigned | evaluate (Pkt &pkt, ValueStack &values) |
Token evaluation (puts value of the constant string on the stack) | |
Public Member Functions inherited from isc::dhcp::Token | |
virtual | ~Token () |
Virtual destructor. | |
virtual unsigned | getLabel () const |
Return the label of this token. | |
Protected Attributes | |
uint32_t | int_value_ |
value as integer (stored for testing only) | |
Protected Attributes inherited from isc::dhcp::TokenString | |
std::string | value_ |
Constant value. | |
Additional Inherited Members | |
Static Public Member Functions inherited from isc::dhcp::Token | |
static bool | toBool (std::string value) |
Coverts a (string) value to a boolean. | |
Token representing an unsigned 32 bit integer.
For performance reasons, the constant integer value is converted to a string just once (in the constructor). Afterwards, this effectively works as a constant 4 byte long string. Hence this class is derived from TokenString and does not even need its own evaluate() method.
TokenInteger::TokenInteger | ( | const uint32_t | value | ) |
|
inline |
Returns integer value.
Used in tests only.
Definition at line 230 of file token.h.
References int_value_.
|
protected |
value as integer (stored for testing only)
Definition at line 235 of file token.h.
Referenced by getInteger().