MADARA  3.2.3
madara::expression::ListNode Class Reference

Defines a terminal node that contains a list. More...

#include <ListNode.h>

Inheritance diagram for madara::expression::ListNode:
madara::expression::ComponentNode

Public Member Functions

 ListNode (madara::knowledge::ThreadSafeContext &context)
 Ctor. More...
 
virtual ~ListNode (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

::std::list< ComponentNode * > list_
 list of trees in a parameter list More...
 

Detailed Description

Defines a terminal node that contains a list.

Definition at line 27 of file ListNode.h.

Constructor & Destructor Documentation

madara::expression::ListNode::ListNode ( madara::knowledge::ThreadSafeContext context)

Ctor.

Definition at line 12 of file ListNode.cpp.

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

Dtor.

Definition at line 19 of file ListNode.cpp.

Member Function Documentation

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

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

Reimplemented from madara::expression::ComponentNode.

Definition at line 26 of file ListNode.cpp.

madara::knowledge::KnowledgeRecord madara::expression::ListNode::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 55 of file ListNode.cpp.

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

Return the item stored in the node.

Reimplemented from madara::expression::ComponentNode.

Definition at line 32 of file ListNode.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::ListNode::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 42 of file ListNode.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

::std::list<ComponentNode *> madara::expression::ListNode::list_
private

list of trees in a parameter list

Definition at line 57 of file ListNode.h.

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

handle the context

Definition at line 97 of file ComponentNode.h.


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