H5Group.h 3.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  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://www.hdfgroup.org/licenses. *
  11. * If you do not have access to either file, you may request a copy from *
  12. * help@hdfgroup.org. *
  13. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
  14. #ifndef H5Group_H
  15. #define H5Group_H
  16. namespace H5 {
  17. /*! \class Group
  18. \brief Class Group represents an HDF5 group.
  19. */
  20. // Inheritance: CommonFG/H5Object -> H5Location -> IdComponent
  21. class H5_DLLCPP Group : public H5Object, public CommonFG {
  22. public:
  23. // Close this group.
  24. virtual void close() override;
  25. ///\brief Returns this class name.
  26. virtual H5std_string
  27. fromClass() const override
  28. {
  29. return ("Group");
  30. }
  31. // Throw group exception.
  32. virtual void throwException(const H5std_string &func_name, const H5std_string &msg) const override;
  33. // for CommonFG to get the file id.
  34. virtual hid_t getLocId() const override;
  35. // Creates a group by way of dereference.
  36. Group(const H5Location &loc, const void *ref, H5R_type_t ref_type = H5R_OBJECT,
  37. const PropList &plist = PropList::DEFAULT);
  38. // Removed in 1.10.1, because H5Location is baseclass
  39. // Group(const Attribute& attr, const void* ref, H5R_type_t ref_type = H5R_OBJECT, const PropList&
  40. // plist = PropList::DEFAULT);
  41. // Returns the number of objects in this group.
  42. hsize_t getNumObjs() const;
  43. // Opens an object within a group or a file, i.e., root group.
  44. hid_t getObjId(const char *name, const PropList &plist = PropList::DEFAULT) const;
  45. hid_t getObjId(const H5std_string &name, const PropList &plist = PropList::DEFAULT) const;
  46. // Closes an object opened by getObjId().
  47. void closeObjId(hid_t obj_id) const;
  48. // default constructor
  49. Group();
  50. // Copy constructor: same as the original Group.
  51. Group(const Group &original);
  52. // Gets the group id.
  53. virtual hid_t getId() const override;
  54. // Destructor
  55. virtual ~Group() override;
  56. // Creates a copy of an existing group using its id.
  57. Group(const hid_t group_id);
  58. protected:
  59. #ifndef DOXYGEN_SHOULD_SKIP_THIS
  60. // Sets the group id.
  61. virtual void p_setId(const hid_t new_id) override;
  62. #endif // DOXYGEN_SHOULD_SKIP_THIS
  63. private:
  64. hid_t id; // HDF5 group id
  65. }; // end of Group
  66. } // namespace H5
  67. #endif // H5Group_H