MADARA  3.1.8
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  "SystemCallSetFixed:prune: no arguments should be supplied to "
46  "#set_fixed(). Deleting arguments to reclaim memory.\n");
47 
48  // delete any arguments that the user specified
49  for (ComponentNodes::iterator i = nodes_.begin (); i != nodes_.end ();
50  ++i)
51  {
52  delete *i;
53  }
54 
55  nodes_.clear ();
56  }
57 
58 
59  return result;
60 }
61 
67 {
68  knowledge::KnowledgeRecord return_value;
69 
71  "System call set_fixed is setting double output format to std::fixed.\n");
72 
74 
75  return return_value;
76 }
77 
78 // accept a visitor
79 void
81  madara::expression::Visitor &visitor) const
82 {
83  visitor.visit (*this);
84 }
85 
86 #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:96
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:90
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.