MT Showcase SDK
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Pages
FunctionGraphConsumer.hpp
1 #pragma once
2 
3 #include "GraphConsumer.hpp"
4 
5 namespace Showcase
6 {
7 
8  class SHOWCASE_API FunctionGraphConsumer : public GraphConsumer
9  {
10  public:
11  typedef std::function<void(const NodeEvent&)> ChildFunc;
12  typedef std::function<void(const PropertyEvent&)> PropertyFunc;
13  typedef std::function<void(const PropertyEvent&, const EdgeId&)> EdgeFunc;
14  typedef std::function<std::shared_ptr<folly::Executor>(void)> ExecutorFunc;
15 
16  FunctionGraphConsumer(Radiant::FlagsT<GraphEventSource> monitorFlags);
17  virtual ~FunctionGraphConsumer();
18 
19  void setChildFunc(ChildFunc f);
20  void setPropertyFunc(PropertyFunc f);
21  void setEdgePropertyFunc(EdgeFunc f);
22  void setExecutorFunc(ExecutorFunc f);
23 
24  protected:
25  virtual void onChildEvent(const NodeEvent& ev) override;
26  virtual void onPropertyEvent(const PropertyEvent& ev) override;
27  virtual void onEdgePropertyEvent(const PropertyEvent& ev, const EdgeId& id) override;
28  virtual std::shared_ptr<folly::Executor> getExecutor() override;
29 
30  private:
31  ChildFunc m_childFunc;
32  PropertyFunc m_propertyFunc;
33  EdgeFunc m_edgeFunc;
34  ExecutorFunc m_executorFunc;
35  };
36 
37 }