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

#include <ServiceWrapper.h>

Inheritance diagram for art::detail::ServiceWrapper< T >:
art::detail::ServiceWrapperBase

Public Member Functions

 ServiceWrapper (ServiceWrapper const &)=delete
 
ServiceWrapperoperator= (ServiceWrapper const &)=delete
 
 ServiceWrapper (fhicl::ParameterSet const &ps, ActivityRegistry &areg)
 
 ServiceWrapper (std::shared_ptr< T > &&p)
 
T & get ()
 
template<typename U , typename = std::enable_if_t<std::is_base_of_v<U, T>>>
std::unique_ptr< ServiceWrapper< U > > getAs () const
 
- Public Member Functions inherited from art::detail::ServiceWrapperBase
virtual ~ServiceWrapperBase ()=default
 
 ServiceWrapperBase ()=default
 
 ServiceWrapperBase (ServiceWrapperBase const &)=delete
 
 ServiceWrapperBase (ServiceWrapperBase &&)=delete
 
ServiceWrapperBaseoperator= (ServiceWrapperBase const &)=delete
 
ServiceWrapperBaseoperator= (ServiceWrapperBase &&)=delete
 

Private Member Functions

void registerProducts (ProductDescriptions &productsToProduce, ProducingServiceSignals &signals, ModuleDescription const &md) override
 

Private Attributes

std::shared_ptr< T > service_ptr_
 

Detailed Description

template<typename T>
class art::detail::ServiceWrapper< T >

Definition at line 19 of file ServiceWrapper.h.

Constructor & Destructor Documentation

template<typename T >
art::detail::ServiceWrapper< T >::ServiceWrapper ( ServiceWrapper< T > const &  )
delete
template<typename T >
art::detail::ServiceWrapper< T >::ServiceWrapper ( fhicl::ParameterSet const &  ps,
ActivityRegistry areg 
)
inline

Definition at line 54 of file ServiceWrapper.h.

55  : service_ptr_{makeServiceFrom<T>(ps, areg)}
56  {}
std::shared_ptr< T > service_ptr_
static constexpr double ps
Definition: Units.h:99
template<typename T >
art::detail::ServiceWrapper< T >::ServiceWrapper ( std::shared_ptr< T > &&  p)
inlineexplicit

Definition at line 58 of file ServiceWrapper.h.

58 : service_ptr_{move(p)} {}
std::shared_ptr< T > service_ptr_
def move(depos, offset)
Definition: depos.py:107
p
Definition: test.py:223

Member Function Documentation

template<typename T >
T& art::detail::ServiceWrapper< T >::get ( )
inline

Definition at line 61 of file ServiceWrapper.h.

62  {
63  return *service_ptr_;
64  }
std::shared_ptr< T > service_ptr_
template<typename T >
template<typename U , typename = std::enable_if_t<std::is_base_of_v<U, T>>>
std::unique_ptr<ServiceWrapper<U> > art::detail::ServiceWrapper< T >::getAs ( ) const
inline

Definition at line 69 of file ServiceWrapper.h.

70  {
71  return std::make_unique<ServiceWrapper<U>>(
72  std::static_pointer_cast<U>(service_ptr_));
73  }
std::shared_ptr< T > service_ptr_
template<typename T >
ServiceWrapper& art::detail::ServiceWrapper< T >::operator= ( ServiceWrapper< T > const &  )
delete
template<typename T >
void art::detail::ServiceWrapper< T >::registerProducts ( ProductDescriptions productsToProduce,
ProducingServiceSignals signals,
ModuleDescription const &  md 
)
inlineoverrideprivatevirtual

Implements art::detail::ServiceWrapperBase.

Definition at line 77 of file ServiceWrapper.h.

80  {
81  if constexpr (std::is_base_of_v<ProducingService, T>) {
82  service_ptr_->registerCallbacks(signals);
83  service_ptr_->setModuleDescription(md);
84  service_ptr_->registerProducts(productsToProduce, md);
85  }
86  }
std::shared_ptr< T > service_ptr_

Member Data Documentation

template<typename T >
std::shared_ptr<T> art::detail::ServiceWrapper< T >::service_ptr_
private

Definition at line 88 of file ServiceWrapper.h.


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