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
ossimH5ReaderFactory Class Reference

Factory for Hdf image reader. More...

#include <ossimH5ReaderFactory.h>

Inheritance diagram for ossimH5ReaderFactory:
ossimImageHandlerFactoryBase ossimObjectFactory ossimObject ossimReferenced

Public Member Functions

virtual ~ossimH5ReaderFactory ()
 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 &extensionList) const
 Method to add supported extension to the list, like "hdf". 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 ossimH5ReaderFactoryinstance ()
 static method to return instance (the only one) of this class. More...
 

Protected Member Functions

bool hasExcludedExtension (const ossimFilename &file) const
 Method to weed out extensions that this plugin knows it does not support. More...
 
 ossimH5ReaderFactory ()
 hidden from use default constructor More...
 
 ossimH5ReaderFactory (const ossimH5ReaderFactory &)
 hidden from use copy constructor More...
 
void operator= (const ossimH5ReaderFactory &)
 hidden from use copy constructor More...
 
- Protected Member Functions inherited from ossimReferenced
virtual ~ossimReferenced ()
 

Static Protected Attributes

static ossimH5ReaderFactorytheInstance = 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 ossimH5ReaderFactory.h.

Constructor & Destructor Documentation

◆ ~ossimH5ReaderFactory()

ossimH5ReaderFactory::~ossimH5ReaderFactory ( )
virtual

virtual destructor

Definition at line 31 of file ossimH5ReaderFactory.cpp.

References theInstance.

32 {
33  theInstance = 0;
34 }
static ossimH5ReaderFactory * theInstance
static instance of this class

◆ ossimH5ReaderFactory() [1/2]

ossimH5ReaderFactory::ossimH5ReaderFactory ( )
protected

hidden from use default constructor

Definition at line 155 of file ossimH5ReaderFactory.cpp.

Referenced by instance().

155 {}

◆ ossimH5ReaderFactory() [2/2]

ossimH5ReaderFactory::ossimH5ReaderFactory ( const ossimH5ReaderFactory )
protected

hidden from use copy constructor

Definition at line 157 of file ossimH5ReaderFactory.cpp.

157 {}

Member Function Documentation

◆ createObject() [1/2]

ossimObject * ossimH5ReaderFactory::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 109 of file ossimH5ReaderFactory.cpp.

References ossimRefPtr< T >::release().

111 {
112  ossimRefPtr<ossimObject> result = 0;
113  if(typeName == "ossimH5Reader")
114  {
115  result = new ossimHdf5ImageHandler;
116  }
117 
118  return result.release();
119 }
This is the base class for all imagery using HDF5 as the file format.
T * release()
Definition: ossimRefPtr.h:93

◆ createObject() [2/2]

ossimObject * ossimH5ReaderFactory::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 121 of file ossimH5ReaderFactory.cpp.

References open().

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

◆ getSupportedExtensions()

void ossimH5ReaderFactory::getSupportedExtensions ( ossimImageHandlerFactoryBase::UniqueStringList extensionList) const
virtual

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

Parameters
extensionListThe list to add to.

Implements ossimImageHandlerFactoryBase.

Definition at line 134 of file ossimH5ReaderFactory.cpp.

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

136 {
137  extensionList.push_back(ossimString("h5"));
138  extensionList.push_back(ossimString("he5"));
139  extensionList.push_back(ossimString("hdf5"));
140 }

◆ getTypeNameList()

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

Adds ossimH5Reader to the typeList.

Parameters
typeListList to add to.

Implements ossimObjectFactory.

Definition at line 128 of file ossimH5ReaderFactory.cpp.

130 {
131  typeList.push_back(ossimString("ossimH5Reader"));
132 }

◆ hasExcludedExtension()

bool ossimH5ReaderFactory::hasExcludedExtension ( const ossimFilename file) const
protected

Method to weed out extensions that this plugin knows it does not support.

This is to avoid a costly open on say a tiff or jpeg that is not handled by this plugin.

Returns
true if extension, false if not.

Definition at line 142 of file ossimH5ReaderFactory.cpp.

References ossimString::downcase(), and ossimFilename::ext().

