OSSIM - Open Source Software Image Map  Version 1.9.0 (20180803)
Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | Static Protected Attributes | List of all members
ossimImageSourceFactoryRegistry Class Reference

#include <ossimImageSourceFactoryRegistry.h>

Inheritance diagram for ossimImageSourceFactoryRegistry:
ossimImageSourceFactoryBase ossimObjectFactory ossimObject ossimReferenced

Public Member Functions

virtual ~ossimImageSourceFactoryRegistry ()
 
virtual ossimObjectcreateObject (const ossimString &name) const
 
virtual ossimObjectcreateObject (const ossimKeywordlist &kwl, const char *prefix=0) const
 
virtual void getTypeNameList (std::vector< ossimString > &typeList) const
 
void registerFactory (ossimImageSourceFactoryBase *factory)
 
void unregisterFactory (ossimImageSourceFactoryBase *factory)
 
bool findFactory (ossimImageSourceFactoryBase *factory) const
 
- Public Member Functions inherited from ossimImageSourceFactoryBase
virtual ossimImageSourcecreateImageSource (const ossimString &name) const
 
virtual ossimImageSourcecreateImageSource (const ossimKeywordlist &kwl, const char *prefix=0) const
 
- Public Member Functions inherited from ossimObjectFactory
virtual ~ossimObjectFactory ()
 
- Public Member Functions inherited from ossimObject
 ossimObject ()
 
virtual ~ossimObject ()
 
virtual ossimObjectdup () const
 
virtual ossimString getShortName () const
 
virtual ossimString getLongName () const
 
virtual ossimString getDescription () const
 
virtual ossimString getClassName () const
 
virtual RTTItypeid getType () const
 
virtual bool canCastTo (ossimObject *obj) const
 
virtual bool canCastTo (const RTTItypeid &id) const
 
virtual bool canCastTo (const ossimString &parentClassName) const
 
virtual bool saveState (ossimKeywordlist &kwl, const char *prefix=0) const
 
virtual bool loadState (const ossimKeywordlist &kwl, const char *prefix=0)
 
virtual std::ostream & print (std::ostream &out) const
 Generic print method. More...
 
virtual bool isEqualTo (const ossimObject &obj, ossimCompareType compareType=OSSIM_COMPARE_FULL) const
 
virtual void accept (ossimVisitor &visitor)
 
- Public Member Functions inherited from ossimReferenced
 ossimReferenced ()
 
 ossimReferenced (const ossimReferenced &)
 
ossimReferencedoperator= (const ossimReferenced &)
 
void ref () const
 increment the reference count by one, indicating that this object has another pointer which is referencing it. More...
 
void unref () const
 decrement the reference count by one, indicating that a pointer to this object is referencing it. More...
 
void unref_nodelete () const
 decrement the reference count by one, indicating that a pointer to this object is referencing it. More...
 
int referenceCount () const
 

Static Public Member Functions

static ossimImageSourceFactoryRegistryinstance ()
 

Protected Member Functions

 ossimImageSourceFactoryRegistry ()
 
 ossimImageSourceFactoryRegistry (const ossimImageSourceFactoryRegistry &)
 
void operator= (ossimImageSourceFactoryRegistry &)
 
- Protected Member Functions inherited from ossimImageSourceFactoryBase
 ossimImageSourceFactoryBase ()
 
 ossimImageSourceFactoryBase (const ossimImageSourceFactoryBase &)
 
const ossimImageSourceFactoryBaseoperator= (const ossimImageSourceFactoryBase &)
 
- Protected Member Functions inherited from ossimReferenced
virtual ~ossimReferenced ()
 

Protected Attributes

std::vector< ossimImageSourceFactoryBase * > theFactoryList
 

Static Protected Attributes

static ossimImageSourceFactoryRegistrytheInstance = NULL
 

Detailed Description

Definition at line 13 of file ossimImageSourceFactoryRegistry.h.

Constructor & Destructor Documentation

◆ ~ossimImageSourceFactoryRegistry()

ossimImageSourceFactoryRegistry::~ossimImageSourceFactoryRegistry ( )
virtual

Definition at line 24 of file ossimImageSourceFactoryRegistry.cpp.

References ossimImageSourceFactory::instance(), theInstance, and unregisterFactory().

25 {
27 
28  theInstance = NULL;
29 }
void unregisterFactory(ossimImageSourceFactoryBase *factory)
static ossimImageSourceFactory * instance()
static ossimImageSourceFactoryRegistry * theInstance

◆ ossimImageSourceFactoryRegistry() [1/2]

ossimImageSourceFactoryRegistry::ossimImageSourceFactoryRegistry ( )
protected

Definition at line 19 of file ossimImageSourceFactoryRegistry.cpp.

References theInstance.

Referenced by instance().

20 {
21  theInstance = this;
22 }
static ossimImageSourceFactoryRegistry * theInstance

◆ ossimImageSourceFactoryRegistry() [2/2]

ossimImageSourceFactoryRegistry::ossimImageSourceFactoryRegistry ( const ossimImageSourceFactoryRegistry )
protected

Member Function Documentation

◆ createObject() [1/2]

ossimObject * ossimImageSourceFactoryRegistry::createObject ( const ossimString typeName) const
virtual

Creates an object given a type name.

Implements ossimObjectFactory.

