2 #ifndef _MADARA_NO_KARL_
36 if (nodes_.size() > 0)
38 bool arg_can_change =
false;
39 result = nodes_[0]->prune(arg_can_change);
41 if (!arg_can_change &&
dynamic_cast<LeafNode*
>(nodes_[0]) == 0)
44 nodes_[0] =
new LeafNode(*(this->logger_), result);
50 "madara::expression::SystemCallSize: "
52 "System call size requires an argument\n");
55 "KARL COMPILE ERROR: "
56 "System call size requires an argument\n");
69 if (nodes_.size() > 0)
72 "madara::expression::SystemCallSize: "
73 "System call size is returning the size of its first argument\n");
76 nodes_[0]->evaluate(settings).size());
81 "madara::expression::SystemCallSize: "
83 "System call size requires an argument\n");
86 "KARL RUNTIME ERROR: "
87 "System call size requires an argument\n");
#define madara_logger_ptr_log(loggering, level,...)
Fast version of the madara::logger::log method for Logger pointers.
madara::knowledge::KnowledgeRecord KnowledgeRecord
An exception for unrecoverable KaRL compilation issues.
Defines a node that contains a madara::knowledge::KnowledgeRecord::Integer value.
Interface for a MADARA system call.
virtual madara::knowledge::KnowledgeRecord prune(bool &can_change)
Prunes the expression tree of unnecessary nodes.
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.
virtual ~SystemCallSize(void)
Destructor.
virtual void accept(Visitor &visitor) const
Accepts a visitor subclassed from the Visitor class.
SystemCallSize(madara::knowledge::ThreadSafeContext &context, const ComponentNodes &nodes)
Constructor.
Abstract base class for all visitors to all classes that derive from ComponentNode.
virtual void visit(const LeafNode &node)=0
Visit a LeafNode.
This class encapsulates an entry in a KnowledgeBase.
Settings for applying knowledge updates.
This class stores variables and their values for use by any entity needing state information in a thr...
std::deque< ComponentNode * > ComponentNodes
a vector of Component Nodes