5 #include "GraphTypes.hpp"
8 #include "ShowcaseTypes.hpp"
10 #include "GraphGenerators.hpp"
12 #include "ValueStream.hpp"
13 #include "GeneratorValueStream.hpp"
14 #include "ValueStreamChannels.hpp"
16 #include <folly/futures/Future.h>
17 #include <folly/Executor.h>
21 typedef ValueStreamPtr<NodeEvent> NodeEventStreamPtr;
22 typedef ValueStreamPtr<PropertyEvent> PropertyEventStreamPtr;
24 typedef ShowcaseFactoryPtr<GraphGenerator> GraphGenFactoryPtr;
25 typedef ShowcaseFactoryPtr<PropertyGenerator> PropGenFactoryPtr;
29 class SHOWCASE_API
Graph :
public std::enable_shared_from_this<Graph>
32 Graph(std::shared_ptr<folly::Executor> executor);
38 NodeEventStreamPtr children(
const GraphNode& node, std::shared_ptr<folly::Executor> executor =
nullptr)
const;
39 PropertyEventStreamPtr properties(
const GraphNode& node, std::shared_ptr<folly::Executor> executor =
nullptr)
const;
40 PropertyEventStreamPtr properties(
const GraphEdge& edge, std::shared_ptr<folly::Executor> executor =
nullptr)
const;
44 FactoryKey<GraphGenerator>
45 registerFactory(
const QString& name, GraphGenFactoryPtr factory);
47 FactoryKey<PropertyGenerator>
48 registerFactory(
const QString& name, PropGenFactoryPtr factory);
50 bool unregisterFactory(FactoryKey<GraphGenerator> key);
51 bool unregisterFactory(FactoryKey<PropertyGenerator> key);
53 std::shared_ptr<folly::Executor> executor();
60 std::shared_ptr<GeneratorValueStream<PropertyGenerator>>
66 std::shared_ptr<folly::Executor> m_executor;
69 FactoryMap<GraphGenerator> m_graphFactories;
70 FactoryMap<PropertyGenerator> m_propertyFactories;
72 typedef std::shared_ptr<Graph> GraphPtr;