2 #ifndef _MADARA_NO_KARL_ 41 bool arg_can_change =
false;
43 tan (
nodes_[0]->
prune (arg_can_change).to_double ()));
45 if (!arg_can_change && dynamic_cast <LeafNode *> (
nodes_[0]) == 0)
51 can_change = can_change || arg_can_change;
55 std::stringstream args;
57 for (
unsigned int i = 0; i <
nodes_.size (); ++i)
62 args <<
nodes_[i]->prune (unused).to_double ();
64 if (i !=
nodes_.size () - 1)
70 "KARL COMPILE ERROR: System call tan encountered a null arg at %d\n",
76 "KARL COMPILE ERROR: System call tan requires 1 argument," 77 "e.g., #tan (1.5), where 1.5 is radians. Args currently are: %s\n",
78 args.str ().c_str ());
95 "System call tan is returning the tangent " 96 "of its first argument\n");
104 "KARL RUNTIME ERROR: System call tan requires 1 argument," 105 " e.g., #tan (1.5), where 1.5 is radians\n");
116 visitor.
visit (*
this);
119 #endif // _MADARA_NO_KARL_ This class encapsulates an entry in a KnowledgeBase.
SystemCallTan(madara::knowledge::ThreadSafeContext &context, const ComponentNodes &nodes)
Constructor.
virtual void accept(Visitor &visitor) const
Accepts a visitor subclassed from the Visitor class.
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...
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 ~SystemCallTan(void)
Destructor.
#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.
virtual madara::knowledge::KnowledgeRecord item(void) const
Returns the value of the node.
Settings for applying knowledge updates.
virtual void visit(const LeafNode &node)=0
Visit a LeafNode.
virtual madara::knowledge::KnowledgeRecord prune(bool &can_change)
Prunes the expression tree of unnecessary nodes.