|
MT Showcase SDK
|
This class abstracts the listening of the graph events. More...
#include <GraphConsumer.hpp>
Inherits enable_shared_from_this< GraphConsumer >.
Inherited by Showcase::FunctionGraphConsumer.
Public Member Functions | |
| void | initStreams (GraphPtr graph, const GraphNode &node, int consume=0) |
| Makes GraphEventSource::NODE and GraphEventSource::NODE_PROPERTY queries to the graph and initializes the listeners. More... | |
| GraphPtr | sourceGraph () const |
| Graph is stored as a weak pointer, so this can also be null. | |
| PropertyEventStreamPtr | propertyStream () |
| Clones property stream of consumer. | |
Protected Member Functions | |
| virtual std::shared_ptr < folly::Executor > | getExecutor () |
| This should return executor that executes child and property events. More... | |
This class abstracts the listening of the graph events.
It will have hooks for overriding the behaviour to NodeEvent, PropertyEvent for Node and PropertyEvent for outgoing Edge
|
inlineprotectedvirtual |
This should return executor that executes child and property events.
See initChildListener or initPropertyListener. If this returns nullptr the callbacks are executed in the EventStream's executor.
| void Showcase::GraphConsumer::initStreams | ( | GraphPtr | graph, |
| const GraphNode & | node, | ||
| int | consume = 0 |
||
| ) |
Makes GraphEventSource::NODE and GraphEventSource::NODE_PROPERTY queries to the graph and initializes the listeners.
| graph | Graph to use for queries |
| node | Target node for this consumer |
| consume | This consumer will immediately try to consume this many children. If pending event is encountered, consumption is interrupted. Negative number will consume until pending event is encountered. |
Need to specify type explicitly. Otherwise type deduction of MSVC2015 fails