Main Page
Related Pages
Modules
Namespaces
Classes
Files
Examples
File List
File Members
wire-cell-build
tbb
inc
WireCellTbb
SourceCat.h
Go to the documentation of this file.
1
/** Facade/adapter to TBB for source node category. */
2
#ifndef WIRECELLTBB_SOURCECAT
3
#define WIRECELLTBB_SOURCECAT
4
5
#include "
WireCellIface/ISourceNode.h
"
6
#include "
WireCellTbb/NodeWrapper.h
"
7
8
9
namespace
WireCellTbb
{
10
11
12
// adapter to convert from WC source node to TBB source node body.
13
class
SourceBody
{
14
WireCell::ISourceNodeBase::pointer
m_wcnode
;
15
public
:
16
~SourceBody
() {}
17
18
SourceBody
(
WireCell::INode::pointer
wcnode) {
19
m_wcnode = std::dynamic_pointer_cast<
WireCell::ISourceNodeBase
>(wcnode);
20
}
21
bool
operator()
(boost::any& out) {
22
return
(*m_wcnode)(out);
23
}
24
};
25
26
// implement facade to access ports for source nodes
27
class
SourceNodeWrapper
:
public
NodeWrapper
{
28
source_node
*
m_tbbnode
;
29
public
:
30
SourceNodeWrapper
(
tbb::flow::graph
&
graph
,
WireCell::INode::pointer
wcnode)
31
: m_tbbnode(new
source_node
(graph,
SourceBody
(wcnode), false))
32
{ }
33
~SourceNodeWrapper
() {
34
delete
m_tbbnode;
35
}
36
virtual
void
initialize
() {
37
m_tbbnode->activate();
38
}
39
virtual
sender_port_vector
sender_ports
() {
40
auto
ptr
=
dynamic_cast<
sender_type
*
>
(m_tbbnode);
41
return
sender_port_vector
{
ptr
};
42
}
43
};
44
}
45
#endif
WireCellTbb::SourceBody::operator()
bool operator()(boost::any &out)
Definition:
SourceCat.h:21
WireCellTbb::SourceNodeWrapper
Definition:
SourceCat.h:27
wirecell.util.wires.apa.graph
def graph(desc, maker=maker)
Definition:
apa.py:294
WireCellTbb::SourceBody::~SourceBody
~SourceBody()
Definition:
SourceCat.h:16
WireCellTbb::SourceNodeWrapper::initialize
virtual void initialize()
Definition:
SourceCat.h:36
WireCellTbb::NodeWrapper
Definition:
NodeWrapper.h:38
WireCell::ISourceNodeBase
Definition:
ISourceNode.h:13
WireCellTbb::SourceBody
Definition:
SourceCat.h:13
WireCellTbb::source_node
tbb::flow::source_node< boost::any > source_node
Types for TBB nodes.
Definition:
NodeWrapper.h:28
WireCell::Interface::pointer
std::shared_ptr< Interface > pointer
Definition:
Interface.h:16
WireCellTbb::SourceNodeWrapper::sender_ports
virtual sender_port_vector sender_ports()
Definition:
SourceCat.h:39
WireCellTbb::SourceNodeWrapper::SourceNodeWrapper
SourceNodeWrapper(tbb::flow::graph &graph, WireCell::INode::pointer wcnode)
Definition:
SourceCat.h:30
WireCellTbb::sender_type
tbb::flow::sender< boost::any > sender_type
Definition:
NodeWrapper.h:15
WireCellTbb::SourceNodeWrapper::m_tbbnode
source_node * m_tbbnode
Definition:
SourceCat.h:28
WireCellTbb
Definition:
DataFlowGraph.h:14
ptr
const void * ptr(const T *p)
Definition:
format.h:3138
WireCell::ISourceNodeBase::pointer
std::shared_ptr< ISourceNodeBase > pointer
Definition:
ISourceNode.h:16
WireCellTbb::SourceBody::SourceBody
SourceBody(WireCell::INode::pointer wcnode)
Definition:
SourceCat.h:18
WireCellTbb::SourceBody::m_wcnode
WireCell::ISourceNodeBase::pointer m_wcnode
Definition:
SourceCat.h:14
WireCellTbb::sender_port_vector
std::vector< sender_type * > sender_port_vector
Definition:
NodeWrapper.h:18
NodeWrapper.h
ISourceNode.h
WireCellTbb::SourceNodeWrapper::~SourceNodeWrapper
~SourceNodeWrapper()
Definition:
SourceCat.h:33
Generated by
1.8.11