H5CommonFG.h 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  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 H5CommonFG_H
  15. #define H5CommonFG_H
  16. namespace H5 {
  17. // Class forwarding
  18. class Group;
  19. class H5File;
  20. class ArrayType;
  21. class VarLenType;
  22. /*! \class CommonFG
  23. \brief \a CommonFG is an abstract base class of H5Group.
  24. */
  25. /* Note: This class is being deprecated gradually. */
  26. class H5_DLLCPP CommonFG {
  27. public:
  28. // Opens a generic named datatype in this location.
  29. DataType openDataType(const char *name) const;
  30. DataType openDataType(const H5std_string &name) const;
  31. // Opens a named array datatype in this location.
  32. ArrayType openArrayType(const char *name) const;
  33. ArrayType openArrayType(const H5std_string &name) const;
  34. // Opens a named compound datatype in this location.
  35. CompType openCompType(const char *name) const;
  36. CompType openCompType(const H5std_string &name) const;
  37. // Opens a named enumeration datatype in this location.
  38. EnumType openEnumType(const char *name) const;
  39. EnumType openEnumType(const H5std_string &name) const;
  40. // Opens a named integer datatype in this location.
  41. IntType openIntType(const char *name) const;
  42. IntType openIntType(const H5std_string &name) const;
  43. // Opens a named floating-point datatype in this location.
  44. FloatType openFloatType(const char *name) const;
  45. FloatType openFloatType(const H5std_string &name) const;
  46. // Opens a named string datatype in this location.
  47. StrType openStrType(const char *name) const;
  48. StrType openStrType(const H5std_string &name) const;
  49. // Opens a named variable length datatype in this location.
  50. VarLenType openVarLenType(const char *name) const;
  51. VarLenType openVarLenType(const H5std_string &name) const;
  52. #ifndef DOXYGEN_SHOULD_SKIP_THIS
  53. /// For subclasses, H5File and Group, to return the correct
  54. /// object id, i.e. file or group id.
  55. virtual hid_t getLocId() const = 0;
  56. /// For subclasses, H5File and Group, to throw appropriate exception.
  57. virtual void throwException(const H5std_string &func_name, const H5std_string &msg) const = 0;
  58. // Default constructor.
  59. CommonFG();
  60. // Noop destructor.
  61. virtual ~CommonFG();
  62. protected:
  63. virtual void p_setId(const hid_t new_id) = 0;
  64. #endif // DOXYGEN_SHOULD_SKIP_THIS
  65. }; // end of CommonFG
  66. } // namespace H5
  67. #endif // H5CommonFG_H
  68. /***************************************************************************
  69. Design Note
  70. ===========
  71. September 2017:
  72. This class used to be base class of H5File as well, until the
  73. restructure that moved H5File to be subclass of H5Group.
  74. */