11 #ifndef ossimFactoryListInterface_HEADER 12 #define ossimFactoryListInterface_HEADER 32 template <
class T,
class NativeType>
56 if(!factory)
return false;
112 if (mangledName.
contains(factoryTypeName))
182 const char* prefix=0)
const;
200 const char* prefix=0)
const;
207 if(!factory)
return false;
223 template <
class T,
class NativeType>
228 for(; idx<m_factoryList.size(); ++idx)
230 m_factoryList[idx]->getTypeNameList(typeList);
233 template <
class T,
class NativeType>
239 for(;((idx<m_factoryList.size())&&!result); ++idx)
241 result = m_factoryList[idx]->createObject(typeName);
246 template <
class T,
class NativeType>
248 const char* prefix)
const 253 for(;((idx<m_factoryList.size())&&!result); ++idx)
255 result = m_factoryList[idx]->createObject(kwl, prefix);
260 template <
class T,
class NativeType>
263 NativeType* result = 0;
265 if(tempObject.
valid())
267 result =
dynamic_cast<NativeType*
>(tempObject.
get());
277 template <
class T,
class NativeType>
279 const char* prefix)
const 281 NativeType* result = 0;
283 if(tempObject.
valid())
285 result =
dynamic_cast<NativeType*
>(tempObject.
get());
std::vector< T * > FactoryListType
Represents serializable keyword/value map.
NativeType NativeReturnType
bool contains(char aChar) const
The is a factory list interface that allows registries to be accessed in a common way...
FactoryListType m_factoryList
void addFactory(T *factory)
This is for backward compatability and calls registerFactory for simple adds.
std::mutex m_factoryListMutex
void unregisterFactory(T *factory)
Will remove the factory from the registry.
void registerFactoryToFront(T *factory)
Inserts the factory to the front of the list.
unsigned int ossim_uint32
NativeType * createNativeObjectFromRegistry(const ossimString &typeName) const
This is a helper method that calls the createObject and makes sure that the returned object is of the...
void registerFactory(T *factory, bool pushToFrontFlag=false)
Will register a factory to the factory list.
void registerFactoryBefore(T *factory, T *beforeThisFactory)
Will insert the factory before the beforeThisFactory.
ossimFactoryListInterface()
bool isFactoryRegistered(T *factory) const
Public access method to determine if a factory is already registered to this list.
bool findFactory(T *factory) const
Utility to find a factory in the list.
void unregisterAllFactories()
Will remove all factories from the registry.
void getAllTypeNamesFromRegistry(std::vector< ossimString > &typeList) const
Will add all object types the factories can allocate.
ossimObject * createObjectFromRegistry(const ossimString &typeName) const
This is the base object return for all objects in the system.
void unregisterFactory(const ossimString &factoryTypeName)
Will remove the factory from the registry by name.