![]() |
Kea 3.0.0
|
Token that represents pop and branch if false. More...
#include <token.h>
Public Member Functions | |
| TokenPopAndBranchFalse (const unsigned target) | |
| Constructor. | |
| virtual unsigned | evaluate (Pkt &pkt, ValueStack &values) |
| Pops the top of stack which must be "false" or "true". | |
| Public Member Functions inherited from isc::dhcp::TokenBranch | |
| TokenBranch (const unsigned target) | |
| Constructor. | |
| unsigned | getTarget () const |
| Returns branchtarget. | |
| 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. | |
| Protected Attributes inherited from isc::dhcp::TokenBranch | |
| unsigned | target_ |
Token that represents pop and branch if false.
Pop the op value, branch to a forward target when false. Can be used to implement the lazy "if" boolean operator i.e. evaluating either "then" or "else" branches (vs. strict the version which evaluates both).
| TokenPopAndBranchFalse::TokenPopAndBranchFalse | ( | const unsigned | target | ) |
Constructor.
| target | the label to branch to |
| EvalParseError | when target is 0 |
Definition at line 1579 of file token.cc.
References isc::dhcp::TokenBranch::TokenBranch().
|
virtual |
Pops the top of stack which must be "false" or "true".
On "true" returns 0, on "false" return the branch target.
| pkt | (unused) |
| values | - stack of values (pop the boolean top value) |
| EvalBadStack | if there are less than 1 value on stack |
| EvalTypeError | if the top value on the stack is not either "true" or "false" |
Reimplemented from isc::dhcp::TokenBranch.
Definition at line 1584 of file token.cc.
References isc::dhcp::EVAL_DBG_STACK, isc::dhcp::EVAL_DEBUG_POP_AND_BRANCH_FALSE, isc::dhcp::eval_logger, isc_throw, LOG_DEBUG, isc::dhcp::TokenBranch::target_, and isc::dhcp::Token::toBool().