MADARA
3.4.1
|
General purpose system call KaRL node. More...
#include <SystemCallGeneric.h>
Public Types | |
using | fn_signature = madara::knowledge::KnowledgeRecord(std::vector< madara::knowledge::KnowledgeRecord >) |
using | fn_type = std::function< fn_signature > |
Public Member Functions | |
SystemCallGeneric (madara::knowledge::ThreadSafeContext &context, const ComponentNodes &nodes, const char *name, fn_type fn) | |
Constructor. More... | |
virtual void | accept (Visitor &visitor) const |
Accepts a visitor subclassed from the Visitor class. More... | |
virtual madara::knowledge::KnowledgeRecord | evaluate (const madara::knowledge::KnowledgeUpdateSettings &settings) |
Evaluates the expression tree. More... | |
virtual madara::knowledge::KnowledgeRecord | item (void) const |
Returns the value of the node. More... | |
virtual ComponentNode * | left (void) const |
Returns the left expression. More... | |
const char * | name () const |
virtual madara::knowledge::KnowledgeRecord | prune (bool &can_change) |
Prunes the expression tree of unnecessary nodes. More... | |
virtual ComponentNode * | right (void) const |
Returns the right expression. More... | |
void | set_logger (logger::Logger &logger) |
Sets the logger for printing errors and debugging info. More... | |
Protected Attributes | |
madara::knowledge::ThreadSafeContext & | context_ |
logger::Logger * | logger_ |
handle the context More... | |
ComponentNodes | nodes_ |
Private Attributes | |
fn_type | fn_ |
const char * | name_ |
General purpose system call KaRL node.
Construct with the function name, and a callable (that accepts std::vector<KnowledgeRecord>, and returns KnowledgeRecord).
Does not do pruning, as it cannot know what the callable does. If your system call can make good use of prune, you should write a custom node instead.
Definition at line 26 of file SystemCallGeneric.h.
using madara::expression::SystemCallGeneric::fn_signature = madara::knowledge::KnowledgeRecord( std::vector<madara::knowledge::KnowledgeRecord>) |
Definition at line 29 of file SystemCallGeneric.h.
using madara::expression::SystemCallGeneric::fn_type = std::function<fn_signature> |
Definition at line 32 of file SystemCallGeneric.h.
|
inline |
Constructor.
Definition at line 37 of file SystemCallGeneric.h.
|
inlinevirtual |
Accepts a visitor subclassed from the Visitor class.
visitor | visitor instance to use |
Reimplemented from madara::expression::SystemCallNode.
Definition at line 85 of file SystemCallGeneric.h.
|
inlinevirtual |
Evaluates the expression tree.
Implements madara::expression::SystemCallNode.
Definition at line 69 of file SystemCallGeneric.h.
|
inlinevirtual |
Returns the value of the node.
Reimplemented from madara::expression::SystemCallNode.
Definition at line 47 of file SystemCallGeneric.h.
|
virtualinherited |
Returns the left expression.
Reimplemented in madara::expression::CompositeBinaryNode.
Definition at line 29 of file ComponentNode.cpp.
|
inline |
Definition at line 90 of file SystemCallGeneric.h.
|
inlinevirtual |
Prunes the expression tree of unnecessary nodes.
This implementation assumes it can always change, so does not prune.
can_change | set to true if variable nodes are contained |
Implements madara::expression::SystemCallNode.
Definition at line 59 of file SystemCallGeneric.h.
|
virtualinherited |
Returns the right expression.
Reimplemented in madara::expression::CompositeUnaryNode.
Definition at line 36 of file ComponentNode.cpp.
|
inherited |
Sets the logger for printing errors and debugging info.
logger | the logger to use |
Definition at line 48 of file ComponentNode.cpp.
|
protectedinherited |
Definition at line 70 of file SystemCallNode.h.
|
private |
Definition at line 97 of file SystemCallGeneric.h.
|
protectedinherited |
handle the context
Definition at line 96 of file ComponentNode.h.
|
private |
Definition at line 96 of file SystemCallGeneric.h.
|
protectedinherited |
Definition at line 74 of file CompositeTernaryNode.h.