Kea: isc::dhcp::TokenAnd Class Reference

| Kea 1.5.0

Public Member Functions | List of all members
isc::dhcp::TokenAnd Class Reference

Token that represents logical and operator. More...

`#include <token.h>`

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

## Public Member Functions
| TokenAnd ()
| Constructor (does nothing) More...
void | evaluate (Pkt &pkt, ValueStack &values)
| Logical and. More...
Public Member Functions inherited from isc::dhcp::Token
virtual | ~Token ()
| Virtual destructor. 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...

## Detailed Description

Token that represents logical and operator.

For example "option[10].exists and option[11].exists"

Definition at line 795 of file token.h.

## Constructor & Destructor Documentation

## ◆ TokenAnd()

isc::dhcp::TokenAnd::TokenAnd | ( |  | ) |
| inline

Constructor (does nothing)

Definition at line 798 of file token.h.

## Member Function Documentation

## ◆ evaluate()

void TokenAnd::evaluate | ( | Pkt & | pkt,
|  | ValueStack & | values
| ) |  |
| virtual

Logical and.

Evaluation does not use packet information, but rather consumes the last two parameters. It returns "true" if and only if both are "true". It requires at least two logical (i.e., "true" or "false') values present on stack.

Exceptions

  EvalBadStack | if there are less than 2 values on stack
  EvalTypeError | if one of the 2 values on stack is not "true" or "false"

Parameters

  pkt | (unused)
  values | - stack of values (2 arguments will be popped, 1 result will be pushed)

Implements isc::dhcp::Token.

Definition at line 691 of file token.cc.

References isc::dhcp::EVAL_DBG_STACK, isc::dhcp::eval_logger, isc_throw, LOG_DEBUG, and isc::dhcp::Token::toBool().

Here is the call graph for this function:

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

- token.h
- token.cc