OSSIM - Open Source Software Image Map  Version 1.9.0 (20180803)
ossimOverviewBuilderFactoryRegistry.cpp
Go to the documentation of this file.
1 //----------------------------------------------------------------------------
2 //
3 // See top level LICENSE.txt file.
4 //
5 // Author: David Burken
6 //
7 // Description: The factory registry for overview builders.
8 //
9 //----------------------------------------------------------------------------
10 // $Id: ossimOverviewBuilderFactoryRegistry.cpp 19907 2011-08-05 19:55:46Z dburken $
11 
15 #include <algorithm> /* for std::find */
16 
18 
20 {
21  if ( m_instance == 0 )
22  {
25  }
26  return m_instance;
27 }
28 
30 {
31  return createObjectFromRegistry(typeName);
32 }
33 
35  const char* prefix)const
36 {
38 
39  ossimString type = kwl.find(prefix, "type");
40  if(!type.empty())
41  {
42  result = createBuilder(type);
43  if(result.valid())
44  {
45  if(!result->loadState(kwl, prefix))
46  {
47  result = 0;
48  }
49  }
50  }
51 
52  return result.release();
53 }
54 
57  const ossimString& typeName) const
58 {
59  FactoryListType::const_iterator iter = m_factoryList.begin();
60  NativeReturnType* result = 0;
61 
62  while(iter != m_factoryList.end())
63  {
64  result = (*iter)->createBuilder(typeName);
65  if (result)
66  {
67  break;
68  }
69  ++iter;
70  }
71 
72  return result;
73 }
74 
75 void ossimOverviewBuilderFactoryRegistry::getTypeNameList(std::vector<ossimString>& typeList)const
76 {
78 }
79 
81 {
82  m_instance = this;
83 }
84 
86  const ossimOverviewBuilderFactoryRegistry& /* obj */ )
87 {
88  m_instance = this;
89 }
90 
92  const ossimOverviewBuilderFactoryRegistry& /* rhs */ )
93 {
94 
95 }
Represents serializable keyword/value map.
bool valid() const
Definition: ossimRefPtr.h:75
virtual bool loadState(const ossimKeywordlist &kwl, const char *prefix=0)
Definition: ossimSource.cpp:66
const char * find(const char *key) const
static ossimOverviewBuilderFactoryRegistry * m_instance
The static instance of this class.
static ossimObjectFactoryRegistry * instance()
void operator=(const ossimOverviewBuilderFactoryRegistry &rhs)
operator= hidden from use.
ossimOverviewBuilderFactoryRegistry()
default constructor hidden from use
virtual void getTypeNameList(std::vector< ossimString > &typeList) const
Method to populate a list of supported types of all factories registered to this registry.
T * release()
Definition: ossimRefPtr.h:93
void registerFactory(T *factory, bool pushToFrontFlag=false)
Will register a factory to the factory list.
static ossimOverviewBuilderFactoryRegistry * instance()
instance method for access to theInstance pointer.
The factory registry for overview builders.
bool empty() const
Definition: ossimString.h:411
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.
ossimOverviewBuilderBase * createBuilder(const ossimString &typeName) const
Creates a builder from a string.
virtual ossimObject * createObject(const ossimString &typeName) const