LArSoft  v09_90_00
Liquid Argon Software toolkit - https://larsoft.org/
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
 

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_
template<typename T >
art::detail::ServiceWrapper< T >::ServiceWrapper ( std::shared_ptr< T > &&  p)
inlineexplicit

Definition at line 58 of file ServiceWrapper.h.

59  : service_ptr_{std::move(p)}
60  {}
std::shared_ptr< T > service_ptr_

Member Function Documentation

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

Definition at line 63 of file ServiceWrapper.h.

References art::detail::ServiceWrapper< T >::service_ptr_.

64  {
65  return *service_ptr_;
66  }
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 71 of file ServiceWrapper.h.

References art::detail::ServiceWrapper< T >::service_ptr_.

72  {
73  return std::make_unique<ServiceWrapper<U>>(
74  std::static_pointer_cast<U>(service_ptr_));
75  }
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 79 of file ServiceWrapper.h.

References art::detail::ServiceWrapper< T >::service_ptr_.

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

Member Data Documentation

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

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