144 {
145  bool result = true;
146  ossimString ext = file.ext().downcase();
147  //only include the file with those extension and exclude any other files
148  if ( (ext == "h5") || (ext == "hdf5") || (ext == "he5") )
149  {
150  result = false;
151  }
152  return result;
153 }
static ossimString downcase(const ossimString &aString)
Definition: ossimString.cpp:48
ossimString ext() const

◆ instance()

ossimH5ReaderFactory * ossimH5ReaderFactory::instance ( )
static

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

Returns
pointer to instance of this class.

Definition at line 36 of file ossimH5ReaderFactory.cpp.

References ossimH5ReaderFactory(), and theInstance.

Referenced by ossimSharedLibraryFinalize(), and ossimSharedLibraryInitialize().

37 {
38  if(!theInstance)
39  {
41  }
42  return theInstance;
43 }
ossimH5ReaderFactory()
hidden from use default constructor
static ossimH5ReaderFactory * theInstance
static instance of this class

◆ open() [1/2]

ossimImageHandler * ossimH5ReaderFactory::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 45 of file ossimH5ReaderFactory.cpp.

Referenced by createObject().

47 {
48  if(traceDebug())
49  {
51  << "ossimH5ReaderFactory::open(filename) DEBUG: entered..."
52  << "\ntrying ossimH5Reader"
53  << std::endl;
54  }
55 
57 
58  if ( hasExcludedExtension(fileName) == false )
59  {
60  if (reader == 0) //try hdf5 reader
61  {
62  // cout << "Calling ossimH5Reader ***********************" << endl;
63  reader = new ossimHdf5ImageHandler;
65  if(reader->open(fileName) == false)
66  {
67  reader = 0;
68  }
69  }
70  }
71 
72  if(traceDebug())
73  {
75  << "ossimH5ReaderFactory::open(filename) DEBUG: leaving..."
76  << std::endl;
77  }
78 
79  return reader.release();
80 }
virtual bool open()=0
Pure virtual open.
void setOpenOverviewFlag(bool flag)
Sets theOpenOverviewFlag.
This is the base class for all imagery using HDF5 as the file format.
virtual ossimRefPtr< ossimImageHandler > openOverview(const ossimFilename &file) const
Open overview that takes a file name.
bool hasExcludedExtension(const ossimFilename &file) const
Method to weed out extensions that this plugin knows it does not support.
T * release()
Definition: ossimRefPtr.h:93
OSSIMDLLEXPORT std::ostream & ossimNotify(ossimNotifyLevel level=ossimNotifyLevel_WARN)

◆ open() [2/2]

ossimImageHandler * ossimH5ReaderFactory::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 82 of file ossimH5ReaderFactory.cpp.

84 {
85  if(traceDebug())
86  {
88  << "ossimH5ReaderFactory::open(kwl, prefix) DEBUG: entered..."
89  << "Trying ossimKakaduNitfReader"
90  << std::endl;
91  }
92 
94  if(reader->loadState(kwl, prefix) == false)
95  {
96  reader = 0;
97  }
98 
99  if(traceDebug())
100  {
102  << "ossimH5ReaderFactory::open(kwl, prefix) DEBUG: leaving..."
103  << std::endl;
104  }
105 
106  return reader.release();
107 }
virtual bool loadState(const ossimKeywordlist &kwl, const char *prefix=0)
Method to the load (recreate) the state of an object from a keyword list.
This is the base class for all imagery using HDF5 as the file format.
T * release()
Definition: ossimRefPtr.h:93
OSSIMDLLEXPORT std::ostream & ossimNotify(ossimNotifyLevel level=ossimNotifyLevel_WARN)

◆ operator=()

void ossimH5ReaderFactory::operator= ( const ossimH5ReaderFactory )
protected

hidden from use copy constructor

Definition at line 159 of file ossimH5ReaderFactory.cpp.

159 {}

Member Data Documentation

◆ theInstance

ossimH5ReaderFactory * ossimH5ReaderFactory::theInstance = 0
staticprotected

static instance of this class

Definition at line 106 of file ossimH5ReaderFactory.h.

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


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