![]() |
Kea 2.2.0
|
Token representing an unsigned 32 bit integer. More...
#include <token.h>
Inheritance diagram for isc::dhcp::TokenInteger:Public Member Functions | |
| TokenInteger (const uint32_t value) | |
| Integer value set during construction. More... | |
| uint32_t | getInteger () const |
| Returns integer value. More... | |
Public Member Functions inherited from isc::dhcp::TokenString | |
| TokenString (const std::string &str) | |
| Value is set during token construction. More... | |
| void | evaluate (Pkt &pkt, ValueStack &values) |
| Token evaluation (puts value of the constant string on the stack) More... | |
Public Member Functions inherited from isc::dhcp::Token | |
| virtual | ~Token () |
| Virtual destructor. More... | |
| virtual void | evaluate (Pkt &pkt, ValueStack &values)=0 |
| This is a generic method for evaluating a packet. More... | |
Protected Attributes | |
| uint32_t | int_value_ |
| value as integer (stored for testing only) More... | |
Protected Attributes inherited from isc::dhcp::TokenString | |
| std::string | value_ |
| Constant value. More... | |
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. More... | |
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 179 of file token.h.
References int_value_.
|
protected |
value as integer (stored for testing only)
Definition at line 184 of file token.h.
Referenced by getInteger().