MADARA  3.2.3
madara::expression::VariableDecrementNode Class Reference

Composite node that subtracts a variable by some right hand side. More...

#include <VariableDecrementNode.h>

Inheritance diagram for madara::expression::VariableDecrementNode:
madara::expression::ComponentNode

Public Member Functions

 VariableDecrementNode (ComponentNode *lhs, madara::knowledge::KnowledgeRecord value, ComponentNode *rhs, madara::knowledge::ThreadSafeContext &context)
 Ctor. More...
 
virtual ~VariableDecrementNode (void)
 Dtor. More...
 
virtual void accept (Visitor &visitor) const
 Define the accept() operation used for the Visitor pattern. More...
 
virtual madara::knowledge::KnowledgeRecord evaluate (const madara::knowledge::KnowledgeUpdateSettings &settings)
 Evaluates the node and its children. More...
 
virtual madara::knowledge::KnowledgeRecord item (void) const
 Return the item stored in the node. More...
 
virtual ComponentNodeleft (void) const
 Returns the left expression. More...
 
virtual madara::knowledge::KnowledgeRecord prune (bool &can_change)
 Prune the tree of unnecessary nodes. More...
 
virtual ComponentNoderight (void) const
 Returns the right expression. More...
 
void set_logger (logger::Logger &logger)
 Sets the logger for printing errors and debugging info. More...
 

Protected Attributes

logger::Loggerlogger_
 handle the context More...
 

Private Attributes

CompositeArrayReferencearray_
 variable index holder More...
 
ComponentNoderhs_
 holds a right hand side argument if it is not value_ More...
 
madara::knowledge::KnowledgeRecord value_
 amount to increment by. Note that this can also do decrement. More...
 
VariableNodevar_
 variable holder More...
 

Detailed Description

Composite node that subtracts a variable by some right hand side.

Definition at line 28 of file VariableDecrementNode.h.

Constructor & Destructor Documentation

madara::expression::VariableDecrementNode::VariableDecrementNode ( ComponentNode lhs,
madara::knowledge::KnowledgeRecord  value,
ComponentNode rhs,
madara::knowledge::ThreadSafeContext context 
)

Ctor.

Definition at line 12 of file VariableDecrementNode.cpp.

madara::expression::VariableDecrementNode::~VariableDecrementNode ( void  )
virtual

Dtor.

Definition at line 25 of file VariableDecrementNode.cpp.

Member Function Documentation

void madara::expression::VariableDecrementNode::accept ( Visitor visitor) const
virtual

Define the accept() operation used for the Visitor pattern.

Reimplemented from madara::expression::ComponentNode.

Definition at line 32 of file VariableDecrementNode.cpp.

madara::knowledge::KnowledgeRecord madara::expression::VariableDecrementNode::evaluate ( const madara::knowledge::KnowledgeUpdateSettings settings)
virtual

Evaluates the node and its children.

This does not prune any of the expression tree, and is much faster than the prune function

Implements madara::expression::ComponentNode.

Definition at line 101 of file VariableDecrementNode.cpp.

madara::knowledge::KnowledgeRecord madara::expression::VariableDecrementNode::item ( void  ) const
virtual

Return the item stored in the node.

Reimplemented from madara::expression::ComponentNode.

Definition at line 38 of file VariableDecrementNode.cpp.

madara::expression::ComponentNode * madara::expression::ComponentNode::left ( void  ) const
virtualinherited

Returns the left expression.

Returns
a pointer to the left expression

Reimplemented in madara::expression::CompositeBinaryNode.

Definition at line 34 of file ComponentNode.cpp.

madara::knowledge::KnowledgeRecord madara::expression::VariableDecrementNode::prune ( bool &  can_change)
virtual

Prune the tree of unnecessary nodes.

Returns evaluation of the node and sets can_change appropriately. if this node can be changed, that means it shouldn't be pruned.

Implements madara::expression::ComponentNode.

Definition at line 54 of file VariableDecrementNode.cpp.

madara::expression::ComponentNode * madara::expression::ComponentNode::right ( void  ) const
virtualinherited

Returns the right expression.

Returns
a pointer to the right expression

Reimplemented in madara::expression::CompositeUnaryNode.

Definition at line 41 of file ComponentNode.cpp.

void madara::expression::ComponentNode::set_logger ( logger::Logger logger)
inherited

Sets the logger for printing errors and debugging info.

Parameters
loggerthe logger to use

Definition at line 53 of file ComponentNode.cpp.

Member Data Documentation

CompositeArrayReference* madara::expression::VariableDecrementNode::array_
private

variable index holder

Definition at line 61 of file VariableDecrementNode.h.

logger::Logger* madara::expression::ComponentNode::logger_
protectedinherited

handle the context

Definition at line 97 of file ComponentNode.h.

ComponentNode* madara::expression::VariableDecrementNode::rhs_
private

holds a right hand side argument if it is not value_

Definition at line 67 of file VariableDecrementNode.h.

madara::knowledge::KnowledgeRecord madara::expression::VariableDecrementNode::value_
private

amount to increment by. Note that this can also do decrement.

Definition at line 64 of file VariableDecrementNode.h.

VariableNode* madara::expression::VariableDecrementNode::var_
private

variable holder

Definition at line 58 of file VariableDecrementNode.h.


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