H5AbstractDs.h 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  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 H5AbstractDs_H
  15. #define H5AbstractDs_H
  16. namespace H5 {
  17. class ArrayType;
  18. class CompType;
  19. class EnumType;
  20. class FloatType;
  21. class IntType;
  22. class StrType;
  23. class VarLenType;
  24. class DataSpace;
  25. /*! \class AbstractDs
  26. \brief AbstractDs is an abstract base class, inherited by Attribute
  27. and DataSet.
  28. It provides a collection of services that are common to both Attribute
  29. and DataSet.
  30. */
  31. class H5_DLLCPP AbstractDs {
  32. public:
  33. // Gets a copy the datatype of that this abstract dataset uses.
  34. // Note that this datatype is a generic one and can only be accessed
  35. // via generic member functions, i.e., member functions belong
  36. // to DataType. To get specific datatype, i.e. EnumType, FloatType,
  37. // etc..., use the specific functions, that follow, instead.
  38. DataType getDataType() const;
  39. // Gets a copy of the specific datatype of this abstract dataset.
  40. ArrayType getArrayType() const;
  41. CompType getCompType() const;
  42. EnumType getEnumType() const;
  43. IntType getIntType() const;
  44. FloatType getFloatType() const;
  45. StrType getStrType() const;
  46. VarLenType getVarLenType() const;
  47. ///\brief Gets the size in memory of this abstract dataset.
  48. virtual size_t getInMemDataSize() const = 0;
  49. ///\brief Gets the dataspace of this abstract dataset - pure virtual.
  50. virtual DataSpace getSpace() const = 0;
  51. // Gets the class of the datatype that is used by this abstract
  52. // dataset.
  53. H5T_class_t getTypeClass() const;
  54. ///\brief Returns the amount of storage size required - pure virtual.
  55. virtual hsize_t getStorageSize() const = 0;
  56. // Returns this class name - pure virtual.
  57. virtual H5std_string fromClass() const = 0;
  58. // Destructor
  59. virtual ~AbstractDs();
  60. protected:
  61. // Default constructor
  62. AbstractDs();
  63. private:
  64. // This member function is implemented by DataSet and Attribute - pure virtual.
  65. virtual hid_t p_get_type() const = 0;
  66. }; // end of AbstractDs
  67. } // namespace H5
  68. #endif // H5AbstractDs_H