OSSIM - Open Source Software Image Map  Version 1.9.0 (20180803)
Public Member Functions | Static Public Member Functions | List of all members
ossim::ImageHandlerStateFactory Class Reference

#include <ImageHandlerStateFactory.h>

Inheritance diagram for ossim::ImageHandlerStateFactory:
ossim::StateFactoryBase< std::shared_ptr< ossim::ImageHandlerState > >

Public Member Functions

 ImageHandlerStateFactory ()
 
virtual std::shared_ptr< ossim::ImageHandlerState > createState (const ossimKeywordlist &kwl, const ossimString &prefix="") const override
 
virtual std::shared_ptr< ossim::ImageHandlerState > createState (const ossimString &typeName) const override
 
- Public Member Functions inherited from ossim::StateFactoryBase< std::shared_ptr< ossim::ImageHandlerState > >
 StateFactoryBase ()
 

Static Public Member Functions

static std::shared_ptr< ossim::ImageHandlerStateFactoryinstance ()
 

Detailed Description

Definition at line 14 of file ImageHandlerStateFactory.h.

Constructor & Destructor Documentation

◆ ImageHandlerStateFactory()

ossim::ImageHandlerStateFactory::ImageHandlerStateFactory ( )

Definition at line 8 of file ImageHandlerStateFactory.cpp.

9 {
10 
11 }

Member Function Documentation

◆ createState() [1/2]

std::shared_ptr< ossim::ImageHandlerState > ossim::ImageHandlerStateFactory::createState ( const ossimKeywordlist kwl,
const ossimString prefix = "" 
) const
overridevirtual

Implements ossim::StateFactoryBase< std::shared_ptr< ossim::ImageHandlerState > >.

Definition at line 20 of file ImageHandlerStateFactory.cpp.

References ossimKeywordlist::find(), and ossimKeywordNames::TYPE_KW.

22 {
23  std::shared_ptr<ossim::ImageHandlerState> result;
24  ossimString typeValue = kwl.find(prefix, ossimKeywordNames::TYPE_KW);
25  if(typeValue)
26  {
27  result = createState(typeValue);
28  if(result)
29  {
30  try
31  {
32  result->load(kwl, prefix);
33  }
34  catch(ossimException& e)
35  {
36  result = nullptr;
37  }
38  }
39  }
40 
41  return result;
42 }
const char * find(const char *key) const
static const char * TYPE_KW
virtual std::shared_ptr< ossim::ImageHandlerState > createState(const ossimKeywordlist &kwl, const ossimString &prefix="") const override

◆ createState() [2/2]

std::shared_ptr< ossim::ImageHandlerState > ossim::ImageHandlerStateFactory::createState ( const ossimString typeName) const
overridevirtual

Implements ossim::StateFactoryBase< std::shared_ptr< ossim::ImageHandlerState > >.

Definition at line 44 of file ImageHandlerStateFactory.cpp.

45 {
46  std::shared_ptr<ossim::ImageHandlerState> result;
47 
48  if(typeName == ossim::TiffHandlerState::getStaticTypeName())
49  {
50  result = std::make_shared<ossim::TiffHandlerState>();
51  }
52 
53  return result;
54 }

◆ instance()

std::shared_ptr< ossim::ImageHandlerStateFactory > ossim::ImageHandlerStateFactory::instance ( )
static

Definition at line 13 of file ImageHandlerStateFactory.cpp.

Referenced by ossimInit::initializeDefaultFactories().

14 {
15  static std::shared_ptr<ImageHandlerStateFactory>
16  imageHandlerFactory = std::make_shared< ossim::ImageHandlerStateFactory >();
17  return imageHandlerFactory;
18 }

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