My Project  1.12.0
H5Group.h
1 // C++ informative line for the emacs editor: -*- C++ -*-
2 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
3  * Copyright by The HDF Group. *
4  * Copyright by the Board of Trustees of the University of Illinois. *
5  * All rights reserved. *
6  * *
7  * This file is part of HDF5. The full HDF5 copyright notice, including *
8  * terms governing use, modification, and redistribution, is contained in *
9  * the COPYING file, which can be found at the root of the source code *
10  * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. *
11  * If you do not have access to either file, you may request a copy from *
12  * help@hdfgroup.org. *
13  * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
14 
15 #ifndef __Group_H
16 #define __Group_H
17 
18 namespace H5 {
19 
23 // Inheritance: CommonFG/H5Object -> H5Location -> IdComponent
24 class H5_DLLCPP Group : public H5Object, public CommonFG {
25  public:
26  // Close this group.
27  virtual void close();
28 
30  virtual H5std_string fromClass () const { return("Group"); }
31 
32  // Throw group exception.
33  virtual void throwException(const H5std_string& func_name, const H5std_string& msg) const;
34 
35  // for CommonFG to get the file id.
36  virtual hid_t getLocId() const;
37 
38  // Creates a group by way of dereference.
39  Group(const H5Location& loc, const void* ref, H5R_type_t ref_type = H5R_OBJECT, const PropList& plist = PropList::DEFAULT);
40  // Removed in 1.10.1, because H5Location is baseclass
41 // Group(const Attribute& attr, const void* ref, H5R_type_t ref_type = H5R_OBJECT, const PropList& plist = PropList::DEFAULT);
42 
43  // Returns the number of objects in this group.
44  hsize_t getNumObjs() const;
45 
46  // Opens an object within a group or a file, i.e., root group.
47  hid_t getObjId(const char* name, const PropList& plist = PropList::DEFAULT) const;
48  hid_t getObjId(const H5std_string& name, const PropList& plist = PropList::DEFAULT) const;
49 
50  // Closes an object opened by getObjId().
51  void closeObjId(hid_t obj_id) const;
52 
53  // default constructor
54  Group();
55 
56  // Copy constructor: same as the original Group.
57  Group(const Group& original);
58 
59  // Gets the group id.
60  virtual hid_t getId() const;
61 
62  // Destructor
63  virtual ~Group();
64 
65  // Creates a copy of an existing group using its id.
66  Group(const hid_t group_id);
67 
68  protected:
69 #ifndef DOXYGEN_SHOULD_SKIP_THIS
70  // Sets the group id.
71  virtual void p_setId(const hid_t new_id);
72 #endif // DOXYGEN_SHOULD_SKIP_THIS
73 
74  private:
75  hid_t id; // HDF5 group id
76 
77 }; // end of Group
78 } // namespace H5
79 
80 #endif // __Group_H
H5::Exception
Exception provides wrappers of HDF5 error handling functions.
Definition: H5Exception.h:32
H5::Group::fromClass
virtual H5std_string fromClass() const
Returns this class name.
Definition: H5Group.h:30
H5::CommonFG
CommonFG is an abstract base class of H5Group.
Definition: H5CommonFG.h:30
H5::Group::~Group
virtual ~Group()
Properly terminates access to this group.
Definition: H5Group.cpp:278
H5::Group::getId
virtual hid_t getId() const
Get the id of this group.
Definition: H5Group.cpp:195
H5::IdComponent::incRefCount
void incRefCount() const
Increment reference counter for the id of this object.
Definition: H5IdComponent.cpp:53
H5::Group::close
virtual void close()
Closes this group.
Definition: H5Group.cpp:234
H5::Group::getObjId
hid_t getObjId(const char *name, const PropList &plist=PropList::DEFAULT) const
Opens an object via object header.
Definition: H5Group.cpp:158
H5::Group::throwException
virtual void throwException(const H5std_string &func_name, const H5std_string &msg) const
Throws H5::GroupIException.
Definition: H5Group.cpp:261
H5::Group
Class Group represents an HDF5 group.
Definition: H5Group.h:24
H5::Group::Group
Group()
Default constructor: creates a stub Group.
Definition: H5Group.cpp:53
H5::Group::getLocId
virtual hid_t getLocId() const
Definition: H5Group.cpp:94
H5::Exception::getDetailMsg
H5std_string getDetailMsg() const
Returns the detailed message set at the time the exception is thrown.
Definition: H5Exception.cpp:256
H5::PropList::DEFAULT
static const PropList & DEFAULT
Default property list.
Definition: H5PropList.h:28
H5::Group::getNumObjs
hsize_t getNumObjs() const
Returns the number of objects in this group.
Definition: H5Group.cpp:135
H5::PropList::getId
virtual hid_t getId() const
Get the id of this property list.
Definition: H5PropList.cpp:292
H5::H5Object
Class H5Object is a bridge between H5Location and DataSet, DataType, and Group.
Definition: H5Object.h:69
H5
Definition: H5AbstractDs.cpp:34
H5::GroupIException
Definition: H5Exception.h:102
H5::Group::closeObjId
void closeObjId(hid_t obj_id) const
Closes an object, which was opened with Group::getObjId.
Definition: H5Group.cpp:73
H5::H5Location
H5Location is an abstract base class, added in version 1.8.12.
Definition: H5Location.h:31
H5::PropList
Class PropList inherits from IdComponent and provides wrappers for the HDF5 generic property list.
Definition: H5PropList.h:25


The HDF Group Help Desk:
  Copyright by The HDF Group
and the Board of Trustees of the University of Illinois