| Kea 3.0.2-git

isc::dhcp::TokenInteger Class Reference

Token representing an unsigned 32 bit integer. More...

`#include <token.h>`

Inheritance diagram for isc::dhcp::TokenInteger:
[legend]

## 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.

## Detailed Description

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.

Definition at line 215 of file token.h.

## Constructor & Destructor Documentation

## ◆ TokenInteger()

TokenInteger::TokenInteger | ( | const uint32_t | value | ) |

Integer value set during construction.

The value is converted to string and stored in value_ provided by the base class.

Parameters

  value | integer value to be stored.

Definition at line 1403 of file token.cc.

References isc::dhcp::TokenString::TokenString(), and int_value_.

Here is the call graph for this function:

## Member Function Documentation

## ◆ getInteger()

uint32_t isc::dhcp::TokenInteger::getInteger | ( |  | ) | const
| inline

Returns integer value.

Used in tests only.

Returns
  integer value

Definition at line 230 of file token.h.

References int_value_.

## Member Data Documentation

## ◆ int_value_

uint32_t isc::dhcp::TokenInteger::int_value_
| protected

value as integer (stored for testing only)

Definition at line 235 of file token.h.

Referenced by TokenInteger(), and getInteger().

The documentation for this class was generated from the following files:

- token.h
- token.cc