6 #ifndef KNOWROB_OBSERVER_JOB_H
7 #define KNOWROB_OBSERVER_JOB_H
11 #include "knowrob/semweb/GraphBuiltin.h"
12 #include "knowrob/semweb/GraphUnion.h"
13 #include "knowrob/semweb/GraphSequence.h"
56 std::shared_ptr<ObserverManager>
manager_;
61 std::shared_ptr<GraphPattern>
pattern;
62 std::vector<std::shared_ptr<GraphBuiltin>>
builtins;
63 std::vector<std::shared_ptr<Node>>
children;
67 std::vector<std::shared_ptr<Node>>
nodes_;
74 std::shared_ptr<ObserverJob::Node>
createNode(
const std::shared_ptr<GraphPattern> &
pattern);
86 void remove(
const std::shared_ptr<Node> &node,
const Triple &triple);
88 void insert(
const std::shared_ptr<Node> &node,
const Triple &triple);
92 void doInsert(
const std::shared_ptr<Node> &node,
bool matches(const Node &node, const Triple &triple)
std::vector< std::shared_ptr< Node > > nodes_
void doInsert(const std::shared_ptr< Node > &node, const BindingsPtr &newBindings)
BindingsPtr applyBuiltins(const std::shared_ptr< Node > &node, const BindingsPtr &bindings)
NodeParents createGraph(const std::shared_ptr< GraphTerm > &term, const NodeParents &parents)
void initializeNode(const std::shared_ptr< Node > &node)
void insert(const std::shared_ptr< Node > &node, const Triple &triple)
std::shared_ptr< ObserverJob::Node > createNode(const std::shared_ptr< GraphPattern > &pattern)
void remove(const std::shared_ptr< Node > &node, const Triple &triple)
void processRemoval(const TripleContainerPtr &triples)
void initializeNode(const std::shared_ptr< Node > &node, const BindingsPtr &bindings)
void doInsert(const std::shared_ptr< Node > &node, const BindingsPtr &parentBindings, const BindingsPtr &nodeBindings)
BindingsHandler callback_
ObserverJob(const std::shared_ptr< ObserverManager > &manager, const GraphQueryPtr &query, const BindingsHandler &callback)
void processInsertion(const TripleContainerPtr &triples)
std::vector< std::shared_ptr< Node > > NodeParents
GraphQueryPtr makeAtomicQuery(const std::shared_ptr< Node > &node, const BindingsPtr &bindings)
std::shared_ptr< ObserverManager > manager_
GraphQueryPtr makeQuery(const std::vector< Node * > &reverseSequence)
NodeParents terminalNodes_
GraphTermRule & pattern()
std::shared_ptr< TripleContainer > TripleContainerPtr
std::shared_ptr< const Bindings > BindingsPtr
std::function< void(const BindingsPtr &)> BindingsHandler
std::shared_ptr< GraphQuery > GraphQueryPtr
std::shared_ptr< GraphPattern > pattern
std::vector< Node * > parents
std::vector< std::shared_ptr< GraphBuiltin > > builtins
std::vector< std::shared_ptr< Node > > children
std::map< size_t, BindingsPtr > solutions