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

Factory for Hdf image reader. More...

#include <ossimHdf5PluginHandlerFactory.h>

Inheritance diagram for ossimHdf5PluginHandlerFactory:
ossimImageHandlerFactoryBase ossimObjectFactory ossimObject ossimReferenced

Public Member Functions

virtual ~ossimHdf5PluginHandlerFactory ()
 virtual destructor More...
 
virtual ossimImageHandleropen (const ossimFilename &fileName, bool openOverview=true) const
 open that takes a file name. More...
 
virtual ossimImageHandleropen (const ossimKeywordlist &kwl, const char *prefix=0) const
 open that takes a keyword list and prefix. More...
 
virtual ossimObjectcreateObject (const ossimString &typeName) const
 createObject that takes a class name (ossimH5Reader) More...
 
virtual ossimObjectcreateObject (const ossimKeywordlist &kwl, const char *prefix=0) const
 Creates and object given a keyword list and prefix. More...
 
virtual void getTypeNameList (std::vector< ossimString > &typeList) const
 Adds ossimH5Reader to the typeList. More...
 
virtual void getSupportedExtensions (ossimImageHandlerFactoryBase::UniqueStringList &list) const
 Method to add supported extension to the list, like "hdf". More...
 
virtual void getSupportedRenderableNames (std::vector< ossimString > &names) const
 HDF5 defines different datasets depending on the sensor/format. More...
 
- Public Member Functions inherited from ossimImageHandlerFactoryBase
virtual ossimRefPtr< ossimImageHandleropen (std::shared_ptr< ossim::istream > &str, const std::string &connectionString, bool openOverview=true) const
 Open method that takes a stream. More...
 
virtual ossimRefPtr< ossimImageHandleropen (std::shared_ptr< ossim::ImageHandlerState > state) const
 
virtual ossimRefPtr< ossimImageHandleropenOverview (const ossimFilename &file) const
 Open overview that takes a file name. More...
 
virtual ossimRefPtr< ossimImageHandleropenOverview (std::shared_ptr< ossim::istream > &str, const ossimString &connectionString) const
 Open method that takes a stream. More...
 
virtual void getImageHandlersBySuffix (ImageHandlerList &result, const ossimString &ext) const
 
virtual void getImageHandlersByMimeType (ImageHandlerList &result, const ossimString &mimeType) 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 ossimHdf5PluginHandlerFactoryinstance ()
 static method to return instance (the only one) of this class. More...
 

Protected Member Functions

 ossimHdf5PluginHandlerFactory ()
 hidden from use default constructor More...
 
 ossimHdf5PluginHandlerFactory (const ossimHdf5PluginHandlerFactory &)
 hidden from use copy constructor More...
 
void operator= (const ossimHdf5PluginHandlerFactory &)
 hidden from use copy constructor More...
 
- Protected Member Functions inherited from ossimReferenced
virtual ~ossimReferenced ()
 

Static Protected Attributes

static ossimHdf5PluginHandlerFactorytheInstance = 0
 static instance of this class More...
 

Additional Inherited Members

- Public Types inherited from ossimImageHandlerFactoryBase
typedef UniqueList< ossimStringUniqueStringList
 
typedef std::vector< ossimRefPtr< ossimImageHandler > > ImageHandlerList
 

Detailed Description

Factory for Hdf image reader.

Definition at line 23 of file ossimHdf5PluginHandlerFactory.h.

Constructor & Destructor Documentation

◆ ~ossimHdf5PluginHandlerFactory()

ossimHdf5PluginHandlerFactory::~ossimHdf5PluginHandlerFactory ( )
virtual

virtual destructor

Definition at line 26 of file ossimHdf5PluginHandlerFactory.cpp.

References theInstance.

27 {
28  theInstance = 0;
29 }
static ossimHdf5PluginHandlerFactory * theInstance
static instance of this class

◆ ossimHdf5PluginHandlerFactory() [1/2]

ossimHdf5PluginHandlerFactory::ossimHdf5PluginHandlerFactory ( )
protected

hidden from use default constructor

Definition at line 138 of file ossimHdf5PluginHandlerFactory.cpp.

