MADARA  3.4.1
SystemCallSetFixed.cpp
Go to the documentation of this file.
1 
2 #ifndef _MADARA_NO_KARL_
3 
8 
11  : SystemCallNode(context, nodes)
12 {
13 }
14 
15 // Dtor
17 
19  void) const
20 {
21  return madara::knowledge::KnowledgeRecord(nodes_.size());
22 }
23 
29 {
30  // this node never changes, but we may be able to prune what's inside
31  can_change = true;
32 
34 
35  // this node should never have arguments
36  if (nodes_.size() > 0)
37  {
39  "madara::expression::SystemCallSetFixed: "
40  "SystemCallSetFixed:prune: no arguments should be supplied to "
41  "#set_fixed(). Deleting arguments to reclaim memory.\n");
42 
43  // delete any arguments that the user specified
44  for (ComponentNodes::iterator i = nodes_.begin(); i != nodes_.end(); ++i)
45  {
46  delete *i;
47  }
48 
49  nodes_.clear();
50  }
51 
52  return result;
53 }
54 
60 {
61  knowledge::KnowledgeRecord return_value;
62 
64  "madara::expression::SystemCallSetFixed: "
65  "System call set_fixed is setting double output format to std::fixed.\n");
66 
68 
69  return return_value;
70 }
71 
72 // accept a visitor
74  madara::expression::Visitor& visitor) const
75 {
76  visitor.visit(*this);
77 }
78 
79 #endif // _MADARA_NO_KARL_
#define madara_logger_ptr_log(loggering, level,...)
Fast version of the madara::logger::log method for Logger pointers.
Definition: Logger.h:41
madara::knowledge::KnowledgeRecord KnowledgeRecord
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 evaluate(const madara::knowledge::KnowledgeUpdateSettings &settings)
Evaluates the expression tree.
virtual void accept(Visitor &visitor) const
Accepts a visitor subclassed from the Visitor class.
virtual ~SystemCallSetFixed(void)
Destructor.
virtual madara::knowledge::KnowledgeRecord item(void) const
Returns the value of the node.
SystemCallSetFixed(madara::knowledge::ThreadSafeContext &context, const ComponentNodes &nodes)
Constructor.
Abstract base class for all visitors to all classes that derive from ComponentNode.
Definition: Visitor.h:93
virtual void visit(const LeafNode &node)=0
Visit a LeafNode.
This class encapsulates an entry in a KnowledgeBase.
static void set_fixed(void)
Sets the output format for doubles to std::fixed.
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