Public Types | Public Member Functions | Private Attributes | List of all members
WireCell::Pgraph::SplitFanout< INodeBaseType > Class Template Reference

#include <Wrappers.h>

Inheritance diagram for WireCell::Pgraph::SplitFanout< INodeBaseType >:
WireCell::Pgraph::PortedNode WireCell::Pgraph::Node

Public Types

typedef INodeBaseType inode_type
 
typedef INodeBaseType::any_vector any_vector
 
typedef INodeBaseType::pointer pointer
 

Public Member Functions

 SplitFanout (INode::pointer wcnode)
 
virtual ~SplitFanout ()
 
virtual bool operator() ()
 
- Public Member Functions inherited from WireCell::Pgraph::PortedNode
 PortedNode (INode::pointer wcnode)
 
virtual std::string ident ()
 
- Public Member Functions inherited from WireCell::Pgraph::Node
 Node ()
 
virtual ~Node ()
 
Portiport (size_t ind=0)
 
Portoport (size_t ind=0)
 
PortListinput_ports ()
 
PortListoutput_ports ()
 
Portport (Port::Type type, size_t ind=0)
 
Portport (Port::Type type, const std::string &name)
 
bool connected ()
 

Private Attributes

pointer m_wcnode
 

Additional Inherited Members

- Protected Attributes inherited from WireCell::Pgraph::Node
PortList m_ports [Port::ntypes]
 

Detailed Description

template<class INodeBaseType>
class WireCell::Pgraph::SplitFanout< INodeBaseType >

Definition at line 216 of file Wrappers.h.

Member Typedef Documentation

template<class INodeBaseType >
typedef INodeBaseType::any_vector WireCell::Pgraph::SplitFanout< INodeBaseType >::any_vector

Definition at line 219 of file Wrappers.h.

template<class INodeBaseType >
typedef INodeBaseType WireCell::Pgraph::SplitFanout< INodeBaseType >::inode_type

Definition at line 218 of file Wrappers.h.

template<class INodeBaseType >
typedef INodeBaseType::pointer WireCell::Pgraph::SplitFanout< INodeBaseType >::pointer

Definition at line 220 of file Wrappers.h.

Constructor & Destructor Documentation

template<class INodeBaseType >
WireCell::Pgraph::SplitFanout< INodeBaseType >::SplitFanout ( INode::pointer  wcnode)
inline

Definition at line 222 of file Wrappers.h.

222  : PortedNode(wcnode) {
223  m_wcnode = std::dynamic_pointer_cast<inode_type>(wcnode);
224  }
PortedNode(INode::pointer wcnode)
Definition: Wrappers.h:40
template<class INodeBaseType >
virtual WireCell::Pgraph::SplitFanout< INodeBaseType >::~SplitFanout ( )
inlinevirtual

Definition at line 225 of file Wrappers.h.

225 {}

Member Function Documentation

template<class INodeBaseType >
virtual bool WireCell::Pgraph::SplitFanout< INodeBaseType >::operator() ( void  )
inlinevirtual

Implements WireCell::Pgraph::Node.

Definition at line 226 of file Wrappers.h.

226  {
227 
228  Port& ip = iport();
229  if (ip.empty()) {
230  return false; // don't call me if there is not any new input
231  }
232 
233  auto& oports = output_ports();
234  size_t nout = oports.size();
235 
236  bool full = true;
237  for (size_t ind=0; ind<nout; ++ind) {
238  if (oports[ind].empty()) {
239  full = false;
240  }
241  }
242  if (full) {
243  return false; // don't call me if all my output has something
244  }
245 
246  auto in = ip.get();
247 
248  any_vector outv(nout);
249  bool ok = (*m_wcnode)(in, outv);
250  if (!ok) {
251  return false;
252  }
253  //std::cerr << "SplitFanout: " << nout << " " << outv.size() << std::endl;
254  for (size_t ind=0; ind<nout; ++ind) {
255  oports[ind].put(outv[ind]);
256  }
257  return true;
258  }
INodeBaseType::any_vector any_vector
Definition: Wrappers.h:219
Port & iport(size_t ind=0)
Definition: Node.h:22
virtual bool get(port_type &out) const
Definition: test_typeid.cxx:42
decltype(auto) constexpr empty(T &&obj)
ADL-aware version of std::empty.
Definition: StdUtils.h:92
PortList & output_ports()
Definition: Node.h:32

Member Data Documentation

template<class INodeBaseType >
pointer WireCell::Pgraph::SplitFanout< INodeBaseType >::m_wcnode
private

Definition at line 260 of file Wrappers.h.


The documentation for this class was generated from the following file: