CMS 3D CMS Logo

List of all members | Public Types | Public Member Functions | Private Attributes
cms::h5::File Class Reference

#include <h5_File.h>

Public Types

enum  CtrOption { kReadOnly }
 

Public Member Functions

std::shared_ptr< DataSetderefDataSet (hobj_ref_t iRef) const
 
std::shared_ptr< GroupderefGroup (hobj_ref_t iRef) const
 
 File (std::string const &iName, CtrOption)
 
 File (const File &)=delete
 
 File (File &&)=delete
 
std::shared_ptr< AttributefindAttribute (std::string const &iName) const
 
std::shared_ptr< DataSetfindDataSet (std::string const &iName) const
 
std::shared_ptr< GroupfindGroup (std::string const &iName) const
 
Fileoperator= (const File &)=delete
 
Fileoperator= (File &&)=delete
 
 ~File ()
 

Private Attributes

hid_t id_
 

Detailed Description

Definition at line 36 of file h5_File.h.

Member Enumeration Documentation

◆ CtrOption

Enumerator
kReadOnly 

Definition at line 38 of file h5_File.h.

Constructor & Destructor Documentation

◆ File() [1/3]

File::File ( std::string const &  iName,
CtrOption   
)

Definition at line 34 of file h5_File.cc.

References Exception, and id_.

34  : id_(H5Fopen(iName.c_str(), H5F_ACC_RDONLY, H5P_DEFAULT)) {
35  if (id_ < 0) {
36  throw cms::Exception("FailedHDF5FileOpen") << "failed to open HDF5 file " << iName;
37  }
38  }
hid_t id_
Definition: h5_File.h:62

◆ ~File()

File::~File ( )

Definition at line 45 of file h5_File.cc.

References id_.

45 { H5Fclose(id_); }
hid_t id_
Definition: h5_File.h:62

◆ File() [2/3]

cms::h5::File::File ( const File )
delete

◆ File() [3/3]

cms::h5::File::File ( File &&  )
delete

Member Function Documentation

◆ derefDataSet()

std::shared_ptr< DataSet > File::derefDataSet ( hobj_ref_t  iRef) const

Definition at line 77 of file h5_File.cc.

References id_.

Referenced by HDF5ProductResolver::readFromHDF5api().

77 { return std::make_shared<DataSet>(id_, &iRef); }
hid_t id_
Definition: h5_File.h:62

◆ derefGroup()

std::shared_ptr< Group > File::derefGroup ( hobj_ref_t  iRef) const

Definition at line 75 of file h5_File.cc.

References id_.

Referenced by CondHDF5ESSource::CondHDF5ESSource().

75 { return std::make_shared<Group>(id_, &iRef); }
hid_t id_
Definition: h5_File.h:62

◆ findAttribute()

std::shared_ptr< Attribute > File::findAttribute ( std::string const &  iName) const

Definition at line 71 of file h5_File.cc.

References id_.

71  {
72  return std::make_shared<Attribute>(id_, iName);
73  }
hid_t id_
Definition: h5_File.h:62

◆ findDataSet()

std::shared_ptr< DataSet > File::findDataSet ( std::string const &  iName) const

Definition at line 67 of file h5_File.cc.

References id_.

67  {
68  return std::make_shared<DataSet>(id_, iName);
69  }
hid_t id_
Definition: h5_File.h:62

◆ findGroup()

std::shared_ptr< Group > File::findGroup ( std::string const &  iName) const

Definition at line 66 of file h5_File.cc.

References id_.

Referenced by CondHDF5ESSource::CondHDF5ESSource().

66 { return std::make_shared<Group>(id_, iName); }
hid_t id_
Definition: h5_File.h:62

◆ operator=() [1/2]

File& cms::h5::File::operator= ( const File )
delete

◆ operator=() [2/2]

File& cms::h5::File::operator= ( File &&  )
delete

Member Data Documentation

◆ id_

hid_t cms::h5::File::id_
private

Definition at line 62 of file h5_File.h.

Referenced by derefDataSet(), derefGroup(), File(), findAttribute(), findDataSet(), findGroup(), and ~File().