OSSIM - Open Source Software Image Map  Version 1.9.0 (20180803)
ossimImageReconstructionFilterRegistry.cpp
Go to the documentation of this file.
1 //*******************************************************************
2 //
3 // License: See top level LICENSE.txt file.
4 //
5 // Author: Garrett Potts (gpotts@imagelinks.com)
6 //
7 //*************************************************************************
8 // $Id: ossimImageReconstructionFilterRegistry.cpp 9963 2006-11-28 21:11:01Z gpotts $
9 
10 #include <algorithm>
11 #include <vector>
14 #include <ossim/base/ossimString.h>
15 
17 
18 RTTI_DEF1(ossimImageReconstructionFilterRegistry, "ossimImageReconstructionFilterRegistry", ossimImageSourceFactoryBase);
19 
21 {
22  theInstance = this;
23 }
24 
26 {
27  theInstance = NULL;
28 }
29 
31 {
32  if(theInstance == NULL)
33  {
36  }
37  return theInstance;
38 }
39 
41 {
42  ossimObject* result = NULL;
43  std::vector<ossimImageSourceFactoryBase*>::const_iterator factory;
44 
45  factory = theFactoryList.begin();
46  while((factory != theFactoryList.end()) && !result)
47  {
48  result = (*factory)->createObject(name);
49  ++factory;
50  }
51 
52  return result;
53 }
54 
56  const char* prefix)const
57 {
58  ossimObject* result = NULL;
59  std::vector<ossimImageSourceFactoryBase*>::const_iterator factory;
60 
61  factory = theFactoryList.begin();
62  while((factory != theFactoryList.end()) && !result)
63  {
64  result = (*factory)->createObject(kwl, prefix);
65  ++factory;
66  }
67 
68  return result;
69 
70 }
71 
72 void ossimImageReconstructionFilterRegistry::getTypeNameList(std::vector<ossimString>& typeList)const
73 {
74  std::vector<ossimString> result;
75  std::vector<ossimImageSourceFactoryBase*>::const_iterator iter = theFactoryList.begin();
76 
77  while(iter != theFactoryList.end())
78  {
79  result.clear();
80  (*iter)->getTypeNameList(result);
81 
82  // now append to the end of the typeList.
83  typeList.insert(typeList.end(),
84  result.begin(),
85  result.end());
86  ++iter;
87  }
88 
89 }
90 
92 {
93  if(factory&&!findFactory(factory))
94  {
95  theFactoryList.push_back(factory);
96  }
97 }
98 
100 {
101  std::vector<ossimImageSourceFactoryBase*>::iterator iter = std::find(theFactoryList.begin(),
102  theFactoryList.end(),
103  factory);
104  if(iter != theFactoryList.end())
105  {
106  theFactoryList.erase(iter);
107  }
108 }
109 
111 {
112  return (std::find(theFactoryList.begin(),
113  theFactoryList.end(),
114  factory)!=theFactoryList.end());
115 }
virtual void getTypeNameList(std::vector< ossimString > &typeList) const
Represents serializable keyword/value map.
virtual ossimObject * createObject(const ossimString &name) const
static ossimImageReconstructionFilterFactory * instance()
void unregisterFactory(ossimImageSourceFactoryBase *factory)
static ossimImageReconstructionFilterRegistry * theInstance
std::vector< ossimImageSourceFactoryBase * > theFactoryList
static ossimImageReconstructionFilterRegistry * instance()
RTTI_DEF1(ossimImageReconstructionFilterRegistry, "ossimImageReconstructionFilterRegistry", ossimImageSourceFactoryBase)
void registerFactory(ossimImageSourceFactoryBase *factory)
bool findFactory(ossimImageSourceFactoryBase *factory) const