Public Member Functions | Private Attributes | List of all members
SplitQueueBuffer Class Reference
Inheritance diagram for SplitQueueBuffer:
IdNode WireCell::Pgraph::Node

Public Member Functions

 SplitQueueBuffer (int id)
 
virtual bool read ()
 
virtual bool operator() ()
 
- 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)
 
virtual bool ready ()
 
- 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

Pgraph::Queue m_buf
 

Additional Inherited Members

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

Detailed Description

Definition at line 126 of file test_pipegraph.cxx.

Constructor & Destructor Documentation

SplitQueueBuffer::SplitQueueBuffer ( int  id)
inline

Definition at line 128 of file test_pipegraph.cxx.

128 : IdNode("sqb", id, 1, 1) {}
IdNode(const std::string &name, int id, size_t nin=0, size_t nout=0)

Member Function Documentation

virtual bool SplitQueueBuffer::operator() ( void  )
inlinevirtual

Implements WireCell::Pgraph::Node.

Definition at line 135 of file test_pipegraph.cxx.

135  {
136  if (m_buf.empty()) {
137  if (iport().empty()) {
138  return false;
139  }
140  m_buf = boost::any_cast<Pgraph::Queue>(iport().get());
141  }
142  if (m_buf.empty()) {
143  return false;
144  }
145  auto d = m_buf.front();
146  m_buf.pop_front();
147  oport().put(d);
148  return true;
149  }
std::deque< Data > Queue
Definition: Port.h:24
Data get(bool pop=true)
Definition: Port.cxx:43
Port & iport(size_t ind=0)
Definition: Node.h:22
void put(Data &data)
Definition: Port.cxx:62
Pgraph::Queue m_buf
Port & oport(size_t ind=0)
Definition: Node.h:25
virtual bool SplitQueueBuffer::read ( )
inlinevirtual

Definition at line 129 of file test_pipegraph.cxx.

129  {
130  if (!m_buf.empty()) {
131  return true;
132  }
133  return IdNode::ready();
134  }
Pgraph::Queue m_buf
virtual bool ready()

Member Data Documentation

Pgraph::Queue SplitQueueBuffer::m_buf
private

Definition at line 151 of file test_pipegraph.cxx.


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