Public Member Functions | Private Attributes | List of all members
WireCell::Pgraph::Function Class Reference

#include <Wrappers.h>

Inheritance diagram for WireCell::Pgraph::Function:
WireCell::Pgraph::PortedNode WireCell::Pgraph::Node

Public Member Functions

 Function (INode::pointer wcnode)
 
virtual ~Function ()
 
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

IFunctionNodeBase::pointer m_wcnode
 

Additional Inherited Members

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

Detailed Description

Definition at line 124 of file Wrappers.h.

Constructor & Destructor Documentation

WireCell::Pgraph::Function::Function ( INode::pointer  wcnode)
inline

Definition at line 127 of file Wrappers.h.

127  : PortedNode(wcnode) {
128  m_wcnode = std::dynamic_pointer_cast<IFunctionNodeBase>(wcnode);
129  }
IFunctionNodeBase::pointer m_wcnode
Definition: Wrappers.h:125
PortedNode(INode::pointer wcnode)
Definition: Wrappers.h:40
virtual WireCell::Pgraph::Function::~Function ( )
inlinevirtual

Definition at line 130 of file Wrappers.h.

130 {}

Member Function Documentation

virtual bool WireCell::Pgraph::Function::operator() ( void  )
inlinevirtual

Implements WireCell::Pgraph::Node.

Definition at line 131 of file Wrappers.h.

131  {
132  Port& op = oport();
133  if (op.size()) {
134  return false; // don't call me if I've got existing output waiting
135  }
136  Port& ip = iport();
137  if (ip.empty()) {
138  return false; // don't call me if there is nothing to give me.
139  }
140  boost::any out;
141  auto in = ip.get();
142  bool ok = (*m_wcnode)(in, out);
143  if (!ok) {
144  return false;
145  }
146  op.put(out);
147  return true;
148  }
virtual bool put(const port_type &in)
Definition: test_typeid.cxx:41
Port & iport(size_t ind=0)
Definition: Node.h:22
virtual bool get(port_type &out) const
Definition: test_typeid.cxx:42
Port & oport(size_t ind=0)
Definition: Node.h:25

Member Data Documentation

IFunctionNodeBase::pointer WireCell::Pgraph::Function::m_wcnode
private

Definition at line 125 of file Wrappers.h.


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