MT Showcase SDK
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Pages
Showcase::GraphConsumer Class Referenceabstract

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...
 

Detailed Description

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

Member Function Documentation

virtual std::shared_ptr<folly::Executor> Showcase::GraphConsumer::getExecutor ( )
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.

Parameters
graphGraph to use for queries
nodeTarget node for this consumer
consumeThis 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