Kea 2.5.9
isc::dhcp::TokenNot Class Reference

Token that represents logical negation operator. More...

#include <token.h>

+ Inheritance diagram for isc::dhcp::TokenNot:

Public Member Functions

 TokenNot ()
 Constructor (does nothing)
void evaluate (Pkt &pkt, ValueStack &values)
 Logical negation.
- Public Member Functions inherited from isc::dhcp::Token
virtual ~Token ()
 Virtual destructor.
virtual void evaluate (Pkt &pkt, ValueStack &values)=0
 This is a generic method for evaluating a packet.

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 that represents logical negation operator.

For example in the expression "not(option[vendor-class].text == 'MSF')" this token represents the leading "not"

Definition at line 970 of file token.h.

Constructor & Destructor Documentation

◆ TokenNot()

isc::dhcp::TokenNot::TokenNot ( )

Constructor (does nothing)

Definition at line 973 of file token.h.

Member Function Documentation

◆ evaluate()

void TokenNot::evaluate ( Pkt pkt,
ValueStack values 

Logical negation.

Evaluation does not use packet information, but rather consumes the last result. It does a simple string comparison and sets the value to either "true" or "false". It requires at least one value to be present on stack and to be either "true" or "false".

EvalBadStackif there are less than 1 value on stack
EvalTypeErrorif the top value on the stack is not either "true" or "false"
values- stack of values (logical top value negated)

Implements isc::dhcp::Token.

Definition at line 1016 of file

References isc::dhcp::EVAL_DBG_STACK, isc::dhcp::EVAL_DEBUG_NOT, isc::dhcp::eval_logger, isc::dhcp::Pkt::getLabel(), 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: