DataFlowGraph.h
Go to the documentation of this file.
1 #ifndef WIRECELLTBB_DATAFLOWGRAPH
2 #define WIRECELLTBB_DATAFLOWGRAPH
3 
8 
9 #include <tbb/task_scheduler_init.h>
10 
11 #include <map>
12 #include <string>
13 
14 namespace WireCellTbb {
15 
17  public:
18  DataFlowGraph(int max_threads = 0);
19  virtual ~DataFlowGraph();
20 
21  /// Connect two nodes so that data runs from tail to head.
22  /// Return false on error.
24  size_t tail_port=0, size_t head_port=0);
25 
26  /// Run the graph, return false on error.
27  virtual bool run();
28 
29 
30  virtual void configure(const WireCell::Configuration& config);
32 
33  private:
34  tbb::task_scheduler_init m_sched; // pass in number of threads
35  tbb::flow::graph m_graph; // here lives the TBB graph
37  };
38 
39 }
40 
41 #endif
42 
virtual bool run()
Run the graph, return false on error.
tbb::flow::graph m_graph
Definition: DataFlowGraph.h:35
virtual bool connect(WireCell::INode::pointer tail, WireCell::INode::pointer head, size_t tail_port=0, size_t head_port=0)
def graph(desc, maker=maker)
Definition: apa.py:294
static Config * config
Definition: config.cpp:1054
std::shared_ptr< Interface > pointer
Definition: Interface.h:16
virtual WireCell::Configuration default_configuration() const
Optional, override to return a hard-coded default configuration.
DataFlowGraph(int max_threads=0)
tbb::task_scheduler_init m_sched
Definition: DataFlowGraph.h:34
virtual void configure(const WireCell::Configuration &config)
Accept a configuration.
Json::Value Configuration
Definition: Configuration.h:50