CMS 3D CMS Logo

h5_File.h
Go to the documentation of this file.
1 #ifndef CondCore_CondHDF5ESSource_h5_File_h
2 #define CondCore_CondHDF5ESSource_h5_File_h
3 // -*- C++ -*-
4 //
5 // Package: CondCore/CondHDF5ESSource
6 // Class : File
7 //
16 //
17 // Original Author: Christopher Jones
18 // Created: Fri, 30 Jun 2023 14:36:39 GMT
19 //
20 
21 // system include files
22 #include <string>
23 #include <memory>
24 
25 #include "hdf5.h"
26 
27 // user include files
28 
29 // forward declarations
30 
31 namespace cms::h5 {
32  class Group;
33  class DataSet;
34  class Attribute;
35 
36  class File {
37  public:
38  enum CtrOption { kReadOnly };
39 
40  File(std::string const& iName, CtrOption);
41  ~File();
42 
43  File(const File&) = delete; // stop default
44  File& operator=(const File&) = delete; // stop default
45  File(File&&) = delete; // stop default
46  File& operator=(File&&) = delete; // stop default
47 
48  // ---------- const member functions ---------------------
49  std::shared_ptr<Group> findGroup(std::string const& iName) const;
50  std::shared_ptr<DataSet> findDataSet(std::string const& iName) const;
51  std::shared_ptr<Attribute> findAttribute(std::string const& iName) const;
52 
53  std::shared_ptr<Group> derefGroup(hobj_ref_t iRef) const;
54  std::shared_ptr<DataSet> derefDataSet(hobj_ref_t iRef) const;
55 
56  // ---------- static member functions --------------------
57 
58  // ---------- member functions ---------------------------
59 
60  private:
61  // ---------- member data --------------------------------
62  hid_t id_;
63  };
64 } // namespace cms::h5
65 
66 #endif
File & operator=(const File &)=delete
std::shared_ptr< Group > derefGroup(hobj_ref_t iRef) const
Definition: h5_File.cc:75
std::shared_ptr< Group > findGroup(std::string const &iName) const
Definition: h5_File.cc:66
std::shared_ptr< Attribute > findAttribute(std::string const &iName) const
Definition: h5_File.cc:71
std::shared_ptr< DataSet > findDataSet(std::string const &iName) const
Definition: h5_File.cc:67
hid_t id_
Definition: h5_File.h:62
File(std::string const &iName, CtrOption)
Definition: h5_File.cc:34
std::shared_ptr< DataSet > derefDataSet(hobj_ref_t iRef) const
Definition: h5_File.cc:77