Public Member Functions | Private Attributes | List of all members
WireCell::Gen::DepoFanout Class Reference

#include <DepoFanout.h>

Inheritance diagram for WireCell::Gen::DepoFanout:
WireCell::IDepoFanout WireCell::IConfigurable WireCell::IFanoutNode< IDepo, IDepo, 0 > WireCell::IComponent< IConfigurable > WireCell::IFanoutNodeBase WireCell::Interface WireCell::INode WireCell::IComponent< INode > WireCell::Interface

Public Member Functions

 DepoFanout (size_t multiplicity=0)
 
virtual ~DepoFanout ()
 
virtual std::vector< std::stringoutput_types ()
 
virtual bool operator() (const input_pointer &in, output_vector &outv)
 
virtual void configure (const WireCell::Configuration &cfg)
 Accept a configuration. More...
 
virtual WireCell::Configuration default_configuration () const
 Optional, override to return a hard-coded default configuration. More...
 
- Public Member Functions inherited from WireCell::IDepoFanout
virtual ~IDepoFanout ()
 
virtual std::string signature ()
 
- Public Member Functions inherited from WireCell::IFanoutNode< IDepo, IDepo, 0 >
virtual ~IFanoutNode ()
 
virtual bool operator() (const boost::any &anyin, any_vector &anyv)
 The calling signature: More...
 
virtual std::vector< std::stringinput_types ()
 
- Public Member Functions inherited from WireCell::IFanoutNodeBase
virtual ~IFanoutNodeBase ()
 
virtual NodeCategory category ()
 Return the behavior category type. More...
 
virtual int concurrency ()
 Fanout nodes can usually do their thing stateless. More...
 
- Public Member Functions inherited from WireCell::INode
virtual ~INode ()
 
virtual void reset ()
 
- Public Member Functions inherited from WireCell::IComponent< INode >
virtual ~IComponent ()
 
- Public Member Functions inherited from WireCell::Interface
virtual ~Interface ()
 
- Public Member Functions inherited from WireCell::IConfigurable
virtual ~IConfigurable ()
 
- Public Member Functions inherited from WireCell::IComponent< IConfigurable >
virtual ~IComponent ()
 

Private Attributes

size_t m_multiplicity
 

Additional Inherited Members

- Public Types inherited from WireCell::IFanoutNode< IDepo, IDepo, 0 >
typedef IDepo input_type
 
typedef IDepo output_type
 
typedef std::shared_ptr< const IDepoinput_pointer
 
typedef std::shared_ptr< const IDepooutput_pointer
 
typedef std::vector< output_pointeroutput_vector
 
- Public Types inherited from WireCell::IFanoutNodeBase
typedef std::shared_ptr< IFanoutNodeBasepointer
 
typedef std::vector< boost::any > any_vector
 
- Public Types inherited from WireCell::INode
enum  NodeCategory {
  unknown, sourceNode, sinkNode, functionNode,
  queuedoutNode, joinNode, splitNode, faninNode,
  fanoutNode, multioutNode, hydraNode
}
 
- Public Types inherited from WireCell::IComponent< INode >
typedef std::shared_ptr< INodepointer
 Access subclass facet by pointer. More...
 
typedef std::vector< pointervector
 Vector of shared pointers. More...
 
- Public Types inherited from WireCell::Interface
typedef std::shared_ptr< Interfacepointer
 
- Public Types inherited from WireCell::IComponent< IConfigurable >
typedef std::shared_ptr< IConfigurablepointer
 Access subclass facet by pointer. More...
 
typedef std::vector< pointervector
 Vector of shared pointers. More...
 

Detailed Description

Definition at line 11 of file DepoFanout.h.

Constructor & Destructor Documentation

Gen::DepoFanout::DepoFanout ( size_t  multiplicity = 0)

Definition at line 16 of file DepoFanout.cxx.

17  : m_multiplicity(multiplicity)
18 {
19 }
Gen::DepoFanout::~DepoFanout ( )
virtual

Definition at line 21 of file DepoFanout.cxx.

22 {
23 }

Member Function Documentation

void Gen::DepoFanout::configure ( const WireCell::Configuration config)
virtual

Accept a configuration.

Implements WireCell::IConfigurable.

Definition at line 33 of file DepoFanout.cxx.

34 {
35  int m = get<int>(cfg, "multiplicity", (int)m_multiplicity);
36  if (m<=0) {
37  THROW(ValueError() << errmsg{"DepoFanout multiplicity must be positive"});
38  }
39  m_multiplicity = m;
40 }
static const double m
Definition: Units.h:79
boost::error_info< struct tag_errmsg, std::string > errmsg
Definition: Exceptions.h:54
cfg
Definition: dbjson.py:29
#define THROW(e)
Definition: Exceptions.h:25
WireCell::Configuration Gen::DepoFanout::default_configuration ( ) const
virtual

Optional, override to return a hard-coded default configuration.

Reimplemented from WireCell::IConfigurable.

Definition at line 26 of file DepoFanout.cxx.

27 {
29  cfg["multiplicity"] = (int)m_multiplicity;
30  return cfg;
31 }
cfg
Definition: dbjson.py:29
Json::Value Configuration
Definition: Configuration.h:50
bool Gen::DepoFanout::operator() ( const input_pointer in,
output_vector outv 
)
virtual

Implements WireCell::IFanoutNode< IDepo, IDepo, 0 >.

Definition at line 51 of file DepoFanout.cxx.

52 {
53  // Note: if "in" indicates EOS, just pass it on
54 
55  outv.resize(m_multiplicity);
56  for (size_t ind=0; ind<m_multiplicity; ++ind) {
57  outv[ind] = in;
58  }
59  return true;
60 }
std::vector< std::string > Gen::DepoFanout::output_types ( )
virtual

Implements WireCell::IDepoFanout.

Definition at line 43 of file DepoFanout.cxx.

44 {
45  const std::string tname = std::string(typeid(output_type).name());
46  std::vector<std::string> ret(m_multiplicity, tname);
47  return ret;
48 }
static QCString name
Definition: declinfo.cpp:673
std::string string
Definition: nybbler.cc:12

Member Data Documentation

size_t WireCell::Gen::DepoFanout::m_multiplicity
private

Definition at line 27 of file DepoFanout.h.


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