2 #ifndef _MADARA_NO_KARL_ 45 bool arg_can_change =
false;
46 result =
nodes_[0]->prune (arg_can_change);
48 if (!arg_can_change && dynamic_cast <LeafNode *> (
nodes_[0]) == 0)
69 "madara::expression::SystemCallToBuffer: " 70 "System call to_buffer is converting an argument to an " 71 "unmanaged buffer\n");
74 unsigned char * buffer =
75 nodes_[0]->evaluate (settings).to_unmanaged_buffer (size);
77 return_value.
set_file (buffer, size);
82 "madara::expression::SystemCallToBuffer: " 84 "System call to_buffer requires an argument\n");
86 throw KarlException (
"madara::expression::SystemCallToBuffer: " 87 "KARL RUNTIME ERROR: " 88 "System call to_buffer requires an argument\n");
99 visitor.
visit (*
this);
102 #endif // _MADARA_NO_KARL_ This class encapsulates an entry in a KnowledgeBase.
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.
madara::knowledge::KnowledgeRecord KnowledgeRecord
std::deque< ComponentNode * > ComponentNodes
a vector of Component Nodes
void set_file(const unsigned char *new_value, size_t size)
sets the value to an unknown file type
SystemCallToBuffer(madara::knowledge::ThreadSafeContext &context, const ComponentNodes &nodes)
Constructor.
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 void accept(Visitor &visitor) const
Accepts a visitor subclassed from the Visitor class.
#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.
An exception for unrecoverable KaRL compilation issues.
Interface for a MADARA system call.
virtual ~SystemCallToBuffer(void)
Destructor.
virtual madara::knowledge::KnowledgeRecord prune(bool &can_change)
Prunes the expression tree of unnecessary nodes.
Settings for applying knowledge updates.
virtual void visit(const LeafNode &node)=0
Visit a LeafNode.