Public Types | Public Member Functions | Private Types | Private Member Functions | Private Attributes | List of all members
art::ServicesManager Class Reference

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

Public Types

using ParameterSets = std::vector< fhicl::ParameterSet >
 

Public Member Functions

 ServicesManager (ServicesManager const &)=delete
 
ServicesManageroperator= (ServicesManager const &)=delete
 
 ServicesManager (ParameterSets const &, cet::LibraryManager const &, ActivityRegistry &)
 
 ~ServicesManager ()
 
template<typename T , typename = std::enable_if_t<detail::ServiceHelper<T>::scope_val != ServiceScope::PER_SCHEDULE>>
Tget ()
 
template<typename T , typename = std::enable_if_t<detail::ServiceHelper<T>::scope_val == ServiceScope::PER_SCHEDULE>>
Tget (ScheduleID)
 
template<class T >
bool isAvailable () const
 
template<typename T , typename = std::enable_if_t<detail::ServiceHelper<T>::scope_val != ServiceScope::PER_SCHEDULE>>
void put (std::unique_ptr< T > &&premade_service)
 
template<typename SP , typename = std::enable_if_t< detail::ServiceHelper<typename SP::element_type>::scope_val == ServiceScope::PER_SCHEDULE>>
void put (std::vector< SP > &&premade_services)
 
void forceCreation ()
 
void registerProducts (MasterProductRegistry &mpr, ProductDescriptions &productsToProduce, ProducingServiceSignals &signals, ProcessConfiguration const &pc)
 
void getParameterSets (ParameterSets &out) const
 

Private Types

