Public Types | Public Member Functions | Private Attributes | List of all members
Source< OutputType > Class Template Referenceabstract
Inheritance diagram for Source< OutputType >:
Hydra IdNode WireCell::Pgraph::Node

Public Types

typedef std::shared_ptr< const OutputType > output_pointer
 

Public Member Functions

 Source (int id, int beg, int end)
 
virtual ~Source ()
 
virtual bool ready ()
 
virtual bool operator() ()
 
virtual ~Source ()
 
virtual bool insert (AnyPorts &input)
 
virtual bool extract (AnyPorts &output)
 
virtual bool extract (output_pointer &out)=0
 
- Public Member Functions inherited from Hydra
virtual ~Hydra ()
 
- Public Member Functions inherited from IdNode
 IdNode (const std::string &name, int id, size_t nin=0, size_t nout=0)
 
int id ()
 
virtual std::string ident ()
 
std::ostream & msg (const std::string s)
 
- 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

int m_num
 
int m_end
 

Additional Inherited Members

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

Detailed Description

template<typename OutputType>
class Source< OutputType >

Definition at line 56 of file test_pipegraph.cxx.

Member Typedef Documentation

template<typename OutputType>
typedef std::shared_ptr<const OutputType> Source< OutputType >::output_pointer

Definition at line 19 of file _test_hydra.cxx.

Constructor & Destructor Documentation

template<typename OutputType>
Source< OutputType >::Source ( int  id,
int  beg,
int  end 
)
inline

Definition at line 58 of file test_pipegraph.cxx.

59  : IdNode("src", id, 0, 1), m_num(beg), m_end(end) {}
decltype(auto) constexpr end(T &&obj)
ADL-aware version of std::end.
Definition: StdUtils.h:72
IdNode(const std::string &name, int id, size_t nin=0, size_t nout=0)
template<typename OutputType>
virtual Source< OutputType >::~Source ( )
inlinevirtual

Definition at line 60 of file test_pipegraph.cxx.

60 {}
template<typename OutputType>
virtual Source< OutputType >::~Source ( )
inlinevirtual

Definition at line 17 of file _test_hydra.cxx.

17 {}

Member Function Documentation

template<typename OutputType>
virtual bool Source< OutputType >::extract ( AnyPorts output)
inlinevirtual

Implements Hydra.

Definition at line 22 of file _test_hydra.cxx.

22  {
23  output_pointer out;
24  bool ok = this->extract(out);
25  if (!ok) return false;
26  output[0].push_back(out);
27  return true;
28  }
std::shared_ptr< const OutputType > output_pointer
Definition: _test_hydra.cxx:19
virtual bool extract(AnyPorts &output)
Definition: _test_hydra.cxx:22
template<typename OutputType>
virtual bool Source< OutputType >::extract ( output_pointer out)
pure virtual

Implemented in IntSource.

template<typename OutputType>
virtual bool Source< OutputType >::insert ( AnyPorts input)
inlinevirtual

Implements Hydra.

Definition at line 21 of file _test_hydra.cxx.

21 { return false; }
template<typename OutputType>
virtual bool Source< OutputType >::operator() ( void  )
inlinevirtual

Implements WireCell::Pgraph::Node.

Definition at line 64 of file test_pipegraph.cxx.

64  {
65  if (m_num >= m_end) {
66  msg("dry\n");
67  return false;
68  }
69  msg("make: ") << m_num << std::endl;
71  oport().put(d);
72  ++m_num;
73  return true;
74  }
boost::any Data
Definition: Port.h:19
void put(Data &data)
Definition: Port.cxx:62
std::ostream & msg(const std::string s)
Port & oport(size_t ind=0)
Definition: Node.h:25
QTextStream & endl(QTextStream &s)
template<typename OutputType>
virtual bool Source< OutputType >::ready ( )
inlinevirtual

Reimplemented from IdNode.

Definition at line 61 of file test_pipegraph.cxx.

61  {
62  return m_num < m_end;
63  }

Member Data Documentation

template<typename OutputType>
int Source< OutputType >::m_end
private

Definition at line 76 of file test_pipegraph.cxx.

template<typename OutputType>
int Source< OutputType >::m_num
private

Definition at line 76 of file test_pipegraph.cxx.


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