2 #ifndef _MADARA_NO_KARL_ 41 bool base_can_change =
false, power_can_change =
false;
43 double base =
nodes_[0]->prune (base_can_change).to_double ();
44 double power =
nodes_[1]->prune (power_can_change).to_double ();
46 if (!base_can_change && dynamic_cast <LeafNode *> (
nodes_[0]) == 0)
52 if (!power_can_change && dynamic_cast <LeafNode *> (
nodes_[1]) == 0)
60 can_change = can_change || base_can_change || power_can_change;
65 "KARL COMPILE ERROR: System call pow requires 2 arguments," 66 "e.g., #pow (4,2), which would return 16.\n");
83 "System call pow is returning the base taken to the power\n");
92 "KARL RUNTIME ERROR: System call pow requires 2 arguments," 93 "e.g., #pow (4,2), which would return 16.\n");
104 visitor.
visit (*
this);
107 #endif // _MADARA_NO_KARL_ This class encapsulates an entry in a KnowledgeBase.
virtual ~SystemCallPow(void)
Destructor.
madara::knowledge::KnowledgeRecord KnowledgeRecord
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. ...
virtual madara::knowledge::KnowledgeRecord evaluate(const madara::knowledge::KnowledgeUpdateSettings &settings)
Evaluates the expression tree.
virtual madara::knowledge::KnowledgeRecord item(void) const
Returns the value of the node.
#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.
Interface for a MADARA system call.
Settings for applying knowledge updates.
virtual void visit(const LeafNode &node)=0
Visit a LeafNode.
SystemCallPow(madara::knowledge::ThreadSafeContext &context, const ComponentNodes &nodes)
Constructor.
virtual void accept(Visitor &visitor) const
Accepts a visitor subclassed from the Visitor class.