29 #include <boost/signals2.hpp> 42 template<
typename Key,
typename Interface>
49 typedef boost::signals2::signal<void (const std::string&, const CreateFunction&)>
52 typedef boost::signals2::signal<void (const std::string&, const CreateFunction&)>
75 void register_(const Key& key, const CreateFunction& create_function_);
86 template<typename Key, typename Interface>
96 template<
typename Key,
typename Interface>
102 template<
typename Key,
typename Interface>
108 template<
typename Key,
typename Interface>
110 const CreateFunction& create_function_) {
119 template<
typename Key,
typename Interface>
123 typename ImplMap::iterator it;
134 template<
typename Key,
typename Interface>
boost::signals2::signal< void(const std::string &, const CreateFunction &)> ImplAddedSignal
virtual void register_(const Key &key, const CreateFunction &create_function_)
A factory of which at most one instance exists at any time.
Objects of this class manage a family of named implementations of a particular interface.
virtual void unregister(const Key &key)
boost::function1< void *, const runtime::Properties & > CreateFunction
void unregister(const Key &key)
This template class implements the singleton pattern.
void register_(const Key &key, const CreateFunction &create_function_)
Factory< Key, Interface > base
base::CreateFunction CreateFunction
ImplRemovedSignal & signalImplRemoved()
Return the "implementation removed" signal.
ObservableSingletonFactory()
A specialized factory class objects of which emit signals when implementations are registered or unre...
ImplRemovedSignal signal_impl_removed_
ImplAddedSignal & signalImplAdded()
Return the "implementation added" signal.
ImplAddedSignal signal_impl_added_
An observable factory of which at most one instance exists at any time.
std::map< Key, CreateFunction > ImplMap
boost::signals2::signal< void(const std::string &, const CreateFunction &)> ImplRemovedSignal