Kea  2.1.7-git
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) More...
 
void evaluate (Pkt &pkt, ValueStack &values)
 Logical negation. 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 negation operator.

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

Definition at line 940 of file token.h.

Constructor & Destructor Documentation

◆ TokenNot()

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

Constructor (does nothing)

Definition at line 943 of file token.h.

Member Function Documentation

◆ evaluate()

void TokenNot::evaluate ( Pkt pkt,
ValueStack values 
)
virtual

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

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

Implements isc::dhcp::Token.

Definition at line 955 of file token.cc.

References isc::dhcp::EVAL_DBG_STACK, isc::dhcp::EVAL_DEBUG_NOT, 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: