Go to the documentation of this file. 1 #ifndef ServiceRegistry_ServicesManager_h
2 #define ServiceRegistry_ServicesManager_h
42 namespace serviceregistry {
56 typedef std::map<TypeIDBase, std::shared_ptr<ServiceWrapperBase>>
Type2Service;
67 std::vector<ParameterSet>& iConfiguration,
68 bool associate =
true);
78 Type2Maker::const_iterator itFoundMaker;
84 "Service Request unable to find requested service with compiler type name '",
88 const_cast<ServicesManager&>(*this).createServiceFor(itFoundMaker->second);
95 std::shared_ptr<ServiceWrapper<T>> ptr(std::dynamic_pointer_cast<
ServiceWrapper<T>>(itFound->second));
96 assert(
nullptr != ptr.get());
101 template <
typename T>
104 Type2Maker::const_iterator itFoundMaker;
113 const_cast<ServicesManager&>(*this).createServiceFor(itFoundMaker->second);
126 template <
typename T>
bool put(std::shared_ptr< ServiceWrapper< T >> iPtr)
returns false if put fails because a service of this type already exists
void connect(ActivityRegistry &iOther)
causes our ActivityRegistry's signals to be forwarded to iOther
ActivityRegistry * registry_
Type2Service type2Service_
void fillListOfMakers(std::vector< ParameterSet > &)
ServicesManager const & operator=(ServicesManager const &)=delete
void copySlotsTo(ActivityRegistry &)
copy our Service's slots to the argument's signals
constexpr element_type const * get() const
std::map< TypeIDBase, MakerHolder > Type2Maker
void createServiceFor(MakerHolder const &)
edm::propagate_const< std::shared_ptr< ServiceMakerBase > > maker_
std::vector< TypeIDBase > actualCreationOrder_
std::vector< TypeIDBase > requestedCreationOrder_
ServicesManager(std::vector< ParameterSet > &iConfiguration)
void connectTo(ActivityRegistry &iOther)
causes iOther's signals to be forward to us
ActivityRegistry registry_
edm::propagate_const< std::unique_ptr< Type2Maker > > type2Maker_
static void throwThis(Code category, char const *message0="", char const *message1="", char const *message2="", char const *message3="", char const *message4="")
void copySlotsFrom(ActivityRegistry &)
the copy the argument's slots to the our signals
std::map< TypeIDBase, std::shared_ptr< ServiceWrapperBase > > Type2Service
edm::propagate_const< std::shared_ptr< ServicesManager > > associatedManager_
bool add(ServicesManager &) const
MakerHolder(std::shared_ptr< ServiceMakerBase > iMaker, ParameterSet &iPSet, ActivityRegistry &)
bool isAvailable() const
returns true of the particular service is accessible