Main Page
Related Pages
Modules
Namespaces
Classes
Files
Examples
File List
File Members
wire-cell-build
tbb
inc
WireCellTbb
SinkCat.h
Go to the documentation of this file.
1
#ifndef WIRECELLTBB_SINKCAT
2
#define WIRECELLTBB_SINKCAT
3
4
#include "
WireCellTbb/NodeWrapper.h
"
5
#include "
WireCellIface/ISinkNode.h
"
6
7
namespace
WireCellTbb
{
8
9
// adapter to convert from WC sink node to TBB sink node body.
10
class
SinkBody
{
11
WireCell::ISinkNodeBase::pointer
m_wcnode
;
12
public
:
13
~SinkBody
() {}
14
15
SinkBody
(
WireCell::INode::pointer
wcnode) {
16
m_wcnode = std::dynamic_pointer_cast<
WireCell::ISinkNodeBase
>(wcnode);
17
}
18
boost::any
operator()
(
const
boost::any& in) {
19
//bool ok = (*m_wcnode)(in);
20
(*m_wcnode)(in);
// fixme: don't ignore the return code
21
return
in;
22
}
23
};
24
25
// implement facade to access ports for sink nodes
26
class
SinkNodeWrapper
:
public
NodeWrapper
{
27
sink_node
*
m_tbbnode
;
28
public
:
29
SinkNodeWrapper
(
tbb::flow::graph
&
graph
,
WireCell::INode::pointer
wcnode) :
30
m_tbbnode(new
sink_node
(graph, wcnode->concurrency(),
SinkBody
(wcnode))) { }
31
~SinkNodeWrapper
() {
32
delete
m_tbbnode;
33
}
34
virtual
receiver_port_vector
receiver_ports
() {
35
auto
ptr
=
dynamic_cast<
receiver_type
*
>
(m_tbbnode);
36
return
receiver_port_vector
{
ptr
};
37
}
38
};
39
}
40
#endif
WireCellTbb::SinkBody::m_wcnode
WireCell::ISinkNodeBase::pointer m_wcnode
Definition:
SinkCat.h:11
wirecell.util.wires.apa.graph
def graph(desc, maker=maker)
Definition:
apa.py:294
WireCellTbb::SinkNodeWrapper::receiver_ports
virtual receiver_port_vector receiver_ports()
Definition:
SinkCat.h:34
WireCellTbb::sink_node
tbb::flow::function_node< boost::any > sink_node
Definition:
NodeWrapper.h:29
WireCellTbb::NodeWrapper
Definition:
NodeWrapper.h:38
WireCellTbb::SinkBody::~SinkBody
~SinkBody()
Definition:
SinkCat.h:13
WireCell::Interface::pointer
std::shared_ptr< Interface > pointer
Definition:
Interface.h:16
WireCellTbb::receiver_port_vector
std::vector< receiver_type * > receiver_port_vector
Definition:
NodeWrapper.h:19
WireCell::ISinkNodeBase
Definition:
ISinkNode.h:13
WireCellTbb::SinkBody::operator()
boost::any operator()(const boost::any &in)
Definition:
SinkCat.h:18
WireCellTbb::SinkNodeWrapper::m_tbbnode
sink_node * m_tbbnode
Definition:
SinkCat.h:27
WireCellTbb::SinkNodeWrapper
Definition:
SinkCat.h:26
WireCellTbb::SinkNodeWrapper::SinkNodeWrapper
SinkNodeWrapper(tbb::flow::graph &graph, WireCell::INode::pointer wcnode)
Definition:
SinkCat.h:29
WireCell::ISinkNodeBase::pointer
std::shared_ptr< ISinkNodeBase > pointer
Definition:
ISinkNode.h:16
WireCellTbb
Definition:
DataFlowGraph.h:14
ptr
const void * ptr(const T *p)
Definition:
format.h:3138
WireCellTbb::SinkBody::SinkBody
SinkBody(WireCell::INode::pointer wcnode)
Definition:
SinkCat.h:15
ISinkNode.h
NodeWrapper.h
WireCellTbb::SinkBody
Definition:
SinkCat.h:10
WireCellTbb::SinkNodeWrapper::~SinkNodeWrapper
~SinkNodeWrapper()
Definition:
SinkCat.h:31
WireCellTbb::receiver_type
tbb::flow::receiver< boost::any > receiver_type
Definition:
NodeWrapper.h:16
Generated by
1.8.11