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

#include <DepoSetFanout.h>

Inheritance diagram for WireCell::Gen::DepoSetFanout:
WireCell::IDepoSetFanout WireCell::IConfigurable WireCell::IFanoutNode< IDepoSet, IDepoSet, 0 > WireCell::IComponent< IConfigurable > WireCell::IFanoutNodeBase WireCell::Interface WireCell::INode WireCell::IComponent< INode > WireCell::Interface

Public Member Functions

 DepoSetFanout (size_t multiplicity=0)
 
virtual ~DepoSetFanout ()
 
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::IDepoSetFanout
virtual ~IDepoSetFanout ()
 
virtual std::string signature ()
 
- Public Member Functions inherited from WireCell::IFanoutNode< IDepoSet, IDepoSet, 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
 
Log::logptr_t log
 

Additional Inherited Members

- Public Types inherited from WireCell::IFanoutNode< IDepoSet, IDepoSet, 0 >
typedef IDepoSet input_type
 
typedef IDepoSet output_type
 
typedef std::shared_ptr< const IDepoSetinput_pointer
 
typedef std::shared_ptr< const IDepoSetoutput_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 12 of file DepoSetFanout.h.

Constructor & Destructor Documentation

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

Definition at line 16 of file DepoSetFanout.cxx.

17  : m_multiplicity(multiplicity)
18  , log(Log::logger("glue"))
19 {
20 }
logptr_t logger(std::string name)
Definition: Logging.cxx:71
Gen::DepoSetFanout::~DepoSetFanout ( )
virtual

Definition at line 22 of file DepoSetFanout.cxx.

23 {
24 }

Member Function Documentation

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

Accept a configuration.

Implements WireCell::IConfigurable.

Definition at line 34 of file DepoSetFanout.cxx.

35 {
36  int m = get<int>(cfg, "multiplicity", (int)m_multiplicity);
37  if (m<=0) {
38  log->critical("DepoSetFanout multiplicity must be positive");
39  THROW(ValueError() << errmsg{"DepoSetFanout multiplicity must be positive"});
40  }
41  m_multiplicity = m;
42 }
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::DepoSetFanout::default_configuration ( ) const
virtual

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

Reimplemented from WireCell::IConfigurable.

Definition at line 27 of file DepoSetFanout.cxx.

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

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

Definition at line 53 of file DepoSetFanout.cxx.

54 {
55  // Note: if "in" indicates EOS, just pass it on
56  if (in) {
57  log->debug("DepoSetFanout ({}) fanout data", in->ident());
58  }
59  else {
60  log->debug("DepoSetFanout fanout EOS");
61  }
62 
63  outv.resize(m_multiplicity);
64  for (size_t ind=0; ind<m_multiplicity; ++ind) {
65  outv[ind] = in;
66  }
67  return true;
68 }
std::vector< std::string > Gen::DepoSetFanout::output_types ( )
virtual

Implements WireCell::IDepoSetFanout.

Definition at line 45 of file DepoSetFanout.cxx.

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

Member Data Documentation

Log::logptr_t WireCell::Gen::DepoSetFanout::log
private

Definition at line 30 of file DepoSetFanout.h.

size_t WireCell::Gen::DepoSetFanout::m_multiplicity
private

Definition at line 28 of file DepoSetFanout.h.


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