2 #ifndef _MADARA_NO_KARL_ 42 for (ComponentNodes::iterator i =
nodes_.begin (); i !=
nodes_.end ();
45 bool arg_can_change =
false;
46 result = (*i)->prune (arg_can_change);
48 if (!arg_can_change && dynamic_cast <LeafNode *> (*i) == 0)
58 "KARL COMPILE ERROR: System call fragment" 59 " requires three arguments, e.g." 60 " #fragment ('hello world', 0, 4) will return 'hello'\n");
83 "System call fragment is returning segment [%d-%d].\n",
86 return nodes_[0]->evaluate (settings).fragment (first, last);
92 "KARL RUNTIME ERROR: System call fragment" 93 " requires three arguments, e.g." 94 " #fragment ('hello world', 0, 4) will return 'hello'\n");
106 visitor.
visit (*
this);
109 #endif // _MADARA_NO_KARL_ This class encapsulates an entry in a KnowledgeBase.
madara::knowledge::KnowledgeRecord KnowledgeRecord
std::deque< ComponentNode * > ComponentNodes
a vector of Component Nodes
virtual void accept(Visitor &visitor) const
Accepts a visitor subclassed from the Visitor class.
logger::Logger * logger_
handle the context
This class stores variables and their values for use by any entity needing state information in a thr...
Defines a node that contains a madara::knowledge::KnowledgeRecord::Integer value. ...
#define madara_logger_ptr_log(logger, level,...)
Fast version of the madara::logger::log method for Logger pointers.
Abstract base class for all visitors to all classes that derive from ComponentNode.
SystemCallFragment(madara::knowledge::ThreadSafeContext &context, const ComponentNodes &nodes)
Constructor.
Integer to_integer(void) const
converts the value to an integer
Interface for a MADARA system call.
virtual madara::knowledge::KnowledgeRecord prune(bool &can_change)
Prunes the expression tree of unnecessary nodes.
virtual ~SystemCallFragment(void)
Destructor.
Settings for applying knowledge updates.
virtual void visit(const LeafNode &node)=0
Visit a LeafNode.
virtual madara::knowledge::KnowledgeRecord item(void) const
Returns the value of the node.
virtual madara::knowledge::KnowledgeRecord evaluate(const madara::knowledge::KnowledgeUpdateSettings &settings)
Evaluates the expression tree.