25 #include "storagefactory.h" 26 #include "storagefactoryregistry.h" 28 #include <kstaticdeleter.h> 32 #include <tqstringlist.h> 37 class StorageFactoryRegistry::StorageFactoryRegistryPrivate 40 TQMap<TQString, StorageFactory*> map; 43 StorageFactoryRegistry* StorageFactoryRegistry::m_instance = 0; 44 static KStaticDeleter<StorageFactoryRegistry> storagefactoryregistrysd; 46 StorageFactoryRegistry* StorageFactoryRegistry::self() 49 m_instance = storagefactoryregistrysd.setObject(m_instance, new StorageFactoryRegistry); 53 bool StorageFactoryRegistry::registerFactory(StorageFactory* factory, const TQString& typestr) 55 if (containsFactory(typestr)) 57 d->map[typestr] = factory; 61 void StorageFactoryRegistry::unregisterFactory( const TQString& typestr) 63 d->map.remove(typestr); 66 StorageFactory* StorageFactoryRegistry::getFactory( const TQString& typestr) 68 return d->map[typestr]; 71 bool StorageFactoryRegistry::containsFactory( const TQString& typestr) const 73 return d->map.contains(typestr); 76 TQStringList StorageFactoryRegistry::list() const 81 StorageFactoryRegistry::StorageFactoryRegistry() : d(new StorageFactoryRegistryPrivate) 85 StorageFactoryRegistry::~StorageFactoryRegistry()
|