2 #ifndef _MADARA_VARIABLE_NODE_H_ 3 #define _MADARA_VARIABLE_NODE_H_ 5 #ifndef _MADARA_NO_KARL_ 47 int set (
double value,
126 #endif // _MADARA_NO_KARL_ This class encapsulates an entry in a KnowledgeBase.
madara::knowledge::KnowledgeRecord dec(const madara::knowledge::KnowledgeUpdateSettings &settings=knowledge::KnowledgeUpdateSettings())
Atomically decrement the variable.
Defines a terminal node of that references the current value stored in a variable.
madara::knowledge::ThreadSafeContext & context_
virtual madara::knowledge::KnowledgeRecord evaluate(const madara::knowledge::KnowledgeUpdateSettings &settings)
Evaluates the node and its children.
madara::knowledge::KnowledgeRecord * record_
virtual madara::knowledge::KnowledgeRecord prune(bool &can_change)
Prune the tree of unnecessary nodes.
This class stores variables and their values for use by any entity needing state information in a thr...
const std::string key_
Key for retrieving value of this variable.
std::vector< size_t > markers_
madara::knowledge::KnowledgeRecord * get_record(void)
Retrieves the underlying knowledge::KnowledgeRecord in the context (useful for system calls)...
const std::string & key(void) const
Return the variable key.
virtual void accept(Visitor &visitor) const
Define the accept() operation used for the Visitor pattern.
An abstract base class defines a simple abstract implementation of an expression tree node...
VariableNode(const std::string &key, madara::knowledge::ThreadSafeContext &context)
Ctor.
Abstract base class for all visitors to all classes that derive from ComponentNode.
std::string expand_opener(size_t opener, size_t &closer) const
madara::knowledge::KnowledgeRecord inc(const madara::knowledge::KnowledgeUpdateSettings &settings=knowledge::KnowledgeUpdateSettings())
Atomically increment the variable.
KnowledgeRecord * get_record(const std::string &key, const KnowledgeReferenceSettings &settings=KnowledgeReferenceSettings())
Retrieves a knowledge record from the key.
virtual madara::knowledge::KnowledgeRecord item(void) const
Return the item stored in the node.
Settings for applying knowledge updates.
Copyright (c) 2015 Carnegie Mellon University.
virtual ~VariableNode(void)
Dtor.
std::string expand_key(void) const
Expands the key (if necessary).
bool key_expansion_necessary_
Expansion necessary.