2 #ifndef _MADARA_NO_KARL_ 45 for (ComponentNodes::iterator i =
nodes_.begin (); i !=
nodes_.end ();
48 bool arg_can_change =
false;
49 result = (*i)->prune (arg_can_change);
51 if (!arg_can_change && dynamic_cast <LeafNode *> (*i) == 0)
61 "KARL COMPILE ERROR: System call set_clock requires 1-2 arguments, " 62 "e.g., set_clock (5) or set_clock (var, 5)\n");
79 double sleep_time =
nodes_[0]->evaluate (settings).to_double ();
81 "System call sleep is sleeping for %f.\n", sleep_time);
89 "KARL RUNTIME ERROR: System call set_clock requires 1-2 arguments, " 90 "e.g., set_clock (5) or set_clock (var, 5).\n");
101 visitor.
visit (*
this);
104 #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 item(void) const
Returns the value of the node.
logger::Logger * logger_
handle the context
This class stores variables and their values for use by any entity needing state information in a thr...
SystemCallSleep(madara::knowledge::ThreadSafeContext &context, const ComponentNodes &nodes)
Constructor.
Defines a node that contains a madara::knowledge::KnowledgeRecord::Integer value. ...
MADARA_Export double sleep(double sleep_time)
Sleeps for a certain amount of time.
virtual madara::knowledge::KnowledgeRecord prune(bool &can_change)
Prunes the expression tree of unnecessary nodes.
virtual ~SystemCallSleep(void)
Destructor.
#define madara_logger_ptr_log(logger, level,...)
Fast version of the madara::logger::log method for Logger pointers.
virtual madara::knowledge::KnowledgeRecord evaluate(const madara::knowledge::KnowledgeUpdateSettings &settings)
Evaluates the expression tree.
Abstract base class for all visitors to all classes that derive from ComponentNode.
Interface for a MADARA system call.
Settings for applying knowledge updates.
virtual void accept(Visitor &visitor) const
Accepts a visitor subclassed from the Visitor class.
virtual void visit(const LeafNode &node)=0
Visit a LeafNode.