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

TIFF info class. More...

#include <ossimH5Info.h>

Inheritance diagram for ossimH5Info:
ossimInfoBase ossimReferenced

Public Member Functions

 ossimH5Info ()
 default constructor More...
 
virtual ~ossimH5Info ()
 virtual destructor More...
 
virtual bool open (const ossimFilename &file)
 open method. More...
 
virtual std::ostream & print (std::ostream &out) const
 Print method. More...
 
- Public Member Functions inherited from ossimInfoBase
 ossimInfoBase ()
 default constructor More...
 
virtual bool open (std::shared_ptr< ossim::istream > &str, const std::string &connectionString)
 open method. More...
 
void setProcessOverviewFlag (bool flag)
 Sets the overview flag. More...
 
bool getProcessOverviewFlag () const
 Method to get the overview flag. More...
 
virtual bool getKeywordlist (ossimKeywordlist &kwl) const
 Method to dump info to a keyword list. More...
 
virtual bool getKeywordlist (ossimKeywordlist &kwl, ossim_uint32 entryIndex) const
 Method to dump info to a keyword list. More...
 
- 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
 

Private Attributes

ossimFilename m_file
 

Additional Inherited Members

- Protected Member Functions inherited from ossimInfoBase
virtual ~ossimInfoBase ()
 virtual destructor More...
 
- Protected Member Functions inherited from ossimReferenced
virtual ~ossimReferenced ()
 
- Protected Attributes inherited from ossimInfoBase
bool theOverviewFlag
 

Detailed Description

TIFF info class.

Encapsulates the listgeo functionality.

Definition at line 29 of file ossimH5Info.h.

Constructor & Destructor Documentation

◆ ossimH5Info()

ossimH5Info::ossimH5Info ( )

default constructor

Definition at line 36 of file ossimH5Info.cpp.

37  : ossimInfoBase(),
38  m_file()
39 {
40 }
ossimFilename m_file
Definition: ossimH5Info.h:59
ossimInfoBase()
default constructor

◆ ~ossimH5Info()

ossimH5Info::~ossimH5Info ( )
virtual

virtual destructor

Definition at line 42 of file ossimH5Info.cpp.

43 {
44 }

Member Function Documentation

◆ open()

bool ossimH5Info::open ( const ossimFilename file)
virtual

open method.

Parameters
fileFile name to open.
Returns
true on success false on error.

Reimplemented from ossimInfoBase.

Definition at line 46 of file ossimH5Info.cpp.

References m_file, ossimString::size(), and ossimString::string().

47 {
48  bool result = false;
49 
50  // Check for empty filename.
51  if (file.size())
52  {
53  try
54  {
55  //--
56  // Turn off the auto-printing when failure occurs so that we can
57  // handle the errors appropriately
58  //---
59  H5::Exception::dontPrint();
60 
61  if ( H5::H5File::isHdf5( file.string() ) )
62  {
63  m_file = file;
64  result = true;
65  }
66  }
67  catch( const H5::Exception& e )
68  {
69  e.getDetailMsg();
70  }
71  catch( ... )
72  {
73  if ( traceDebug() )
74  {
76  << "ossimH5Info::open WARNING Caught unhandled exception for file:\n"
77  << file.c_str() << std::endl;
78  }
79  }
80  }
81 
82  return result;
83 }
std::string::size_type size() const
Definition: ossimString.h:405
ossimFilename m_file
Definition: ossimH5Info.h:59
const char * c_str() const
Returns a pointer to a null-terminated array of characters representing the string&#39;s contents...
Definition: ossimString.h:396
OSSIMDLLEXPORT std::ostream & ossimNotify(ossimNotifyLevel level=ossimNotifyLevel_WARN)
const std::string & string() const
Definition: ossimString.h:414

◆ print()

std::ostream & ossimH5Info::print ( std::ostream &  out) const
virtual

Print method.

Parameters
outStream to print to.
Returns
std::ostream&

Implements ossimInfoBase.

Definition at line 85 of file ossimH5Info.cpp.

86 {
87  static const char MODULE[] = "ossimH5Info::open";
88 
89  if ( traceDebug() )
90  {
92  << MODULE << " entered..."
93  << "File: " << m_file.c_str()
94  << std::endl;
95  }
96 
97  // Check for empty filename.
98  if (m_file.size())
99  {
100  try
101  {
102  //--
103  // Turn off the auto-printing when failure occurs so that we can
104  // handle the errors appropriately
105  //---
106  H5::Exception::dontPrint();
107 
108  H5::H5File* h5File = new H5::H5File();
109 
110  H5::FileAccPropList access_plist = H5::FileAccPropList::DEFAULT;
111 
112  h5File->openFile( m_file.string(), H5F_ACC_RDONLY, access_plist );
113 
114  // std::vector<std::string> names;
115  // ossim_hdf5::getDatasetNames( h5File, names );
116  ossim_hdf5::print( h5File, out );
117 
118  // cleanup...
119  h5File->close();
120  delete h5File;
121  h5File = 0;
122 
123  } // End: try block
124  catch( const H5::Exception& e )
125  {
126  e.getDetailMsg();
127  }
128  catch( ... )
129  {
130  if ( traceDebug() )
131  {
133  << "ossimH5Info::print WARNIN: Caught unhandled exception!"
134  << std::endl;
135  }
136  }
137  }
138 
139  return out;
140 }
std::ostream & print(H5::H5File *file, std::ostream &out)
Print method.
Definition: ossimH5Util.cpp:41
std::string::size_type size() const
Definition: ossimString.h:405
ossimFilename m_file
Definition: ossimH5Info.h:59
const char * c_str() const
Returns a pointer to a null-terminated array of characters representing the string&#39;s contents...
Definition: ossimString.h:396
OSSIMDLLEXPORT std::ostream & ossimNotify(ossimNotifyLevel level=ossimNotifyLevel_WARN)
const std::string & string() const
Definition: ossimString.h:414

Member Data Documentation

◆ m_file

ossimFilename ossimH5Info::m_file
private

Definition at line 59 of file ossimH5Info.h.

Referenced by open().


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