19 DataFlowGraph::DataFlowGraph(
int max_threads)
20 : m_sched(max_threads > 0 ? max_threads : tbb::task_scheduler_init::automatic)
33 cfg[
"max_threads"] = 1;
46 size_t sport,
size_t rport)
52 cerr <<
"DFP: failed to get tail node wrapper for " 59 cerr <<
"DFP: failed to get head node wrapper for " 64 auto sports = mytail->sender_ports();
65 if (sport < 0 || sports.size() <= sport) {
66 cerr <<
"DFP: bad sender port number: " << sport <<
endl;
70 auto rports = myhead->receiver_ports();
71 if (rport < 0 || rports.size() <= rport) {
72 cerr <<
"DFP: bad receiver port number: " << rport <<
endl;
79 cerr <<
"DFP: failed to get sender port " << sport <<
endl;
85 cerr <<
"DFP: failed to get receiver port " << rport <<
endl;
99 cerr <<
"Initialize node of type: " <<
demangle(it.first->signature()) <<
endl;
100 it.second->initialize();
std::string demangle(T const *=nullptr)
Outputs a demangled name for type T.
virtual bool run()
Run the graph, return false on error.
virtual bool connect(WireCell::INode::pointer tail, WireCell::INode::pointer head, size_t tail_port=0, size_t head_port=0)
std::shared_ptr< NodeWrapper > Node
WIRECELL_FACTORY(TbbDataFlowGraph, WireCellTbb::DataFlowGraph, WireCell::IDataFlowGraph, WireCell::IConfigurable)
std::shared_ptr< Interface > pointer
virtual WireCell::Configuration default_configuration() const
Optional, override to return a hard-coded default configuration.
tbb::flow::sender< boost::any > sender_type
virtual void configure(const WireCell::Configuration &config)
Accept a configuration.
Json::Value Configuration
QTextStream & endl(QTextStream &s)
tbb::flow::receiver< boost::any > receiver_type