OSSIM - Open Source Software Image Map  Version 1.9.0 (20180803)
ossimGdalObjectFactory.cpp
Go to the documentation of this file.
1 //----------------------------------------------------------------------------
2 //
3 // License: See top level LICENSE.txt file
4 //
5 // Author: David Burken
6 //
7 // Description: Factory for OSSIM objects from the gdal plugin.
8 //----------------------------------------------------------------------------
9 
10 #include <ossimGdalObjectFactory.h>
11 #include <ossimShapeDatabase.h>
12 #include <ossimShapeFile.h>
14 
16  "ossimGdalObjectFactory",
18 
20 
22 {
23  if ( !theInstance )
24  {
26  }
27  return theInstance;
28 }
29 
31 {}
32 
34  const ossimString& typeName)const
35 {
36  ossimObject* result = 0;
37 
38  if (typeName == "ossimShapeFile")
39  {
40  result = new ossimShapeFile();
41  }
42  else if (typeName == "ossimShapeDatabase")
43  {
44  result = new ossimShapeDatabase();
45  }
46  else if (typeName == "ossimEsriShapeFileFilter")
47  {
48  result = new ossimEsriShapeFileFilter();
49  }
50 
51  return result;
52 
53 }
54 
56  const char* prefix)const
57 {
58  ossimObject* result = 0;
59 
60  const char* type = kwl.find(prefix, "type");
61  if(type)
62  {
63  result = createObject(ossimString(type));
64  if(result)
65  {
66  result->loadState(kwl, prefix);
67  }
68  }
69 
70  return result;
71 }
72 
74  std::vector<ossimString>& typeList)const
75 {
76  typeList.push_back(ossimString("ossimShapeFile"));
77  typeList.push_back(ossimString("ossimShapeDatabase"));
78  typeList.push_back(ossimString("ossimEsriShapeFileFilter"));
79 }
80 
83 {
84 }
85 
87  const ossimGdalObjectFactory& /* rhs */)
89 {
90 }
91 
93  const ossimGdalObjectFactory& /* rhs */ )
94 {
95  return *this;
96 }
static ossimGdalObjectFactory * instance()
Represents serializable keyword/value map.
const char * find(const char *key) const
virtual bool loadState(const ossimKeywordlist &kwl, const char *prefix=0)
virtual void getTypeNameList(std::vector< ossimString > &typeList) const
Adds list of objects this factory supports.
const ossimGdalObjectFactory & operator=(const ossimGdalObjectFactory &rhs)
hidden from use operator= .
static ossimGdalObjectFactory * theInstance
The single instance of this class.
ossimGdalObjectFactory()
hidden from use default construtor.
virtual ossimObject * createObject(const ossimString &typeName) const
Object from string.
RTTI_DEF1(ossimGdalObjectFactory, "ossimGdalObjectFactory", ossimObjectFactory)
virtual ~ossimGdalObjectFactory()
virtual destructor