using SHBCREATOR_t) = std::unique_ptr< detail::ServiceHelperBase >(*)(
 
using NameIndex = std::map< std::string, detail::ServiceCache::iterator >
 
using TypeIDs = std::vector< TypeID >
 

Private Member Functions

void fillCache_ (ParameterSets const &psets, cet::LibraryManager const &lm)
 
std::pair< detail::ServiceCache::iterator, bool > insertImpl_ (fhicl::ParameterSet const &pset, std::unique_ptr< detail::ServiceHelperBase > &&helper)
 
void insertInterface_ (fhicl::ParameterSet const &pset, std::unique_ptr< detail::ServiceHelperBase > &&helper, detail::ServiceCache::iterator implEntry)
 

Private Attributes

art::ActivityRegistryregistry_
 
detail::ServiceCache factory_ {}
 
NameIndex index_ {}
 
TypeIDs requestedCreationOrder_ {}
 
detail::ServiceStack actualCreationOrder_ {}
 
std::vector< std::stringconfigErrMsgs_ {}
 

Detailed Description

Definition at line 42 of file ServicesManager.h.

Member Typedef Documentation

using art::ServicesManager::NameIndex = std::map<std::string, detail::ServiceCache::iterator>
private

Definition at line 100 of file ServicesManager.h.

Definition at line 48 of file ServicesManager.h.

using art::ServicesManager::SHBCREATOR_t = std::unique_ptr<detail::ServiceHelperBase> (*)(
private

Definition at line 99 of file ServicesManager.h.

using art::ServicesManager::TypeIDs = std::vector<TypeID>
private

Definition at line 101 of file ServicesManager.h.

Constructor & Destructor Documentation

art::ServicesManager::ServicesManager ( ServicesManager const &  )
delete
art::ServicesManager::ServicesManager ( ParameterSets const &  ,
cet::LibraryManager const &  ,
ActivityRegistry  
)
explicit
art::ServicesManager::~ServicesManager ( )

Member Function Documentation

void art::ServicesManager::fillCache_ ( ParameterSets const &  psets,
cet::LibraryManager const &  lm 
)
private
void art::ServicesManager::forceCreation ( )
template<typename T , typename >
T & art::ServicesManager::get ( )

Definition at line 128 of file ServicesManager.h.

References it, art::errors::ServiceNotFound, and T.

129 {
130  // Find the correct ServiceCacheEntry object.
131  auto it = factory_.find(TypeID{typeid(T)});
132  if (it == factory_.end())
134  << "art::ServicesManager unable to find the service of type '"
135  << cet::demangle_symbol(typeid(T).name()) << "'.\n";
136  return it->second.get<T>(registry_, actualCreationOrder_);
137 } // get<>()
const XML_Char * name
Definition: expat.h:151
set< int >::iterator it
detail::ServiceStack actualCreationOrder_
cet::coded_exception< errors::ErrorCodes, ExceptionDetail::translate > Exception
Definition: Exception.h:66
detail::ServiceCache factory_
double T
Definition: Xdiff_gwt.C:5
art::ActivityRegistry & registry_
template<typename T , typename >
T & art::ServicesManager::get ( ScheduleID  sID)

Definition at line 141 of file ServicesManager.h.

References it, art::errors::ServiceNotFound, and T.

142 {
143  // Find the correct ServiceCacheEntry object.
144  auto it = factory_.find(TypeID{typeid(T)});
145  if (it == factory_.end())
147  << "art::ServicesManager unable to find the service of type '"
148  << cet::demangle_symbol(typeid(T).name()) << "'.\n";
149  return it->second.get<T>(registry_, actualCreationOrder_, sID);
150 } // get<>()
const XML_Char * name
Definition: expat.h:151
set< int >::iterator it
detail::ServiceStack actualCreationOrder_
cet::coded_exception< errors::ErrorCodes, ExceptionDetail::translate > Exception
Definition: Exception.h:66
detail::ServiceCache factory_
double T
Definition: Xdiff_gwt.C:5
art::ActivityRegistry & registry_
void art::ServicesManager::getParameterSets ( ParameterSets out) const
std::pair<detail::ServiceCache::iterator, bool> art::ServicesManager::insertImpl_ ( fhicl::ParameterSet const &  pset,
std::unique_ptr< detail::ServiceHelperBase > &&  helper 
)
private
void art::ServicesManager::insertInterface_ ( fhicl::ParameterSet const &  pset,
std::unique_ptr< detail::ServiceHelperBase > &&  helper,
detail::ServiceCache::iterator  implEntry 
)
private
template<class T >
bool art::ServicesManager::isAvailable ( ) const
inline

Definition at line 69 of file ServicesManager.h.

References confusionMatrixTree::out, python.hepunit::pc, and T.

70  {
71  return factory_.find(TypeID(typeid(T))) != factory_.end();
72  }
detail::ServiceCache factory_
double T
Definition: Xdiff_gwt.C:5
ServicesManager& art::ServicesManager::operator= ( ServicesManager const &  )
delete
template<typename T , typename >
void art::ServicesManager::put ( std::unique_ptr< T > &&  premade_service)

Definition at line 154 of file ServicesManager.h.

References it, art::errors::LogicError, and T.

155 {
156  std::unique_ptr<detail::ServiceHelperBase> service_helper(
157  new detail::ServiceHelper<T>);
158  TypeID const id{typeid(T)};
159  detail::ServiceCache::const_iterator it = factory_.find(id);
160  if (it != factory_.end()) {
161  throw art::Exception(art::errors::LogicError, "Service")
162  << "The system has manually added service of type "
163  << cet::demangle_symbol(id.name())
164  << ", but the service system already has a configured service"
165  << " of that type\n";
166  }
168  new detail::ServiceWrapper<T, detail::ServiceHelper<T>::scope_val>(
169  std::move(premade_service)));
170  actualCreationOrder_.push(swb);
171  factory_.emplace(
172  id, detail::ServiceCacheEntry(std::move(swb), std::move(service_helper)));
173 }
const XML_Char * name
Definition: expat.h:151
set< int >::iterator it
std::shared_ptr< detail::ServiceWrapperBase > WrapperBase_ptr
detail::ServiceStack actualCreationOrder_
cet::coded_exception< errors::ErrorCodes, ExceptionDetail::translate > Exception
Definition: Exception.h:66
detail::ServiceCache factory_
double T
Definition: Xdiff_gwt.C:5
template<typename SP , typename >
void art::ServicesManager::put ( std::vector< SP > &&  premade_services)

Definition at line 177 of file ServicesManager.h.

References it, and art::errors::LogicError.

178 {
179  using element_type = typename SP::element_type;
180  std::unique_ptr<detail::ServiceHelperBase> service_helper(
181  new detail::ServiceHelper<element_type>);
182  TypeID const id{typeid(element_type)};
183  detail::ServiceCache::const_iterator it = factory_.find(id);
184  if (it != factory_.end()) {
185  throw art::Exception(art::errors::LogicError, "Service:")
186  << "The system has manually added service of type "
187  << cet::demangle_symbol(id.name())
188  << ", but the service system already has a configured service"
189  << " of that type\n";
190  }
192  new detail::ServiceWrapper<element_type,
193  detail::ServiceHelper<element_type>::scope_val>(
194  std::move(premade_services)));
195  actualCreationOrder_.push(swb);
196  factory_.emplace(
197  id, detail::ServiceCacheEntry(std::move(swb), std::move(service_helper)));
198 }
const XML_Char * name
Definition: expat.h:151
set< int >::iterator it
std::shared_ptr< detail::ServiceWrapperBase > WrapperBase_ptr
detail::ServiceStack actualCreationOrder_
cet::coded_exception< errors::ErrorCodes, ExceptionDetail::translate > Exception
Definition: Exception.h:66
detail::ServiceCache factory_
void art::ServicesManager::registerProducts ( MasterProductRegistry mpr,
ProductDescriptions productsToProduce,
ProducingServiceSignals signals,
ProcessConfiguration const &  pc 
)

Member Data Documentation

detail::ServiceStack art::ServicesManager::actualCreationOrder_ {}
private

Definition at line 119 of file ServicesManager.h.

std::vector<std::string> art::ServicesManager::configErrMsgs_ {}
private

Definition at line 120 of file ServicesManager.h.

detail::ServiceCache art::ServicesManager::factory_ {}
private

Definition at line 115 of file ServicesManager.h.

NameIndex art::ServicesManager::index_ {}
private

Definition at line 116 of file ServicesManager.h.

art::ActivityRegistry& art::ServicesManager::registry_
private

Definition at line 114 of file ServicesManager.h.

TypeIDs art::ServicesManager::requestedCreationOrder_ {}
private

Definition at line 118 of file ServicesManager.h.


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