Public Member Functions | Private Attributes | List of all members
WireCell::Img::SliceFanout Class Reference

#include <SliceFanout.h>

Inheritance diagram for WireCell::Img::SliceFanout:
WireCell::ISliceFanout WireCell::IConfigurable WireCell::IFanoutNode< ISlice, ISlice, 0 > WireCell::IComponent< IConfigurable > WireCell::IFanoutNodeBase WireCell::Interface WireCell::INode WireCell::IComponent< INode > WireCell::Interface

Public Member Functions

 SliceFanout (size_t multiplicity=0)
 
virtual ~SliceFanout ()
 
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::ISliceFanout
virtual ~ISliceFanout ()
 
virtual std::string signature ()
 
- Public Member Functions inherited from WireCell::IFanoutNode< ISlice, ISlice, 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 l
 

Additional Inherited Members

- Public Types inherited from WireCell::IFanoutNode< ISlice, ISlice, 0 >
typedef ISlice input_type
 
typedef ISlice output_type
 
typedef std::shared_ptr< const ISliceinput_pointer
 
typedef std::shared_ptr< const ISliceoutput_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 SliceFanout.h.

Constructor & Destructor Documentation

Img::SliceFanout::SliceFanout ( size_t  multiplicity = 0)

Definition at line 12 of file SliceFanout.cxx.

13  : m_multiplicity(multiplicity)
14  , l(Log::logger("glue"))
15 {
16 }
logptr_t logger(std::string name)
Definition: Logging.cxx:71
Img::SliceFanout::~SliceFanout ( )
virtual

Definition at line 17 of file SliceFanout.cxx.

18 {
19 }

Member Function Documentation

void Img::SliceFanout::configure ( const WireCell::Configuration config)
virtual

Accept a configuration.

Implements WireCell::IConfigurable.

Definition at line 28 of file SliceFanout.cxx.

29 {
30  int m = get<int>(cfg, "multiplicity", (int)m_multiplicity);
31  if (m<=0) {
32  l->critical("SliceFanout multiplicity must be positive");
33  THROW(ValueError() << errmsg{"SliceFanout multiplicity must be positive"});
34  }
35  m_multiplicity = m;
36 }
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 Img::SliceFanout::default_configuration ( ) const
virtual

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

Reimplemented from WireCell::IConfigurable.

Definition at line 21 of file SliceFanout.cxx.

22 {
24  // How many output ports
25  cfg["multiplicity"] = (int)m_multiplicity;
26  return cfg;
27 }
cfg
Definition: dbjson.py:29
Json::Value Configuration
Definition: Configuration.h:50
bool Img::SliceFanout::operator() ( const input_pointer in,
output_vector outv 
)
virtual

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

Definition at line 47 of file SliceFanout.cxx.

48 {
49  outv.resize(m_multiplicity);
50 
51  if (!in) {
52  SPDLOG_LOGGER_TRACE(l,"SliceFanout: sending out {} EOSes", m_multiplicity);
53  for (size_t ind=0; ind<m_multiplicity; ++ind) {
54  outv[ind] = nullptr;
55  }
56  return true;
57  }
58 
59  SPDLOG_LOGGER_TRACE(l, "SliceFanout: {}x of #{} t={} + {} in nchan={}",
60  m_multiplicity, in->ident(), in->start(), in->span(),
61  in->activity().size());
62 
63  for (size_t ind=0; ind<m_multiplicity; ++ind) {
64  outv[ind] = in;
65  }
66  return true;
67 }
#define SPDLOG_LOGGER_TRACE(logger,...)
Definition: spdlog.h:319
std::vector< std::string > Img::SliceFanout::output_types ( )
virtual

Implements WireCell::ISliceFanout.

Definition at line 39 of file SliceFanout.cxx.

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

Member Data Documentation

Log::logptr_t WireCell::Img::SliceFanout::l
private

Definition at line 29 of file SliceFanout.h.

size_t WireCell::Img::SliceFanout::m_multiplicity
private

Definition at line 28 of file SliceFanout.h.


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