OSSIM - Open Source Software Image Map  Version 1.9.0 (20180803)
ossimPropertyInterfaceRegistry.cpp
Go to the documentation of this file.
1 
2 
6 using namespace std;
7 
8 RTTI_DEF1( ossimPropertyInterfaceRegistry, "ossimPropertyInterfaceRegistry", ossimObject );
9 
11 
13 {
14  theInstance = NULL;
15 }
16 
18 {
19  vector<ossimPropertyInterfaceFactory*>::const_iterator i = theFactoryList.begin();
20  ossimPropertyInterface* result = NULL;
21 
22  while ( ( i != theFactoryList.end() ) && ( ! result ) )
23  {
24  result = (*i)->createInterface( obj );
25 
26  ++i;
27  }
28 
29  return result;
30 }
31 
33 {
34  if ( !theInstance)
35  {
36  theInstance = new ossimPropertyInterfaceRegistry;
37  }
38 
39  return theInstance;
40 }
41 
43 {
44  ossimObject* result = (ossimObject*)NULL;
45  vector<ossimPropertyInterfaceFactory*>::const_iterator i = theFactoryList.begin();
46 
47  while ( ( i != theFactoryList.end() ) && ( ! result ) )
48  {
49  result = (*i)->createObject(typeName);
50 
51  ++i;
52  }
53 
54  return result;
55 }
56 
58  const char* prefix)const
59 {
60  ossimObject* result = (ossimObject*)NULL;
61  vector<ossimPropertyInterfaceFactory*>::const_iterator i = theFactoryList.begin();
62 
63  while ( ( i != theFactoryList.end() ) && ( ! result ) )
64  {
65  result = (*i)->createObject(kwl, prefix);
66 
67  ++i;
68  }
69 
70  return result;
71 }
72 
73 void ossimPropertyInterfaceRegistry::getTypeNameList(std::vector<ossimString>& typeList)const
74 {
75  vector<ossimPropertyInterfaceFactory*>::const_iterator i = theFactoryList.begin();
76 
77  while ( i != theFactoryList.end() )
78  {
79  std::vector<ossimString> tempTypeList;
80 
81  (*i)->getTypeNameList(tempTypeList);
82  typeList.insert(typeList.end(),
83  tempTypeList.begin(),
84  tempTypeList.end());
85  ++i;
86  }
87 
88 }
89 
91 {
92  return registerFactory(factory);
93 }
94 
96 {
97  bool result = false;
98 
99  if ( factory )
100  {
101  theFactoryList.push_back( factory );
102  result = true;
103  }
104 
105  return result;
106 }
107 
108 extern "C"
109 {
111  {
113  }
114 }
virtual ossimPropertyInterface * createInterface(const ossimObject *obj) const
static ossimPropertyInterfaceRegistry * instance()
bool registerFactory(ossimPropertyInterfaceFactory *factory)
Represents serializable keyword/value map.
RTTI_DEF1(ossimPropertyInterfaceRegistry, "ossimPropertyInterfaceRegistry", ossimObject)
bool addFactory(ossimPropertyInterfaceFactory *factory)
void * ossimPropertyInterfaceRegistryGetInstance()
virtual ossimObject * createObject(const ossimString &typeName) const
virtual void getTypeNameList(std::vector< ossimString > &typeList) const
static ossimPropertyInterfaceRegistry * theInstance