Public Member Functions | Private Member Functions | Private Attributes | List of all members
art::detail::ServiceWrapper< T, art::ServiceScope::PER_SCHEDULE > Class Template Reference

#include "/cvmfs/nova.opensciencegrid.org/externals/art/v2_13_00/source/art/Framework/Services/Registry/detail/ServiceWrapper.h"

Inheritance diagram for art::detail::ServiceWrapper< T, art::ServiceScope::PER_SCHEDULE >:
art::detail::ServiceWrapperBase

Public Member Functions

 ServiceWrapper (ServiceWrapper const &)=delete
 
void operator= (ServiceWrapper const &)=delete
 
 ServiceWrapper (std::vector< std::shared_ptr< T >> &&service_ptrs)
 
template<class SP >
 ServiceWrapper (std::vector< SP > &&service_ptrs)
 
 ServiceWrapper (fhicl::ParameterSet const &ps, ActivityRegistry &areg, size_t const nSchedules)
 
Tget (ScheduleID sID)
 
template<typename U , typename = std::enable_if_t<std::is_base_of<U, T>::value>>
ServiceWrapper< U, art::ServiceScope::PER_SCHEDULE > * getAs () const
 

Private Member Functions

void registerProducts (MasterProductRegistry &, ProductDescriptions &, ProducingServiceSignals &, ModuleDescription const &) override
 

Private Attributes

std::vector< std::shared_ptr< T > > service_ptrs_ {}
 

Detailed Description

template<typename T>
class art::detail::ServiceWrapper< T, art::ServiceScope::PER_SCHEDULE >

Definition at line 139 of file ServiceWrapper.h.

Constructor & Destructor Documentation

template<typename T >
art::detail::ServiceWrapper< T, art::ServiceScope::PER_SCHEDULE >::ServiceWrapper ( std::vector< std::shared_ptr< T >> &&  service_ptrs)
inlineexplicit

Definition at line 147 of file ServiceWrapper.h.

148  : service_ptrs_{std::move(service_ptrs)}
149  {}
template<typename T >
template<class SP >
art::detail::ServiceWrapper< T, art::ServiceScope::PER_SCHEDULE >::ServiceWrapper ( std::vector< SP > &&  service_ptrs)
inlineexplicit

Definition at line 153 of file ServiceWrapper.h.

154  {
155  service_ptrs_.reserve(service_ptrs.size());
156  for (auto&& up : service_ptrs) {
157  service_ptrs_.emplace_back(std::move(up));
158  }
159  }
template<typename T >
art::detail::ServiceWrapper< T, art::ServiceScope::PER_SCHEDULE >::ServiceWrapper ( fhicl::ParameterSet const &  ps,
ActivityRegistry areg,
size_t const  nSchedules 
)
inline

Definition at line 162 of file ServiceWrapper.h.

References art::ScheduleID::first(), nd_projection_maker::ps, and T.

165  {
166  service_ptrs_.reserve(nSchedules);
167  ScheduleID id{ScheduleID::first()};
168  for (size_t iSched{}; iSched < nSchedules; ++iSched, id = id.next()) {
169  service_ptrs_.emplace_back(new T{ps, areg, id});
170  }
171  }
static ScheduleID first()
Definition: ScheduleID.h:82
double T
Definition: Xdiff_gwt.C:5

Member Function Documentation

template<typename T >
T& art::detail::ServiceWrapper< T, art::ServiceScope::PER_SCHEDULE >::get ( ScheduleID  sID)
inline

Definition at line 174 of file ServiceWrapper.h.

175  {
176  return *service_ptrs_.at(sID.id());
177  }
template<typename T >
template<typename U , typename = std::enable_if_t<std::is_base_of<U, T>::value>>
ServiceWrapper<U, art::ServiceScope::PER_SCHEDULE>* art::detail::ServiceWrapper< T, art::ServiceScope::PER_SCHEDULE >::getAs ( ) const
inline

Definition at line 182 of file ServiceWrapper.h.

References cet::transform_all().

183  {
184  std::vector<std::shared_ptr<U>> converted_ptrs(service_ptrs_.size());
186  converted_ptrs.begin(),
187  [](std::shared_ptr<T> const& ptr_in) {
188  return std::static_pointer_cast<U>(ptr_in);
189  });
190  return new ServiceWrapper<U, art::ServiceScope::PER_SCHEDULE>(
191  std::move(converted_ptrs));
192  }
auto transform_all(Container &, OutputIt, UnaryOp)
template<typename T >
void art::detail::ServiceWrapper< T, art::ServiceScope::PER_SCHEDULE >::registerProducts ( MasterProductRegistry ,
ProductDescriptions ,
ProducingServiceSignals ,
ModuleDescription const &   
)
inlineoverrideprivatevirtual

Implements art::detail::ServiceWrapperBase.

Definition at line 197 of file ServiceWrapper.h.

201  {}

Member Data Documentation

template<typename T >
std::vector<std::shared_ptr<T> > art::detail::ServiceWrapper< T, art::ServiceScope::PER_SCHEDULE >::service_ptrs_ {}
private

Definition at line 203 of file ServiceWrapper.h.


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