2 #ifndef _MADARA_NO_KARL_
37 if (nodes_.size() > 0)
39 bool arg_can_change =
false;
40 result = nodes_[0]->prune(arg_can_change);
42 if (!arg_can_change &&
dynamic_cast<LeafNode*
>(nodes_[0]) == 0)
45 nodes_[0] =
new LeafNode(*(this->logger_), result);
60 if (nodes_.size() > 0)
62 int64_t new_precision = nodes_[0]->evaluate(settings).
to_integer();
64 "madara::expression::SystemCallSetPrecision: "
65 "System call precision is setting the precision to %" PRId64
".\n",
75 "madara::expression::SystemCallSetPrecision: "
76 "System call precision is returning the double precision.\n");
#define madara_logger_ptr_log(loggering, level,...)
Fast version of the madara::logger::log method for Logger pointers.
madara::knowledge::KnowledgeRecord KnowledgeRecord
Defines a node that contains a madara::knowledge::KnowledgeRecord::Integer value.
Interface for a MADARA system call.
virtual ~SystemCallSetPrecision(void)
Destructor.
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 madara::knowledge::KnowledgeRecord prune(bool &can_change)
Prunes the expression tree of unnecessary nodes.
SystemCallSetPrecision(madara::knowledge::ThreadSafeContext &context, const ComponentNodes &nodes)
Constructor.
virtual void accept(Visitor &visitor) const
Accepts a visitor subclassed from the Visitor class.
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.
static int get_precision(void)
Gets the current double precision for double to string conversion.
Integer to_integer(void) const
converts the value to an integer.
static void set_precision(int new_precision)
Sets the double precision of a double record when using to_string ().
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