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

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

Public Member Functions

 ServicesManager (fhicl::ParameterSet &&servicesPSet, ActivityRegistry &actReg)
 
 ~ServicesManager ()
 
 ServicesManager (ServicesManager const &)=delete
 
 ServicesManager (ServicesManager &&)=delete
 
ServicesManageroperator= (ServicesManager const &)=delete
 
ServicesManageroperator= (ServicesManager &&)=delete
 
template<class T >
bool isAvailable () const
 
void getParameterSets (std::vector< fhicl::ParameterSet > &out) const
 
void forceCreation ()
 
std::vector< std::stringregisterProducts (ProductDescriptions &productsToProduce, ProducingServiceSignals &signals, ProcessConfiguration const &pc)
 
template<typename T >
Tget ()
 
template<typename T >
void put (std::unique_ptr< T > &&premade_service)
 
template<typename SERVICE , typename... ARGS>
void addSystemService (ARGS &&...args)
 

Private Attributes

ActivityRegistryactReg_
 
cet::LibraryManager lm_ {Suffixes::service()}
 
std::map< TypeID, detail::ServiceCacheEntryservices_ {}
 
std::vector< TypeIDrequestedCreationOrder_ {}
 
std::stack< std::shared_ptr< detail::ServiceWrapperBase > > actualCreationOrder_ {}
 
std::vector< std::stringconfigErrMsgs_ {}
 

Detailed Description

Definition at line 41 of file ServicesManager.h.

Constructor & Destructor Documentation

art::ServicesManager::ServicesManager ( fhicl::ParameterSet &&  servicesPSet,
ActivityRegistry actReg 
)
explicit
art::ServicesManager::~ServicesManager ( )
art::ServicesManager::ServicesManager ( ServicesManager const &  )
delete
art::ServicesManager::ServicesManager ( ServicesManager &&  )
delete

Member Function Documentation

template<typename SERVICE , typename... ARGS>
void art::ServicesManager::addSystemService ( ARGS &&...  args)

Definition at line 126 of file ServicesManager.h.

References make_syst_table_plots::args, cet::bold_fontify(), art::errors::Configuration, e, and fhicl::detail::validationException::what().

126  {
127  put(std::make_unique<SERVICE>(std::forward<ARGS>(args)...));
128  }
129  catch (fhicl::detail::validationException const& e) {
130  constexpr cet::HorizontalRule rule{100};
132  << "\n"
133  << rule('=') << "\n\n"
134  << "!! The following service has been misconfigured: !!"
135  << "\n\n"
136  << rule('-') << "\n\nservice_type: "
137  << cet::bold_fontify(cet::demangle_symbol(typeid(SERVICE).name()))
138  << "\n\n"
139  << e.what() << "\n"
140  << rule('=') << "\n\n";
141  }
const XML_Char * name
Definition: expat.h:151
void put(std::unique_ptr< T > &&premade_service)
std::string bold_fontify(std::string const &s)
Definition: bold_fontify.h:8
cet::coded_exception< errors::ErrorCodes, ExceptionDetail::translate > Exception
Definition: Exception.h:66
char const * what() const noexcept override
Float_t e
Definition: plot.C:35
void art::ServicesManager::forceCreation ( )
template<typename T >
T & art::ServicesManager::get ( )

Definition at line 91 of file ServicesManager.h.

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

92  {
93  auto it = services_.find(TypeID{typeid(T)});
94  if (it == services_.end()) {
96  << "ServicesManager unable to find the service of type '"
97  << cet::demangle_symbol(typeid(T).name()) << "'.\n";
98  }
99  return it->second.get<T>(actReg_, actualCreationOrder_);
100  }
ActivityRegistry & actReg_
const XML_Char * name
Definition: expat.h:151
set< int >::iterator it
std::stack< std::shared_ptr< detail::ServiceWrapperBase > > actualCreationOrder_
cet::coded_exception< errors::ErrorCodes, ExceptionDetail::translate > Exception
Definition: Exception.h:66
std::map< TypeID, detail::ServiceCacheEntry > services_
double T
Definition: Xdiff_gwt.C:5
void art::ServicesManager::getParameterSets ( std::vector< fhicl::ParameterSet > &  out) const
template<class T >
bool art::ServicesManager::isAvailable ( ) const
inline

Definition at line 54 of file ServicesManager.h.

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

55  {
56  return services_.find(TypeID{typeid(T)}) != cend(services_);
57  }
std::map< TypeID, detail::ServiceCacheEntry > services_
double T
Definition: Xdiff_gwt.C:5
ServicesManager& art::ServicesManager::operator= ( ServicesManager const &  )
delete
ServicesManager& art::ServicesManager::operator= ( ServicesManager &&  )
delete
template<typename T >
void art::ServicesManager::put ( std::unique_ptr< T > &&  premade_service)

Definition at line 104 of file ServicesManager.h.

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

105  {
106  std::unique_ptr<detail::ServiceHelperBase> service_helper(
107  new detail::ServiceHelper<T>);
108  TypeID const id{typeid(T)};
109  auto it = services_.find(id);
110  if (it != services_.end()) {
111  throw Exception(errors::LogicError, "Service")
112  << "The system has manually added service of type "
113  << cet::demangle_symbol(id.name())
114  << ", but the service system already has a configured service of that "
115  "type\n";
116  }
118  new detail::ServiceWrapper<T>(std::move(premade_service))};
119  actualCreationOrder_.push(swb);
120  services_.emplace(
121  id, detail::ServiceCacheEntry(std::move(swb), std::move(service_helper)));
122  }
const XML_Char * name
Definition: expat.h:151
set< int >::iterator it
std::stack< std::shared_ptr< detail::ServiceWrapperBase > > actualCreationOrder_
std::shared_ptr< ServiceWrapperBase > WrapperBase_ptr
cet::coded_exception< errors::ErrorCodes, ExceptionDetail::translate > Exception
Definition: Exception.h:66
std::map< TypeID, detail::ServiceCacheEntry > services_
double T
Definition: Xdiff_gwt.C:5
std::vector<std::string> art::ServicesManager::registerProducts ( ProductDescriptions productsToProduce,
ProducingServiceSignals signals,
ProcessConfiguration const &  pc 
)

Member Data Documentation

ActivityRegistry& art::ServicesManager::actReg_
private

Definition at line 80 of file ServicesManager.h.

std::stack<std::shared_ptr<detail::ServiceWrapperBase> > art::ServicesManager::actualCreationOrder_ {}
private

Definition at line 85 of file ServicesManager.h.

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

Definition at line 86 of file ServicesManager.h.

cet::LibraryManager art::ServicesManager::lm_ {Suffixes::service()}
private

Definition at line 81 of file ServicesManager.h.

std::vector<TypeID> art::ServicesManager::requestedCreationOrder_ {}
private

Definition at line 83 of file ServicesManager.h.

std::map<TypeID, detail::ServiceCacheEntry> art::ServicesManager::services_ {}
private

Definition at line 82 of file ServicesManager.h.


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