20 class Parametrisation;
34 mutable std::mutex mutex_;
36 std::map<std::string, FactoryBase*> factories_;
39 const std::string& factory()
const {
return factory_; }
40 std::vector<std::string> keys()
const;
41 void list( std::ostream& )
const;
42 bool has(
const std::string& builder )
const;
43 void add(
const std::string& builder,
FactoryBase* );
44 void remove(
const std::string& builder );
45 FactoryBase*
get(
const std::string& builder )
const;
51 static std::shared_ptr<FactoryRegistryT<T>> instance() {
52 static std::shared_ptr<FactoryRegistryT<T>> env(
new FactoryRegistryT<T>( T::className() ) );
65 std::shared_ptr<FactoryRegistry> attached_registry_;
69 virtual ~FactoryBase();
70 void attach_registry(
const std::shared_ptr<FactoryRegistry>& registry ) { attached_registry_ = registry; }
74 const std::string& factoryBuilder()
const {
return builder_; }
75 const std::string& factoryName()
const {
return registry_.factory(); }
81 static std::vector<std::string> keys() {
return registry().keys(); }
82 static void list( std::ostream& out ) {
return registry().list( out ); }
83 static bool has(
const std::string& builder ) {
return registry().has( builder ); }
84 static T*
get(
const std::string& builder ) {
return dynamic_cast<T*
>( registry().get( builder ) ); }
86 Factory(
const std::string& builder =
"" ) : FactoryBase( registry(), builder ) {
87 if ( not builder.empty() ) {
Contains all atlas classes and methods.
Definition: atlas-grids.cc:33