1 #ifndef ServiceRegistry_ServicesManager_h
2 #define ServiceRegistry_ServicesManager_h
30 #include "boost/shared_ptr.hpp"
40 namespace serviceregistry {
45 MakerHolder(boost::shared_ptr<ServiceMakerBase> iMaker,
50 boost::shared_ptr<ServiceMakerBase>
maker_;
55 typedef std::map<TypeIDBase, boost::shared_ptr<ServiceWrapperBase> >
Type2Service;
66 std::vector<ParameterSet>& iConfiguration,
67 bool associate =
true);
75 Type2Maker::const_iterator itFoundMaker ;
81 "Service Request unable to find requested service with compiler type name '",
85 itFoundMaker->second.add(const_cast<ServicesManager&>(*
this));
92 boost::shared_ptr<ServiceWrapper<T> > ptr(boost::dynamic_pointer_cast<
ServiceWrapper<T> >(itFound->second));
93 assert(0 != ptr.get());
101 Type2Maker::const_iterator itFoundMaker ;
110 itFoundMaker->second.add(const_cast<ServicesManager&>(*
this));
Type2Service type2Service_
void fillListOfMakers(std::vector< ParameterSet > &)
void copySlotsTo(ActivityRegistry &)
copy our Service's slots to the argument's signals
std::map< TypeIDBase, MakerHolder > Type2Maker
std::auto_ptr< Type2Maker > type2Maker_
static void throwThis(Code category, char const *message0="", char const *message1="", char const *message2="", char const *message3="", char const *message4="")
std::vector< TypeIDBase > actualCreationOrder_
void connectTo(ActivityRegistry &iOther)
causes iOther's signals to be forward to us
std::map< TypeIDBase, boost::shared_ptr< ServiceWrapperBase > > Type2Service
bool put(boost::shared_ptr< ServiceWrapper< T > > iPtr)
returns false if put fails because a service of this type already exists
bool add(ServicesManager &) const
MakerHolder(boost::shared_ptr< ServiceMakerBase > iMaker, ParameterSet &iPSet, ActivityRegistry &)
boost::shared_ptr< ServicesManager > associatedManager_
void copySlotsFrom(ActivityRegistry &)
the copy the argument's slots to the our signals
std::vector< TypeIDBase > requestedCreationOrder_
ActivityRegistry registry_
ServicesManager(std::vector< ParameterSet > &iConfiguration)
bool isAvailable() const
returns true of the particular service is accessible
ActivityRegistry * registry_
boost::shared_ptr< ServiceMakerBase > maker_
void connect(ActivityRegistry &iOther)
causes our ActivityRegistry's signals to be forwarded to iOther
ServicesManager const & operator=(ServicesManager const &)