Referenced by instance().

138 {}

◆ ossimHdf5PluginHandlerFactory() [2/2]

ossimHdf5PluginHandlerFactory::ossimHdf5PluginHandlerFactory ( const ossimHdf5PluginHandlerFactory )
protected

hidden from use copy constructor

Definition at line 140 of file ossimHdf5PluginHandlerFactory.cpp.

140 {}

Member Function Documentation

◆ createObject() [1/2]

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

createObject that takes a class name (ossimH5Reader)

Parameters
typeNameShould be "ossimH5Reader".
Returns
pointer to image writer on success, NULL on failure.

Implements ossimObjectFactory.

Definition at line 93 of file ossimHdf5PluginHandlerFactory.cpp.

References ossimRefPtr< T >::release().

94 {
95  ossimRefPtr<ossimObject> result = 0;
96  if(typeName == "ossimViirsHandler")
97  result = new ossimViirsHandler;
98 
99  // Add other sensors here:
100 
101  return result.release();
102 }
T * release()
Definition: ossimRefPtr.h:93
Concrete class for reading VIIRS data from HDF5 file.

◆ createObject() [2/2]

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

Creates and object given a keyword list and prefix.

Parameters
kwlThe keyword list.
prefixthe keyword list prefix.
Returns
pointer to image handler on success, NULL on failure.

Implements ossimObjectFactory.

Definition at line 104 of file ossimHdf5PluginHandlerFactory.cpp.

References open().

107 {
108  return this->open(kwl, prefix);
109 }
virtual ossimImageHandler * open(const ossimFilename &fileName, bool openOverview=true) const
open that takes a file name.

◆ getSupportedExtensions()

void ossimHdf5PluginHandlerFactory::getSupportedExtensions ( ossimImageHandlerFactoryBase::UniqueStringList list) const
virtual

Method to add supported extension to the list, like "hdf".

Parameters
extensionListThe list to add to.

Implements ossimImageHandlerFactoryBase.

Definition at line 118 of file ossimHdf5PluginHandlerFactory.cpp.

References ossimImageHandlerFactoryBase::UniqueList< T >::push_back().

Referenced by open().

120 {
121  extensionList.push_back(ossimString("h5"));
122  extensionList.push_back(ossimString("he5"));
123  extensionList.push_back(ossimString("hdf5"));
124 }

◆ getSupportedRenderableNames()

void ossimHdf5PluginHandlerFactory::getSupportedRenderableNames ( std::vector< ossimString > &  names) const
virtual

HDF5 defines different datasets depending on the sensor/format.

This static method provides all dataset names to the plugin intialization for populating a description.

Definition at line 126 of file ossimHdf5PluginHandlerFactory.cpp.

References ossimHdf5ImageHandler::getRenderableSetNames().

127 {
128  names.clear();
129 
130  // Fetch all sensors represented by this plugin. Start with VIIRS:
131  ossimViirsHandler viirs;
132  const vector<ossimString>& viirsRenderables = viirs.getRenderableSetNames();
133  names.insert(names.end(), viirsRenderables.begin(), viirsRenderables.end());
134 
135  // Add other sensors here:
136 }
const std::vector< ossimString > & getRenderableSetNames()
Concrete class for reading VIIRS data from HDF5 file.

◆ getTypeNameList()

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

Adds ossimH5Reader to the typeList.

Parameters
typeListList to add to.

Implements ossimObjectFactory.

Definition at line 111 of file ossimHdf5PluginHandlerFactory.cpp.

113 {
114  typeList.push_back(ossimString("ossimViirsHandler"));
115  // Add other sensors here:
116 }

◆ instance()

ossimHdf5PluginHandlerFactory * ossimHdf5PluginHandlerFactory::instance ( )
static

static method to return instance (the only one) of this class.

Returns
pointer to instance of this class.

Definition at line 31 of file ossimHdf5PluginHandlerFactory.cpp.

References ossimHdf5PluginHandlerFactory(), and theInstance.

Referenced by ossimSharedLibraryFinalize(), and ossimSharedLibraryInitialize().

