MADARA  3.2.3
SystemCallSetFixed.cpp
Go to the documentation of this file.
1 
2 #ifndef _MADARA_NO_KARL_
3 
4 
9 
10 
13  const ComponentNodes & nodes)
14  : SystemCallNode (context, nodes)
15 {
16 
17 }
18 
19 // Dtor
21 {
22 }
23 
26 {
28 }
29 
35 {
36  // this node never changes, but we may be able to prune what's inside
37  can_change = true;
38 
40 
41  // this node should never have arguments
42  if (nodes_.size () > 0)
43  {
45  "madara::expression::SystemCallSetFixed: "
46  "SystemCallSetFixed:prune: no arguments should be supplied to "
47  "#set_fixed(). Deleting arguments to reclaim memory.\n");
48 
49  // delete any arguments that the user specified
50  for (ComponentNodes::iterator i = nodes_.begin (); i != nodes_.end ();
51  ++i)
52  {
53  delete *i;
54  }
55 
56  nodes_.clear ();
57  }
58 
59 
60  return result;
61 }
62 
68 {
69  knowledge::KnowledgeRecord return_value;
70 
72  "madara::expression::SystemCallSetFixed: "
73  "System call set_fixed is setting double output format to std::fixed.\n");
74 
76 
77  return return_value;
78 }
79 
80 // accept a visitor
81 void
83  madara::expression::Visitor &visitor) const
84 {
85  visitor.visit (*this);
86 }
87 
88 #endif // _MADARA_NO_KARL_
This class encapsulates an entry in a KnowledgeBase.
static void set_fixed(void)
Sets the output format for doubles to std::fixed.
madara::knowledge::KnowledgeRecord KnowledgeRecord
virtual ~SystemCallSetFixed(void)
Destructor.
std::deque< ComponentNode * > ComponentNodes
a vector of Component Nodes
logger::Logger * logger_
handle the context
Definition: ComponentNode.h:97
This class stores variables and their values for use by any entity needing state information in a thr...
#define madara_logger_ptr_log(logger, level,...)
Fast version of the madara::logger::log method for Logger pointers.
Definition: Logger.h:32
Abstract base class for all visitors to all classes that derive from ComponentNode.
Definition: Visitor.h:91
virtual madara::knowledge::KnowledgeRecord evaluate(const madara::knowledge::KnowledgeUpdateSettings &settings)
Evaluates the expression tree.
Interface for a MADARA system call.
virtual void accept(Visitor &visitor) const
Accepts a visitor subclassed from the Visitor class.
Settings for applying knowledge updates.
virtual void visit(const LeafNode &node)=0
Visit a LeafNode.
virtual madara::knowledge::KnowledgeRecord item(void) const
Returns the value of the node.
virtual madara::knowledge::KnowledgeRecord prune(bool &can_change)
Prunes the expression tree of unnecessary nodes.
SystemCallSetFixed(madara::knowledge::ThreadSafeContext &context, const ComponentNodes &nodes)
Constructor.