Kea 2.7.6
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)
 
virtual unsigned evaluate (Pkt &pkt, ValueStack &values)
 Logical negation.
 
- Public Member Functions inherited from isc::dhcp::Token
virtual ~Token ()
 Virtual destructor.
 
virtual unsigned getLabel () const
 Return the label of this token.
 

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 1009 of file token.h.

Constructor & Destructor Documentation

◆ TokenNot()

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

Constructor (does nothing)

Definition at line 1012 of file token.h.

Member Function Documentation

◆ evaluate()

unsigned 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)
Returns
0 which means evaluate next token if any.

Implements isc::dhcp::Token.

Definition at line 1064 of file token.cc.

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: