1 #ifndef WIRECELL_PGRAPH_WRAPPERS 2 #define WIRECELL_PGRAPH_WRAPPERS 25 namespace WireCell {
namespace Pgraph {
46 for (
auto sig : wcnode->input_types()) {
50 for (
auto sig : wcnode->output_types()) {
96 m_ok = (*m_wcnode)(obj);
118 bool ok = (*m_wcnode)(obj);
142 bool ok = (*m_wcnode)(in, out);
160 if (ip.
empty()) {
return false; }
163 bool ok = (*m_wcnode)(in, outv);
164 if (!ok)
return false;
165 for (
auto out : outv) {
172 template<
class INodeBaseType>
180 m_wcnode = std::dynamic_pointer_cast<INodeBaseType>(wcnode);
190 size_t nin = iports.size();
191 for (
size_t ind=0; ind<nin; ++ind) {
192 if (iports[ind].
empty()) {
197 for (
size_t ind=0; ind<nin; ++ind) {
198 inv[ind] = iports[ind].get();
201 bool ok = (*m_wcnode)(inv, out);
215 template<
class INodeBaseType>
223 m_wcnode = std::dynamic_pointer_cast<inode_type>(wcnode);
234 size_t nout = oports.size();
237 for (
size_t ind=0; ind<nout; ++ind) {
238 if (oports[ind].
empty()) {
248 any_vector outv(nout);
249 bool ok = (*m_wcnode)(in, outv);
254 for (
size_t ind=0; ind<nout; ++ind) {
255 oports[ind].put(outv[ind]);
289 size_t nin = iports.size();
294 for (
size_t ind=0; ind < nin; ++ind) {
295 if (iports[ind].
empty()) {
302 for (
size_t ind=0; ind < nin; ++ind) {
305 std::cerr <<
"Hydra: got broken edge\n";
311 inqv[ind].insert(inqv[ind].
begin(), edge->begin(), edge->end());
315 size_t nout = oports.size();
321 bool ok = (*m_wcnode)(inqv, outqv);
322 if (!ok) {
return false; }
330 for (
size_t ind=0; ind < nin; ++ind) {
331 size_t want = inqv[ind].size();
332 while (iports[ind].
size() > want) {
338 for (
size_t ind=0; ind < nout; ++ind) {
340 edge->insert(edge->end(), outqv[ind].begin(), outqv[ind].end());
std::shared_ptr< IHydraNodeBase > pointer
IFunctionNodeBase::pointer m_wcnode
Queuedout(INode::pointer wcnode)
ISinkNodeBase::pointer m_wcnode
boost::error_info< struct tag_errmsg, std::string > errmsg
JoinFanin< IFaninNodeBase > Fanin
std::shared_ptr< IFunctionNodeBase > pointer
Source(INode::pointer wcnode)
IHydraNodeBase::pointer m_wcnode
std::shared_ptr< Queue > Edge
INodeBaseType::pointer pointer
Hydra(INode::pointer wcnode)
virtual bool operator()()
INodeBaseType::any_vector any_vector
virtual bool operator()()
virtual bool operator()()
INodeBaseType::any_vector any_vector
ISourceNodeBase::pointer m_wcnode
SplitFanout< ISplitNodeBase > Split
std::deque< boost::any > queuedany
decltype(auto) constexpr size(T &&obj)
ADL-aware version of std::size.
std::shared_ptr< IQueuedoutNodeBase > pointer
virtual bool operator()()
SplitFanout< IFanoutNodeBase > Fanout
virtual bool operator()()
std::string demangle(const std::string &name)
std::shared_ptr< Interface > pointer
Port & iport(size_t ind=0)
IQueuedoutNodeBase::pointer m_wcnode
virtual bool operator()()
SplitFanout(INode::pointer wcnode)
JoinFanin(INode::pointer wcnode)
Thrown when a wrong value has been encountered.
std::vector< boost::any > any_vector
std::vector< any_queue > any_queue_vector
Function(INode::pointer wcnode)
std::shared_ptr< ISinkNodeBase > pointer
PortedNode(INode::pointer wcnode)
PortList m_ports[Port::ntypes]
std::string type(const T &t)
Sink(INode::pointer wcnode)
virtual bool operator()()
std::shared_ptr< ISourceNodeBase > pointer
virtual std::string ident()
decltype(auto) constexpr begin(T &&obj)
ADL-aware version of std::begin.
JoinFanin< IJoinNodeBase > Join
const GenericPointer< typename T::ValueType > & pointer
INodeBaseType::pointer pointer
Port & oport(size_t ind=0)
decltype(auto) constexpr empty(T &&obj)
ADL-aware version of std::empty.
PortList & output_ports()