Public Member Functions | Private Types | Private Attributes | List of all members
FixedChannelGroupService Class Reference

#include <FixedChannelGroupService.h>

Inheritance diagram for FixedChannelGroupService:
ChannelGroupService

Public Member Functions

 FixedChannelGroupService (fhicl::ParameterSet const &pset)
 
 FixedChannelGroupService (fhicl::ParameterSet const &pset, art::ActivityRegistry &)
 
 ~FixedChannelGroupService ()=default
 
Index size () const
 
Name name (Index igrp) const
 
const ChannelVectorchannels (Index igrp) const
 
std::ostream & print (std::ostream &out=std::cout, std::string prefix="") const
 
- Public Member Functions inherited from ChannelGroupService
virtual ~ChannelGroupService ()=default
 

Private Types

typedef std::vector< NameNameVector
 
typedef std::vector< ChannelVectorChannelVectorVector
 

Private Attributes

NameVector m_names
 
ChannelVectorVector m_chanvecs
 

Additional Inherited Members

- Public Types inherited from ChannelGroupService
typedef unsigned int Index
 
typedef unsigned int Channel
 
typedef std::vector< ChannelChannelVector
 
typedef std::string Name
 

Detailed Description

Definition at line 14 of file FixedChannelGroupService.h.

Member Typedef Documentation

Definition at line 42 of file FixedChannelGroupService.h.

Definition at line 41 of file FixedChannelGroupService.h.

Constructor & Destructor Documentation

FixedChannelGroupService::FixedChannelGroupService ( fhicl::ParameterSet const &  pset)

Definition at line 25 of file FixedChannelGroupService_service.cc.

25  {
26  vector<string> names = pset.get_names();
27  for ( string name : names ) {
28  if ( name == "service_provider" ) continue;
29  if ( name == "service_type" ) continue;
30  ChannelVector chans = pset.get<ChannelVector>(name);
31  m_names.push_back(name);
32  m_chanvecs.emplace_back(move(chans));
33  }
34 }
def move(depos, offset)
Definition: depos.py:107
ChannelGroupService::ChannelVector ChannelVector
static std::vector< std::string > const names
Definition: FragmentType.hh:8
FixedChannelGroupService::FixedChannelGroupService ( fhicl::ParameterSet const &  pset,
art::ActivityRegistry  
)

Definition at line 39 of file FixedChannelGroupService_service.cc.

40 : FixedChannelGroupService(pset) { }
FixedChannelGroupService(fhicl::ParameterSet const &pset)
FixedChannelGroupService::~FixedChannelGroupService ( )
default

Member Function Documentation

const ChannelVector & FixedChannelGroupService::channels ( Index  igrp) const
virtual

Implements ChannelGroupService.

Definition at line 57 of file FixedChannelGroupService_service.cc.

57  {
58  if ( igrp < m_chanvecs.size() ) return m_chanvecs[igrp];
59  static ChannelVector empty;
60  return empty;
61 }
ChannelGroupService::ChannelVector ChannelVector
decltype(auto) constexpr empty(T &&obj)
ADL-aware version of std::empty.
Definition: StdUtils.h:97
Name FixedChannelGroupService::name ( Index  igrp) const
virtual

Implements ChannelGroupService.

Definition at line 50 of file FixedChannelGroupService_service.cc.

50  {
51  if ( igrp < m_names.size() ) return m_names[igrp];
52  return "NoSuchGroup";
53 }
ostream & FixedChannelGroupService::print ( std::ostream &  out = std::cout,
std::string  prefix = "" 
) const
virtual

Implements ChannelGroupService.

Definition at line 65 of file FixedChannelGroupService_service.cc.

65  {
66  out << prefix << "FixedChannelGroupService: " << endl;
67  out << prefix << " # group: " << size() << endl;
68  return out;
69 }
QTextStream & endl(QTextStream &s)
Index FixedChannelGroupService::size ( ) const
virtual

Implements ChannelGroupService.

Definition at line 44 of file FixedChannelGroupService_service.cc.

44  {
45  return m_names.size();
46 }

Member Data Documentation

ChannelVectorVector FixedChannelGroupService::m_chanvecs
private

Definition at line 46 of file FixedChannelGroupService.h.

NameVector FixedChannelGroupService::m_names
private

Definition at line 45 of file FixedChannelGroupService.h.


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