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

#include <ossimDatumFactoryRegistry.h>

Inheritance diagram for ossimDatumFactoryRegistry:
ossimDatumFactoryInterface

Public Member Functions

 ~ossimDatumFactoryRegistry ()
 destructor More...
 
void registerFactory (ossimDatumFactoryInterface *factory)
 Method to add factory to registry. More...
 
virtual const ossimDatumcreate (const ossimString &code) const
 create method More...
 
virtual const ossimDatumcreate (const ossimKeywordlist &kwl, const char *prefix=0) const
 
virtual void getList (std::vector< ossimString > &list) const
 getList method to return a combined list of all datums from registered datum factories. More...
 
- Public Member Functions inherited from ossimDatumFactoryInterface
 ossimDatumFactoryInterface ()
 default constructor More...
 
virtual ~ossimDatumFactoryInterface ()
 virtual destructor More...
 

Static Public Member Functions

static ossimDatumFactoryRegistryinstance ()
 instance method More...
 

Protected Member Functions

 ossimDatumFactoryRegistry ()
 hidden from use default constructor More...
 

Protected Attributes

std::mutex theFactoryListMutex
 Single static instance of this class. More...
 
std::vector< ossimDatumFactoryInterface * > theFactoryList
 

Detailed Description

Definition at line 24 of file ossimDatumFactoryRegistry.h.

Constructor & Destructor Documentation

◆ ~ossimDatumFactoryRegistry()

ossimDatumFactoryRegistry::~ossimDatumFactoryRegistry ( )

destructor

Definition at line 20 of file ossimDatumFactoryRegistry.cpp.

21 {
22 }

◆ ossimDatumFactoryRegistry()

ossimDatumFactoryRegistry::ossimDatumFactoryRegistry ( )
protected

hidden from use default constructor

Definition at line 93 of file ossimDatumFactoryRegistry.cpp.

References ossimEpsgDatumFactory::instance(), ossimDatumFactory::instance(), and registerFactory().

94  : theFactoryList()
95 {
98 }
void registerFactory(ossimDatumFactoryInterface *factory)
Method to add factory to registry.
std::vector< ossimDatumFactoryInterface * > theFactoryList
static ossimDatumFactory * instance()
static ossimEpsgDatumFactory * instance()
Singleton implementation.

Member Function Documentation

◆ create() [1/2]

const ossimDatum * ossimDatumFactoryRegistry::create ( const ossimString code) const
virtual

create method

Implements pure virtual ossimDatumFactoryInterface::create.

Returns
const pointer to a datum.

Implements ossimDatumFactoryInterface.

Definition at line 45 of file ossimDatumFactoryRegistry.cpp.

References theFactoryList.

Referenced by ossimFgdcXmlDoc::createOssimDatum(), ossimEpsgProjectionDatabase::findProjection(), ossimMapProjection::loadState(), operator>>(), ossimStatePlaneProjectionInfo::ossimStatePlaneProjectionInfo(), and ossimInfo::printDatums().

47 {
48  const ossimDatum* result = 0;
49 
50  std::vector<ossimDatumFactoryInterface*>::const_iterator i =
51  theFactoryList.begin();
52 
53  while (i != theFactoryList.end())
54  {
55  result = (*i)->create(code);
56  if (result)
57  {
58  break;
59  }
60  ++i; // go to next factory
61  }
62  return result;
63 }
std::vector< ossimDatumFactoryInterface * > theFactoryList

◆ create() [2/2]

const ossimDatum * ossimDatumFactoryRegistry::create ( const ossimKeywordlist kwl,
const char *  prefix = 0 
) const
virtual

Implements ossimDatumFactoryInterface.

Definition at line 65 of file ossimDatumFactoryRegistry.cpp.

References theFactoryList.

67 {
68  const ossimDatum* result = 0;
69  std::vector<ossimDatumFactoryInterface*>::const_iterator i = theFactoryList.begin();
70 
71  while (i != theFactoryList.end())
72  {
73  result = (*i)->create(kwl, prefix);
74  if (result)
75  return result;
76 
77  ++i; // go to next factory
78  }
79  return result;
80 }
std::vector< ossimDatumFactoryInterface * > theFactoryList

◆ getList()

void ossimDatumFactoryRegistry::getList ( std::vector< ossimString > &  list) const
virtual

getList method to return a combined list of all datums from registered datum factories.

Parameters
listThe list to add to.

Implements ossimDatumFactoryInterface.

Definition at line 82 of file ossimDatumFactoryRegistry.cpp.

References theFactoryList.

Referenced by ossimInfo::printDatums().

83 {
84  std::vector<ossimDatumFactoryInterface*>::const_iterator i =
85  theFactoryList.begin();
86  while (i != theFactoryList.end())
87  {
88  (*i)->getList(list);
89  ++i;
90  }
91 }
std::vector< ossimDatumFactoryInterface * > theFactoryList

◆ instance()

ossimDatumFactoryRegistry * ossimDatumFactoryRegistry::instance ( )
static

instance method

Returns
Point to the instance of the registry.

Definition at line 24 of file ossimDatumFactoryRegistry.cpp.

Referenced by ossimFgdcXmlDoc::createOssimDatum(), ossimEpsgProjectionDatabase::findProjection(), ossimInit::initializeDefaultFactories(), ossimMapProjection::loadState(), operator>>(), ossimStatePlaneProjectionInfo::ossimStatePlaneProjectionInfo(), and ossimInfo::printDatums().

25 {
26  static ossimDatumFactoryRegistry inst;
27 
28  return &inst;
29  //if (!theInstance)
30  //{
31  // theInstance = new ossimDatumFactoryRegistry;
32  // }
33  // return theInstance;
34 }

◆ registerFactory()

void ossimDatumFactoryRegistry::registerFactory ( ossimDatumFactoryInterface factory)

Method to add factory to registry.

Parameters
factoryFactory to register.

Definition at line 36 of file ossimDatumFactoryRegistry.cpp.

References theFactoryList.

Referenced by ossimDatumFactoryRegistry().

38 {
39  if (factory)
40  {
41  theFactoryList.push_back(factory);
42  }
43 }
std::vector< ossimDatumFactoryInterface * > theFactoryList

Member Data Documentation

◆ theFactoryList

std::vector<ossimDatumFactoryInterface*> ossimDatumFactoryRegistry::theFactoryList
protected

Definition at line 71 of file ossimDatumFactoryRegistry.h.

Referenced by create(), getList(), and registerFactory().

◆ theFactoryListMutex

std::mutex ossimDatumFactoryRegistry::theFactoryListMutex
mutableprotected

Single static instance of this class.

Definition at line 70 of file ossimDatumFactoryRegistry.h.


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