Definition at line 42 of file ossimImageSourceFactoryRegistry.cpp.

References theFactoryList.

43 {
44  ossimObject* result = NULL;
45  std::vector<ossimImageSourceFactoryBase*>::const_iterator factory;
46 
47  factory = theFactoryList.begin();
48  while((factory != theFactoryList.end()) && !result)
49  {
50  result = (*factory)->createObject(name);
51  ++factory;
52  }
53 
54  return result;
55 }
std::vector< ossimImageSourceFactoryBase * > theFactoryList

◆ createObject() [2/2]

ossimObject * ossimImageSourceFactoryRegistry::createObject ( const ossimKeywordlist kwl,
const char *  prefix = 0 
) const
virtual

Creates and object given a keyword list.

Implements ossimObjectFactory.

Definition at line 57 of file ossimImageSourceFactoryRegistry.cpp.

References theFactoryList.

59 {
60  ossimObject* result = NULL;
61  std::vector<ossimImageSourceFactoryBase*>::const_iterator factory;
62 
63  factory = theFactoryList.begin();
64  while((factory != theFactoryList.end()) && !result)
65  {
66  result = (*factory)->createObject(kwl, prefix);
67  ++factory;
68  }
69 
70  return result;
71 
72 }
std::vector< ossimImageSourceFactoryBase * > theFactoryList

◆ findFactory()

bool ossimImageSourceFactoryRegistry::findFactory ( ossimImageSourceFactoryBase factory) const

Definition at line 112 of file ossimImageSourceFactoryRegistry.cpp.

References theFactoryList.

Referenced by registerFactory().

113 {
114  return (std::find(theFactoryList.begin(),
115  theFactoryList.end(),
116  factory)!=theFactoryList.end());
117 }
std::vector< ossimImageSourceFactoryBase * > theFactoryList

◆ getTypeNameList()

void ossimImageSourceFactoryRegistry::getTypeNameList ( std::vector< ossimString > &  typeList) const
virtual

This should return the type name of all objects in all factories. This is the name used to construct the objects dynamially and this name must be unique.

Implements ossimObjectFactory.

Definition at line 74 of file ossimImageSourceFactoryRegistry.cpp.

References theFactoryList.

75 {
76  std::vector<ossimString> result;
77  std::vector<ossimImageSourceFactoryBase*>::const_iterator iter = theFactoryList.begin();
78 
79  while(iter != theFactoryList.end())
80  {
81  result.clear();
82  (*iter)->getTypeNameList(result);
83 
84  // now append to the end of the typeList.
85  typeList.insert(typeList.end(),
86  result.begin(),
87  result.end());
88  ++iter;
89  }
90 
91 }
std::vector< ossimImageSourceFactoryBase * > theFactoryList

◆ instance()

ossimImageSourceFactoryRegistry * ossimImageSourceFactoryRegistry::instance ( )
static

Definition at line 31 of file ossimImageSourceFactoryRegistry.cpp.

References ossimImageReconstructionFilterRegistry::instance(), ossimImageSourceFactory::instance(), ossimImageSourceFactoryRegistry(), registerFactory(), and theInstance.

Referenced by ossimImageUtil::createThumbnail(), ossimInit::initializeDefaultFactories(), ossimImageSourceFactoryRegistryGetInstance(), ossimSharedLibraryFinalize(), ossimSharedLibraryInitialize(), and ossimFftw3Factory::~ossimFftw3Factory().

◆ operator=()

void ossimImageSourceFactoryRegistry::operator= ( ossimImageSourceFactoryRegistry )
protected

Definition at line 130 of file ossimImageSourceFactoryRegistry.cpp.

131 {}

◆ registerFactory()

void ossimImageSourceFactoryRegistry::registerFactory ( ossimImageSourceFactoryBase factory)

Definition at line 93 of file ossimImageSourceFactoryRegistry.cpp.

References findFactory(), and theFactoryList.

Referenced by instance(), and ossimSharedLibraryInitialize().

94 {
95  if(factory&&!findFactory(factory))
96  {
97  theFactoryList.push_back(factory);
98  }
99 }
bool findFactory(ossimImageSourceFactoryBase *factory) const
std::vector< ossimImageSourceFactoryBase * > theFactoryList

◆ unregisterFactory()

void ossimImageSourceFactoryRegistry::unregisterFactory ( ossimImageSourceFactoryBase factory)

Definition at line 101 of file ossimImageSourceFactoryRegistry.cpp.

References theFactoryList.

Referenced by ossimSharedLibraryFinalize(), ossimFftw3Factory::~ossimFftw3Factory(), and ~ossimImageSourceFactoryRegistry().

102 {
103  std::vector<ossimImageSourceFactoryBase*>::iterator iter = std::find(theFactoryList.begin(),
104  theFactoryList.end(),
105  factory);
106  if(iter != theFactoryList.end())
107  {
108  theFactoryList.erase(iter);
109  }
110 }
std::vector< ossimImageSourceFactoryBase * > theFactoryList

Member Data Documentation

◆ theFactoryList

std::vector<ossimImageSourceFactoryBase*> ossimImageSourceFactoryRegistry::theFactoryList
protected

◆ theInstance

ossimImageSourceFactoryRegistry * ossimImageSourceFactoryRegistry::theInstance = NULL
staticprotected

The documentation for this class was generated from the following files: