2 #ifndef _MADARA_NO_KARL_ 44 for (ComponentNodes::iterator i =
nodes_.begin (); i !=
nodes_.end ();
47 bool arg_can_change =
false;
48 result = (*i)->prune (arg_can_change);
50 if (!arg_can_change && dynamic_cast <LeafNode *> (*i) == 0)
60 "KARL COMPILE ERROR: System call set_clock requires 1-2 arguments, " 61 "e.g., set_clock (5) or set_clock (var, 5)\n");
79 "System call set_clock is setting the system clock\n");
85 else if (
nodes_.size () == 2)
88 "System call set_clock is setting a variable clock\n");
102 "KARL RUNTIME ERROR: System call set_clock with 2 arguments " 103 "requires the first argument to be a variable.\n");
110 "KARL RUNTIME ERROR: System call set_clock requires 1-2 arguments, " 111 "e.g., set_clock (5) or set_clock (var, 5)\n");
122 visitor.
visit (*
this);
125 #endif // _MADARA_NO_KARL_ This class encapsulates an entry in a KnowledgeBase.
virtual ~SystemCallSetClock(void)
Destructor.
virtual madara::knowledge::KnowledgeRecord item(void) const
Returns the value of the node.
virtual void accept(Visitor &visitor) const
Accepts a visitor subclassed from the Visitor class.
Defines a terminal node of that references the current value stored in a variable.
uint64_t set_clock(uint64_t clock)
Atomically sets the lamport clock.
madara::knowledge::KnowledgeRecord KnowledgeRecord
virtual madara::knowledge::KnowledgeRecord evaluate(const madara::knowledge::KnowledgeUpdateSettings &settings)
Evaluates the expression tree.
std::deque< ComponentNode * > ComponentNodes
a vector of Component Nodes
logger::Logger * logger_
handle the context
This class stores variables and their values for use by any entity needing state information in a thr...
virtual madara::knowledge::KnowledgeRecord prune(bool &can_change)
Prunes the expression tree of unnecessary nodes.
Defines a node that contains a madara::knowledge::KnowledgeRecord::Integer value. ...
madara::knowledge::KnowledgeRecord * get_record(void)
Retrieves the underlying knowledge::KnowledgeRecord in the context (useful for system calls)...
#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.
Integer to_integer(void) const
converts the value to an integer
madara::knowledge::ThreadSafeContext & context_
Interface for a MADARA system call.
uint64_t get_clock(void) const
Atomically gets the Lamport clock.
Settings for applying knowledge updates.
virtual void visit(const LeafNode &node)=0
Visit a LeafNode.
uint64_t clock
last modification time
SystemCallSetClock(madara::knowledge::ThreadSafeContext &context, const ComponentNodes &nodes)
Constructor.