H5FaccProp.h 6.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171
  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 H5FileAccPropList_H
  15. #define H5FileAccPropList_H
  16. namespace H5 {
  17. /*! \class FileAccPropList
  18. \brief Class FileAccPropList inherits from PropList and provides
  19. wrappers for the HDF5 file access property list.
  20. */
  21. // Inheritance: PropList -> IdComponent
  22. class H5_DLLCPP FileAccPropList : public PropList {
  23. public:
  24. ///\brief Default file access property list.
  25. static const FileAccPropList &DEFAULT;
  26. // Creates a file access property list.
  27. FileAccPropList();
  28. // Modifies this property list to use the H5FD_STDIO driver
  29. void setStdio() const;
  30. // Set file driver for this property list
  31. void setDriver(hid_t new_driver_id, const void *new_driver_info) const;
  32. // Returns a low-level file driver identifier.
  33. hid_t getDriver() const;
  34. // Sets offset for family driver.
  35. void setFamilyOffset(hsize_t offset) const;
  36. // Gets offset for family driver.
  37. hsize_t getFamilyOffset() const;
  38. // Modifies this file access property list to use the sec2 driver.
  39. void setSec2() const;
  40. // Modifies this file access property list to use the H5FD_CORE
  41. // driver.
  42. void setCore(size_t increment, hbool_t backing_store) const;
  43. // Queries H5FD_CORE driver properties.
  44. void getCore(size_t &increment, hbool_t &backing_store) const;
  45. // Sets this file access properties list to the family driver.
  46. void setFamily(hsize_t memb_size, const FileAccPropList &memb_plist) const;
  47. // Returns information about the family file access property list.
  48. void getFamily(hsize_t &memb_size, FileAccPropList &memb_plist) const;
  49. FileAccPropList getFamily(hsize_t &memb_size) const;
  50. // Emulates the old split file driver,
  51. void setSplit(const FileAccPropList &meta_plist, const FileAccPropList &raw_plist,
  52. const char *meta_ext = ".meta", const char *raw_ext = ".raw") const;
  53. void setSplit(const FileAccPropList &meta_plist, const FileAccPropList &raw_plist,
  54. const H5std_string &meta_ext = ".meta", const H5std_string &raw_ext = ".raw") const;
  55. // Sets the maximum size of the data sieve buffer.
  56. void setSieveBufSize(size_t bufsize) const;
  57. // Returns the current settings for the data sieve buffer size
  58. // property
  59. size_t getSieveBufSize() const;
  60. // Sets the minimum size of metadata block allocations.
  61. void setMetaBlockSize(hsize_t &block_size) const;
  62. // Returns the current metadata block size setting.
  63. hsize_t getMetaBlockSize() const;
  64. // Modifies this file access property list to use the logging driver.
  65. void setLog(const char *logfile, unsigned flags, size_t buf_size) const;
  66. void setLog(const H5std_string &logfile, unsigned flags, size_t buf_size) const;
  67. // Sets alignment properties of this file access property list
  68. void setAlignment(hsize_t threshold = 1, hsize_t alignment = 1) const;
  69. // Retrieves the current settings for alignment properties from
  70. // this property list.
  71. void getAlignment(hsize_t &threshold, hsize_t &alignment) const;
  72. // Sets data type for multi driver.
  73. void setMultiType(H5FD_mem_t dtype) const;
  74. // Returns the data type property for MULTI driver.
  75. H5FD_mem_t getMultiType() const;
  76. // Sets the meta data cache and raw data chunk cache parameters.
  77. void setCache(int mdc_nelmts, size_t rdcc_nelmts, size_t rdcc_nbytes, double rdcc_w0) const;
  78. // Queries the meta data cache and raw data chunk cache parameters.
  79. void getCache(int &mdc_nelmts, size_t &rdcc_nelmts, size_t &rdcc_nbytes, double &rdcc_w0) const;
  80. // Sets the degree for the file close behavior.
  81. void setFcloseDegree(H5F_close_degree_t degree) const;
  82. // Returns the degree for the file close behavior.
  83. H5F_close_degree_t getFcloseDegree() const;
  84. // Sets file access property list to use the H5FD_DIRECT driver.
  85. void setFileAccDirect(size_t boundary, size_t block_size, size_t cbuf_size) const;
  86. // Retrieves information about the direct file access property list.
  87. void getFileAccDirect(size_t &boundary, size_t &block_size, size_t &cbuf_size) const;
  88. // Sets garbage collecting references flag.
  89. void setGcReferences(unsigned gc_ref = 0) const;
  90. // Returns garbage collecting references setting.
  91. unsigned getGcReferences() const;
  92. // Sets file locking parameters.
  93. void setFileLocking(hbool_t use_file_locking, hbool_t ignore_when_disabled) const;
  94. // Gets file locking parameters.
  95. void getFileLocking(hbool_t &use_file_locking, hbool_t &ignore_when_disabled) const;
  96. // Sets bounds on versions of library format to be used when creating
  97. // or writing objects.
  98. void setLibverBounds(H5F_libver_t libver_low, H5F_libver_t libver_high) const;
  99. // Gets the current settings for the library version format bounds.
  100. void getLibverBounds(H5F_libver_t &libver_low, H5F_libver_t &libver_high) const;
  101. ///\brief Returns this class name.
  102. virtual H5std_string
  103. fromClass() const override
  104. {
  105. return ("FileAccPropList");
  106. }
  107. // Copy constructor: same as the original FileAccPropList.
  108. FileAccPropList(const FileAccPropList &original);
  109. // Creates a copy of an existing file access property list
  110. // using the property list id.
  111. FileAccPropList(const hid_t plist_id);
  112. // Noop destructor
  113. virtual ~FileAccPropList() override;
  114. #ifndef DOXYGEN_SHOULD_SKIP_THIS
  115. // Deletes the global constant, should only be used by the library
  116. static void deleteConstants();
  117. private:
  118. static FileAccPropList *DEFAULT_;
  119. // Creates the global constant, should only be used by the library
  120. static FileAccPropList *getConstant();
  121. #endif // DOXYGEN_SHOULD_SKIP_THIS
  122. }; // end of FileAccPropList
  123. } // namespace H5
  124. #endif // H5FileAccPropList_H