2 #ifndef _MADARA_NO_KARL_ 45 bool arg_can_change =
false;
46 result =
nodes_[0]->prune (arg_can_change);
48 if (!arg_can_change && dynamic_cast <LeafNode *> (
nodes_[0]) == 0)
57 "madara::expression::SystemCallPrint: " 59 "System call size requires an argument\n");
62 "KARL COMPILE ERROR: " 63 "System call size requires an argument\n");
80 "madara::expression::SystemCallPrint: " 81 "System call print is printing the first argument and returning the" 82 " size of the first argument\n");
90 else if (
nodes_.size () == 2)
93 unsigned int log_level =
97 "madara::expression::SystemCallPrint: " 98 "System call print is printing the first argument at log level %d.\n",
108 "madara::expression::SystemCallPrint: " 109 "KARL RUNTIME ERROR:" 110 "System call size requires an argument\n");
113 "KARL RUNTIME ERROR: " 114 "System call size requires an argument\n");
125 visitor.
visit (*
this);
128 #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 madara::knowledge::KnowledgeRecord evaluate(const madara::knowledge::KnowledgeUpdateSettings &settings)
Evaluates the expression tree.
logger::Logger * logger_
handle the context
This class stores variables and their values for use by any entity needing state information in a thr...
void print(unsigned int level) const
Atomically prints all variables and values in the context.
virtual ~SystemCallPrint(void)
Destructor.
Defines a node that contains a madara::knowledge::KnowledgeRecord::Integer value. ...
SystemCallPrint(madara::knowledge::ThreadSafeContext &context, const ComponentNodes &nodes)
Constructor.
#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.
virtual void accept(Visitor &visitor) const
Accepts a visitor subclassed from the Visitor class.
virtual madara::knowledge::KnowledgeRecord item(void) const
Returns the value of the node.
Integer to_integer(void) const
converts the value to an integer.
madara::knowledge::ThreadSafeContext & context_
An exception for unrecoverable KaRL compilation issues.
Interface for a MADARA system call.
Settings for applying knowledge updates.
virtual void visit(const LeafNode &node)=0
Visit a LeafNode.
virtual madara::knowledge::KnowledgeRecord prune(bool &can_change)
Prunes the expression tree of unnecessary nodes.