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

Public Member Functions

 Njoin (int id, int n)
 
virtual bool ready ()
 
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)
 
- 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 ()
 

Additional Inherited Members

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

Detailed Description

Definition at line 89 of file test_pipegraph.cxx.

Constructor & Destructor Documentation

Njoin::Njoin ( int  id,
int  n 
)
inline

Definition at line 91 of file test_pipegraph.cxx.

91 : IdNode("joi", id, n, 1) {}
IdNode(const std::string &name, int id, size_t nin=0, size_t nout=0)
std::size_t n
Definition: format.h:3399

Member Function Documentation

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

Implements WireCell::Pgraph::Node.

Definition at line 103 of file test_pipegraph.cxx.

103  {
104  Pgraph::Queue outv;
105  auto& o = msg("join: ");
106  for (auto p : input_ports()) {
107  if (p.empty()) {
108  continue;
109  }
110  Pgraph::Data d = p.get();
111  int n = boost::any_cast<int>(d);
112  o << n << " ";
113  outv.push_back(d);
114  }
115  o << std::endl;
116 
117  if (outv.empty()) {
118  return false;
119  }
120 
121  Pgraph::Data out = outv;
122  oport().put(out);
123  return true;
124  }
PortList & input_ports()
Definition: Node.h:29
std::deque< Data > Queue
Definition: Port.h:24
p
Definition: test.py:223
boost::any Data
Definition: Port.h:19
void put(Data &data)
Definition: Port.cxx:62
std::ostream & msg(const std::string s)
std::size_t n
Definition: format.h:3399
Port & oport(size_t ind=0)
Definition: Node.h:25
QTextStream & endl(QTextStream &s)
virtual bool Njoin::ready ( )
inlinevirtual

Reimplemented from IdNode.

Definition at line 92 of file test_pipegraph.cxx.

92  {
93  auto& ip = input_ports();
94  for (size_t ind=0; ind<ip.size(); ++ind) {
95  auto& p = ip[ind];
96  if (p.empty()) {
97  //msg("port empty: ") << ind << std::endl;
98  return false;
99  }
100  }
101  return true;
102  }
PortList & input_ports()
Definition: Node.h:29
p
Definition: test.py:223

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