32 {
33  if(!theInstance)
34  {
36  }
37  return theInstance;
38 }
static ossimHdf5PluginHandlerFactory * theInstance
static instance of this class
ossimHdf5PluginHandlerFactory()
hidden from use default constructor

◆ open() [1/2]

ossimImageHandler * ossimHdf5PluginHandlerFactory::open ( const ossimFilename fileName,
bool  openOverview = true 
) const
virtual

open that takes a file name.

Parameters
fileThe file to open.
openOverviewIf true image handler will attempt to open overview. default = true
Returns
pointer to image handler on success, NULL on failure.

Implements ossimImageHandlerFactoryBase.

Definition at line 40 of file ossimHdf5PluginHandlerFactory.cpp.

References ossimString::downcase(), ossimFilename::ext(), getSupportedExtensions(), ossimImageHandler::open(), ossimImageHandlerFactoryBase::openOverview(), ossimRefPtr< T >::release(), ossimImageHandler::setOpenOverviewFlag(), and ossimImageHandlerFactoryBase::UniqueList< T >::size().

Referenced by createObject().

42 {
44  getSupportedExtensions(extensionList);
45 
46  ossimString ext = fileName.ext().downcase();
47  bool ext_handled = false;
48  for (int i=0; (i<extensionList.size()) && !ext_handled ; ++i)
49  {
50  if (ext == extensionList[i])
51  ext_handled = true;
52  }
53  if (!ext_handled)
54  return NULL;
55 
56  // Now try each of the represented concrete types in this plugin:
58  while (1)
59  {
60  // VIIRS:
61  reader = new ossimViirsHandler;
63  if(reader->open(fileName))
64  break;
65 
66  // Add other sensors here:
67 
68  reader = 0;
69  break;
70  }
71 
72  return reader.release();
73 }
virtual bool open()=0
Pure virtual open.
void setOpenOverviewFlag(bool flag)
Sets theOpenOverviewFlag.
virtual ossimRefPtr< ossimImageHandler > openOverview(const ossimFilename &file) const
Open overview that takes a file name.
virtual void getSupportedExtensions(ossimImageHandlerFactoryBase::UniqueStringList &list) const
Method to add supported extension to the list, like "hdf".
T * release()
Definition: ossimRefPtr.h:93
static ossimString downcase(const ossimString &aString)
Definition: ossimString.cpp:48
ossimString ext() const
Concrete class for reading VIIRS data from HDF5 file.

◆ open() [2/2]

ossimImageHandler * ossimHdf5PluginHandlerFactory::open ( const ossimKeywordlist kwl,
const char *  prefix = 0 
) const
virtual

open that takes a keyword list and prefix.

Parameters
kwlThe keyword list.
prefixthe keyword list prefix.
Returns
pointer to image handler on success, NULL on failure.

Implements ossimImageHandlerFactoryBase.

Definition at line 75 of file ossimHdf5PluginHandlerFactory.cpp.

References ossimImageHandler::loadState(), and ossimRefPtr< T >::release().

77 {
79  while (1)
80  {
81  // VIIRS:
82  reader = new ossimViirsHandler;
83  if(reader->loadState(kwl, prefix))
84  break;
85 
86  // Add other sensors here:
87  reader = 0;
88  break;
89  }
90  return reader.release();
91 }
virtual bool loadState(const ossimKeywordlist &kwl, const char *prefix=0)
Method to the load (recreate) the state of an object from a keyword list.
T * release()
Definition: ossimRefPtr.h:93
Concrete class for reading VIIRS data from HDF5 file.

◆ operator=()

void ossimHdf5PluginHandlerFactory::operator= ( const ossimHdf5PluginHandlerFactory )
protected

hidden from use copy constructor

Definition at line 142 of file ossimHdf5PluginHandlerFactory.cpp.

142 {}

Member Data Documentation

◆ theInstance

ossimHdf5PluginHandlerFactory * ossimHdf5PluginHandlerFactory::theInstance = 0
staticprotected

static instance of this class

Definition at line 102 of file ossimHdf5PluginHandlerFactory.h.

Referenced by instance(), and ~ossimHdf5PluginHandlerFactory().


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