H5DcreatProp.h 6.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162
  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 H5DSCreatPropList_H
  15. #define H5DSCreatPropList_H
  16. namespace H5 {
  17. // Class forwarding
  18. class DataType;
  19. class DataSpace;
  20. /*! \class DSetCreatPropList
  21. \brief Class DSetCreatPropList inherits from ObjCreatPropList and provides
  22. wrappers for the HDF5 dataset creation property functions.
  23. */
  24. // Inheritance: ObjCreatPropList -> PropList -> IdComponent
  25. class H5_DLLCPP DSetCreatPropList : public ObjCreatPropList {
  26. public:
  27. ///\brief Default dataset creation property list.
  28. static const DSetCreatPropList &DEFAULT;
  29. // Creates a dataset creation property list.
  30. DSetCreatPropList();
  31. // Queries whether all the filters set in this property list are
  32. // available currently.
  33. bool allFiltersAvail() const;
  34. // Get space allocation time for this property.
  35. H5D_alloc_time_t getAllocTime() const;
  36. // Set space allocation time for dataset during creation.
  37. void setAllocTime(H5D_alloc_time_t alloc_time) const;
  38. // Retrieves the size of the chunks used to store a chunked layout dataset.
  39. int getChunk(int max_ndims, hsize_t *dim) const;
  40. // Sets the size of the chunks used to store a chunked layout dataset.
  41. void setChunk(int ndims, const hsize_t *dim) const;
  42. // Returns information about an external file.
  43. void getExternal(unsigned idx, size_t name_size, char *name, off_t &offset, hsize_t &size) const;
  44. // Returns the number of external files for a dataset.
  45. int getExternalCount() const;
  46. // Gets fill value writing time.
  47. H5D_fill_time_t getFillTime() const;
  48. // Sets fill value writing time for dataset.
  49. void setFillTime(H5D_fill_time_t fill_time) const;
  50. // Retrieves a dataset fill value.
  51. void getFillValue(const DataType &fvalue_type, void *value) const;
  52. // Sets a dataset fill value.
  53. void setFillValue(const DataType &fvalue_type, const void *value) const;
  54. // Returns information about a filter in a pipeline.
  55. H5Z_filter_t getFilter(int filter_number, unsigned int &flags, size_t &cd_nelmts, unsigned int *cd_values,
  56. size_t namelen, char name[], unsigned int &filter_config) const;
  57. // Returns information about a filter in a pipeline given the filter id.
  58. void getFilterById(H5Z_filter_t filter_id, unsigned int &flags, size_t &cd_nelmts,
  59. unsigned int *cd_values, size_t namelen, char name[],
  60. unsigned int &filter_config) const;
  61. // Gets the layout of the raw data storage of the data that uses this
  62. // property list.
  63. H5D_layout_t getLayout() const;
  64. // Sets the type of storage used to store the raw data for the
  65. // dataset that uses this property list.
  66. void setLayout(H5D_layout_t layout) const;
  67. // Returns the number of filters in the pipeline.
  68. int getNfilters() const;
  69. // Checks if fill value has been defined for this property.
  70. H5D_fill_value_t isFillValueDefined() const;
  71. // Modifies the specified filter.
  72. void modifyFilter(H5Z_filter_t filter_id, unsigned int flags, size_t cd_nelmts,
  73. const unsigned int cd_values[]) const;
  74. // Remove one or all filters from the filter pipeline.
  75. void removeFilter(H5Z_filter_t filter_id) const;
  76. // Sets compression method and compression level.
  77. void setDeflate(int level) const;
  78. // Adds an external file to the list of external files.
  79. void setExternal(const char *name, off_t offset, hsize_t size) const;
  80. // Adds a filter to the filter pipeline.
  81. void setFilter(H5Z_filter_t filter, unsigned int flags = 0, size_t cd_nelmts = 0,
  82. const unsigned int cd_values[] = NULL) const;
  83. // Sets Fletcher32 checksum of EDC for this property list.
  84. void setFletcher32() const;
  85. // Sets method of the shuffle filter.
  86. void setShuffle() const;
  87. // Sets SZIP compression method.
  88. void setSzip(unsigned int options_mask, unsigned int pixels_per_block) const;
  89. // Sets N-bit compression method.
  90. void setNbit() const;
  91. // Maps elements of a virtual dataset to elements of the source dataset.
  92. void setVirtual(const DataSpace &vspace, const char *src_fname, const char *src_dsname,
  93. const DataSpace &sspace) const;
  94. void setVirtual(const DataSpace &vspace, const H5std_string src_fname, const H5std_string src_dsname,
  95. const DataSpace &sspace) const;
  96. ///\brief Returns this class name.
  97. virtual H5std_string
  98. fromClass() const override
  99. {
  100. return ("DSetCreatPropList");
  101. }
  102. // Copy constructor - same as the original DSetCreatPropList.
  103. DSetCreatPropList(const DSetCreatPropList &orig);
  104. // Creates a copy of an existing dataset creation property list
  105. // using the property list id.
  106. DSetCreatPropList(const hid_t plist_id);
  107. // Noop destructor.
  108. virtual ~DSetCreatPropList() override;
  109. #ifndef DOXYGEN_SHOULD_SKIP_THIS
  110. // Deletes the global constant, should only be used by the library
  111. static void deleteConstants();
  112. private:
  113. static DSetCreatPropList *DEFAULT_;
  114. // Creates the global constant, should only be used by the library
  115. static DSetCreatPropList *getConstant();
  116. #endif // DOXYGEN_SHOULD_SKIP_THIS
  117. }; // end of DSetCreatPropList
  118. } // namespace H5
  119. #endif // H5DSCreatPropList_H