diff options
Diffstat (limited to 'c++/src/H5DcreatProp.cpp')
-rw-r--r-- | c++/src/H5DcreatProp.cpp | 251 |
1 files changed, 141 insertions, 110 deletions
diff --git a/c++/src/H5DcreatProp.cpp b/c++/src/H5DcreatProp.cpp index f95b043..ae98a79 100644 --- a/c++/src/H5DcreatProp.cpp +++ b/c++/src/H5DcreatProp.cpp @@ -28,36 +28,47 @@ namespace H5 { #endif //-------------------------------------------------------------------------- -///\brief Constant for default property +///\brief Constant for dataset creation default property //-------------------------------------------------------------------------- const DSetCreatPropList DSetCreatPropList::DEFAULT( H5P_DEFAULT ); //-------------------------------------------------------------------------- -// Function: Default Constructor -///\brief Default Constructor: Creates a dataset creation property list +// Function: DSetCreatPropList default constructor +///\brief Default constructor: creates a stub dataset creation property list +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- DSetCreatPropList::DSetCreatPropList() : PropList( H5P_DATASET_CREATE) {} //-------------------------------------------------------------------------- -// Function: Copy Constructor -///\brief Copy Constructor: Makes a copy of the original +// Function: DSetCreatPropList copy constructor +///\brief Copy constructor: makes a copy of the original /// DSetCreatPropList object +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- DSetCreatPropList::DSetCreatPropList( const DSetCreatPropList& orig ) : PropList( orig ) {} //-------------------------------------------------------------------------- +// Function: DSetCreatPropList overloaded constructor +///\brief Creates a DSetCreatPropList object using the id of an +/// existing dataset creation property list. +// Programmer Binh-Minh Ribler - 2000 +//-------------------------------------------------------------------------- +DSetCreatPropList::DSetCreatPropList(const hid_t plist_id) : PropList( plist_id ) {} + +//-------------------------------------------------------------------------- // Function: DSetCreatPropList::setChunk -///\brief Sets the size of the chunks used to store a chunked layout +///\brief Sets the size of the chunks used to store a chunked layout /// dataset. -///\param ndims - IN: Number of dimensions of each chunk +///\param ndims - IN: Number of dimensions of each chunk ///\param dim - IN: Array containing the size of each chunk ///\exception H5::PropListIException ///\par Description /// The \a ndims parameter currently must have the same value as -/// the rank of the dataset. The values of the \a dim array -/// define the size of the chunks to store the dataset's raw -/// data. As a side-effect, the layout of the dataset will be +/// the rank of the dataset. The values of the \a dim array +/// define the size of the chunks to store the dataset's raw +/// data. As a side-effect, the layout of the dataset will be /// changed to \c H5D_CHUNKED, if it is not so already. +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- void DSetCreatPropList::setChunk( int ndims, const hsize_t* dim ) const { @@ -70,11 +81,12 @@ void DSetCreatPropList::setChunk( int ndims, const hsize_t* dim ) const //-------------------------------------------------------------------------- // Function: DSetCreatPropList::getChunk -///\brief Retrieves the size of the chunks used to store a chunked +///\brief Retrieves the size of the chunks used to store a chunked /// layout dataset. -///\param max_ndims - IN: Size of \a dim array +///\param max_ndims - IN: Size of \a dim array ///\param dim - OUT: Array to store the chunk dimensions ///\exception H5::PropListIException +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- int DSetCreatPropList::getChunk( int max_ndims, hsize_t* dim ) const { @@ -90,14 +102,14 @@ int DSetCreatPropList::getChunk( int max_ndims, hsize_t* dim ) const //-------------------------------------------------------------------------- // Function: DSetCreatPropList::setLayout ///\brief Sets the type of storage used store the raw data for a dataset. -///\param plist - IN: Property list id, here by mistake, should be removed -///\param layout - IN: Type of storage layout for raw data +///\param layout - IN: Type of storage layout for raw data ///\exception H5::PropListIException ///\par Description /// For information on setting layout type, please refer to /// http://hdf.ncsa.uiuc.edu/HDF5/doc/RM_H5P.html#Property-SetLayout +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -void DSetCreatPropList::setLayout(hid_t plist, H5D_layout_t layout ) const +void DSetCreatPropList::setLayout(H5D_layout_t layout) const { herr_t ret_value = H5Pset_layout( id, layout ); if( ret_value < 0 ) @@ -111,16 +123,17 @@ void DSetCreatPropList::setLayout(hid_t plist, H5D_layout_t layout ) const // Function: DSetCreatPropList::getLayout ///\brief Retrieves the layout type of this property list ///\return Layout type, which can be: -/// \li \c H5D_COMPACT - raw data is stored in the object -/// header in the file. +/// \li \c H5D_COMPACT - raw data is stored in the object +/// header in the file. /// \li \c H5D_CONTIGUOUS - raw data is stored separately from the -/// object header in one contiguous chunk in -/// the file. -/// \li \c H5D_CHUNKED - raw data is stored separately from the -/// object header in chunks in separate locations -/// in the file. +/// object header in one contiguous chunk in +/// the file. +/// \li \c H5D_CHUNKED - raw data is stored separately from the +/// object header in chunks in separate locations +/// in the file. ///\exception H5::PropListIException ///\par Description +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- H5D_layout_t DSetCreatPropList::getLayout() const { @@ -139,10 +152,11 @@ H5D_layout_t DSetCreatPropList::getLayout() const ///\param level - IN: Compression level, should [0..9], inclusive ///\exception H5::PropListIException ///\par Description -/// The function sets the compression method for this property -/// list to \c H5D_COMPRESS_DEFLATE and the compression level to -/// \a level. Lower compression levels are faster but result in +/// The function sets the compression method for this property +/// list to \c H5D_COMPRESS_DEFLATE and the compression level to +/// \a level. Lower compression levels are faster but result in /// less compression. +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- void DSetCreatPropList::setDeflate( int level ) const { @@ -158,18 +172,19 @@ void DSetCreatPropList::setDeflate( int level ) const // Function: DSetCreatPropList::setFillValue ///\brief Sets a dataset fill value ///\param fvalue_type - IN: Data type for the value passed via \a value -///\param value - IN: Pointer to buffer containing the fill value +///\param value - IN: Pointer to buffer containing the fill value ///\exception H5::PropListIException ///\par Description /// The datatype may differ from that of the dataset, but it must -/// be one that the HDF5 library is able to convert \a value to +/// be one that the HDF5 library is able to convert \a value to /// the dataset datatype when the dataset is created. -/// The default fill value is 0 (zero,) which is interpreted +/// The default fill value is 0 (zero,) which is interpreted /// according to the actual dataset datatype. -///\par +///\par /// For information on setting fill value, please refer to the /// C layer Reference Manual at: /// http://hdf.ncsa.uiuc.edu/HDF5/doc/RM_H5P.html#Property-SetFillValue +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- void DSetCreatPropList::setFillValue( const DataType& fvalue_type, const void* value ) const { @@ -185,13 +200,14 @@ void DSetCreatPropList::setFillValue( const DataType& fvalue_type, const void* v // Function: DSetCreatPropList::getFillValue ///\brief Retrieves a dataset fill value ///\param fvalue_type - IN: Data type for the value passed via \a value -///\param value - OUT: Pointer to buffer to hold the retrieved fill value +///\param value - OUT: Pointer to buffer to hold the retrieved fill value ///\exception H5::PropListIException ///\par Description -/// The fill value is returned through \a value pointer -/// and the memory is allocated by the caller. The fill -/// value will be converted from its current data type to the -/// specified by \a fvalue_type. +/// The fill value is returned through \a value pointer +/// and the memory is allocated by the caller. The fill +/// value will be converted from its current data type to the +/// specified by \a fvalue_type. +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- void DSetCreatPropList::getFillValue( const DataType& fvalue_type, void* value ) const { @@ -206,11 +222,12 @@ void DSetCreatPropList::getFillValue( const DataType& fvalue_type, void* value ) //-------------------------------------------------------------------------- // Function: DSetCreatPropList::isFillValueDefined ///\brief Check if fill value has been defined for this property -///\return +///\return /// \li \c H5D_FILL_VALUE_UNDEFINED =0, /// \li \c H5D_FILL_VALUE_DEFAULT =1, /// \li \c H5D_FILL_VALUE_USER_DEFINED =2 ///\exception H5::PropListIException +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- H5D_fill_value_t DSetCreatPropList::isFillValueDefined() { @@ -227,22 +244,23 @@ H5D_fill_value_t DSetCreatPropList::isFillValueDefined() //-------------------------------------------------------------------------- // Function: DSetCreatPropList::setFilter -///\brief Adds a filter to the filter pipeline -///\param filter_id - IN: Filter to add +///\brief Adds a filter to the filter pipeline +///\param filter_id - IN: Filter to add ///\param flags - IN: Specifies general properties of the filter ///\param cd_nelmts - IN: Number of elements in cd_values ///\param cd_values - IN: Auxiliary data for the filter ///\exception H5::PropListIException ///\par Description -/// The \a flags argument is a bit vector of the field: -/// \c H5Z_FLAG_OPTIONAL(0x0001) +/// The \a flags argument is a bit vector of the field: +/// \c H5Z_FLAG_OPTIONAL(0x0001) ///\par /// If this bit is set then the filter is optional. If the filter -/// fails during a \c DataSet::write() operation then the filter -/// is just excluded from the pipeline for the chunk for which it -/// failed; the filter will not participate in the pipeline -/// during a \c DataSet::read() of the chunk. If this bit is clear -/// and the filter fails then the entire I/O operation fails. +/// fails during a \c DataSet::write() operation then the filter +/// is just excluded from the pipeline for the chunk for which it +/// failed; the filter will not participate in the pipeline +/// during a \c DataSet::read() of the chunk. If this bit is clear +/// and the filter fails then the entire I/O operation fails. +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- void DSetCreatPropList::setFilter( H5Z_filter_t filter_id, unsigned int flags, size_t cd_nelmts, const unsigned int cd_values[] ) const { @@ -255,13 +273,14 @@ void DSetCreatPropList::setFilter( H5Z_filter_t filter_id, unsigned int flags, s } //-------------------------------------------------------------------------- -// Function: DSetCreatPropList::removeFilter -///\brief Removes one or more filters -///\param filter_id - IN: Filter to remove +// Function: DSetCreatPropList::removeFilter +///\brief Removes one or more filters +///\param filter_id - IN: Filter to remove ///\exception H5::PropListIException ///\par Description /// Deletes a filter from the dataset creation property list; /// deletes all filters if \a filter_id is \c H5Z_FILTER_NONE. +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- void DSetCreatPropList::removeFilter(H5Z_filter_t filter_id) const { @@ -274,10 +293,11 @@ void DSetCreatPropList::removeFilter(H5Z_filter_t filter_id) const } //-------------------------------------------------------------------------- -// Function: DSetCreatPropList::getNfilters -///\brief Returns the number of filters in the pipeline +// Function: DSetCreatPropList::getNfilters +///\brief Returns the number of filters in the pipeline ///\return Number of filters ///\exception H5::PropListIException +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- int DSetCreatPropList::getNfilters() const { @@ -292,9 +312,9 @@ int DSetCreatPropList::getNfilters() const } //-------------------------------------------------------------------------- -// Function: DSetCreatPropList::getFilter +// Function: DSetCreatPropList::getFilter ///\brief Returns information about a filter in a pipeline -///\param filter_number - IN: Filter to get, range [0..N-1], where +///\param filter_number - IN: Filter to get, range [0..N-1], where /// N is returned by H5Pget_nfilters() ///\param flags - OUT: General properties of the filter ///\param cd_nelmts - IN/OUT: Number of elements in \a cd_values /Number @@ -325,10 +345,10 @@ H5Z_filter_t DSetCreatPropList::getFilter(int filter_number, unsigned int &flags } //-------------------------------------------------------------------------- -// Function: DSetCreatPropList::getFilterById +// Function: DSetCreatPropList::getFilterById ///\brief Returns information about a filter in a pipeline given the /// filter id -///\param filter_id - IN: Filter to get +///\param filter_id - IN: Filter to get ///\param flags - OUT: General properties of the filter ///\param cd_nelmts - IN/OUT: Number of elements in \a cd_values /Number /// of values defined by the filter @@ -357,19 +377,20 @@ void DSetCreatPropList::getFilterById(H5Z_filter_t filter_id, unsigned int &flag ///\param filter_id - IN: Filter to get ///\param flags - OUT: General properties of the filter ///\param cd_nelmts - IN: Number of elements in \a cd_values -/// \n OUT: Number of values defined by the filter +/// \n OUT: Number of values defined by the filter ///\param cd_values - OUT: Array to hold the data; allocated by the user ///\exception H5::PropListIException ///\par Description -/// The \a flags argument is a bit vector of the field: -/// \c H5Z_FLAG_OPTIONAL(0x0001) +/// The \a flags argument is a bit vector of the field: +/// \c H5Z_FLAG_OPTIONAL(0x0001) ///\par /// If this bit is set then the filter is optional. If the filter -/// fails during a DataSet::write() operation then the filter -/// is just excluded from the pipeline for the chunk for which it -/// failed; the filter will not participate in the pipeline -/// during a DataSet::read() of the chunk. If this bit is clear -/// and the filter fails then the entire I/O operation fails. +/// fails during a DataSet::write() operation then the filter +/// is just excluded from the pipeline for the chunk for which it +/// failed; the filter will not participate in the pipeline +/// during a DataSet::read() of the chunk. If this bit is clear +/// and the filter fails then the entire I/O operation fails. +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- void DSetCreatPropList::modifyFilter( H5Z_filter_t filter_id, unsigned int flags, size_t cd_nelmts, const unsigned int cd_values[] ) const { @@ -382,12 +403,13 @@ void DSetCreatPropList::modifyFilter( H5Z_filter_t filter_id, unsigned int flags } //-------------------------------------------------------------------------- -// Function: DSetCreatPropList::allFiltersAvail -///\brief Queries whether all the filters set in this property list +// Function: DSetCreatPropList::allFiltersAvail +///\brief Queries whether all the filters set in this property list /// are available currently. -///\return true if all filters available, and false if one or more +///\return true if all filters available, and false if one or more /// filters not currently available -///\exception H5::PropListIException +///\exception H5::PropListIException +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- bool DSetCreatPropList::allFiltersAvail() { @@ -403,13 +425,14 @@ bool DSetCreatPropList::allFiltersAvail() } //-------------------------------------------------------------------------- -// Function: DSetCreatPropList::setShuffle -///\brief Sets method of the shuffle filter -///\exception H5::PropListIException +// Function: DSetCreatPropList::setShuffle +///\brief Sets method of the shuffle filter +///\exception H5::PropListIException ///\par Description /// Please refer to the Reference Manual of \c H5Pset_shuffle for /// details. -/// http://hdf.ncsa.uiuc.edu/HDF5/doc/RM_H5P.html#Property-SetShuffle +/// http://hdf.ncsa.uiuc.edu/HDF5/doc/RM_H5P.html#Property-SetShuffle +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- void DSetCreatPropList::setShuffle() { @@ -422,17 +445,18 @@ void DSetCreatPropList::setShuffle() } //-------------------------------------------------------------------------- -// Function: DSetCreatPropList::getAllocTime +// Function: DSetCreatPropList::getAllocTime ///\brief Get space allocation time for this property. ///\return Space allocation time. ///\exception H5::PropListIException ///\par Description -/// The values of space allocation time can be one of the +/// The values of space allocation time can be one of the /// followings: /// \li \c H5D_ALLOC_TIME_DEFAULT /// \li \c H5D_ALLOC_TIME_EARLY /// \li \c H5D_ALLOC_TIME_LATE /// \li \c H5D_ALLOC_TIME_INCR +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- H5D_alloc_time_t DSetCreatPropList::getAllocTime() { @@ -448,14 +472,15 @@ H5D_alloc_time_t DSetCreatPropList::getAllocTime() } //-------------------------------------------------------------------------- -// Function: DSetCreatPropList::getFillTime -///\brief Gets fill value writing time. +// Function: DSetCreatPropList::getFillTime +///\brief Gets fill value writing time. ///\return Fill value writing time -///\exception H5::PropListIException +///\exception H5::PropListIException ///\par Description -/// Valid values for fill value writing time include -/// \li \c H5D_FILL_TIME_NEVER +/// Valid values for fill value writing time include +/// \li \c H5D_FILL_TIME_NEVER /// \li \c H5D_FILL_TIME_ALLOC. +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- H5D_fill_time_t DSetCreatPropList::getFillTime() { @@ -471,7 +496,7 @@ H5D_fill_time_t DSetCreatPropList::getFillTime() } //-------------------------------------------------------------------------- -// Function: DSetCreatPropList::setAllocTime +// Function: DSetCreatPropList::setAllocTime ///\brief Sets space allocation time for dataset during creation. ///\param alloc_time - IN: Allocation time ///\exception H5::PropListIException @@ -481,6 +506,7 @@ H5D_fill_time_t DSetCreatPropList::getFillTime() /// \li \c H5D_ALLOC_TIME_EARLY /// \li \c H5D_ALLOC_TIME_LATE /// \li \c H5D_ALLOC_TIME_INCR +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- void DSetCreatPropList::setAllocTime(H5D_alloc_time_t alloc_time) { @@ -493,14 +519,15 @@ void DSetCreatPropList::setAllocTime(H5D_alloc_time_t alloc_time) } //-------------------------------------------------------------------------- -// Function: DSetCreatPropList::setFillTime -///\brief Sets fill value writing time for dataset. +// Function: DSetCreatPropList::setFillTime +///\brief Sets fill value writing time for dataset. ///\return Fill value writing time -///\exception H5::PropListIException +///\exception H5::PropListIException ///\par Description -/// Valid values for fill value writing time include -/// \li \c H5D_FILL_TIME_NEVER +/// Valid values for fill value writing time include +/// \li \c H5D_FILL_TIME_NEVER /// \li \c H5D_FILL_TIME_ALLOC. +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- void DSetCreatPropList::setFillTime(H5D_fill_time_t fill_time) { @@ -513,9 +540,10 @@ void DSetCreatPropList::setFillTime(H5D_fill_time_t fill_time) } //-------------------------------------------------------------------------- -// Function: DSetCreatPropList::setFletcher32 -///\brief Sets Fletcher32 checksum of EDC for this property list. -///\exception H5::PropListIException +// Function: DSetCreatPropList::setFletcher32 +///\brief Sets Fletcher32 checksum of EDC for this property list. +///\exception H5::PropListIException +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- void DSetCreatPropList::setFletcher32() { @@ -528,19 +556,20 @@ void DSetCreatPropList::setFletcher32() } //-------------------------------------------------------------------------- -// Function: DSetCreatPropList::setExternal -///\brief Adds an external file to the list of external files +// Function: DSetCreatPropList::setExternal +///\brief Adds an external file to the list of external files ///\param name - IN: Name of the external file ///\param offset - IN: Location where the data starts in the file ///\param size - IN: Number of bytes reserved in the file for the data -///\exception H5::PropListIException +///\exception H5::PropListIException ///\par Description /// If a dataset is splitted across multiple files then the files -/// should be defined in order. The total size of the dataset is -/// the sum of the \a size arguments for all the external files. If -/// the total size is larger than the size of a dataset then the -/// dataset can be extended (provided the data space also allows -/// the extending). +/// should be defined in order. The total size of the dataset is +/// the sum of the \a size arguments for all the external files. If +/// the total size is larger than the size of a dataset then the +/// dataset can be extended (provided the data space also allows +/// the extending). +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- void DSetCreatPropList::setExternal( const char* name, off_t offset, hsize_t size ) const { @@ -553,10 +582,11 @@ void DSetCreatPropList::setExternal( const char* name, off_t offset, hsize_t siz } //-------------------------------------------------------------------------- -// Function: DSetCreatPropList::getExternalCount -///\brief Returns the number of external files for a dataset +// Function: DSetCreatPropList::getExternalCount +///\brief Returns the number of external files for a dataset ///\return Number of external files -///\exception H5::PropListIException +///\exception H5::PropListIException +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- int DSetCreatPropList::getExternalCount() const { @@ -573,23 +603,24 @@ int DSetCreatPropList::getExternalCount() const //-------------------------------------------------------------------------- // Function: DSetCreatPropList::getExternal ///\brief Returns information about an external file -///\param idx - IN: Index of the external file, ranges [0-(N-1)] -/// and returned by \c getExternalCount() +///\param idx - IN: Index of the external file, ranges [0-(N-1)] and +/// returned by getExternalCount() ///\param name_size - IN: Maximum length of \a name -///\param name - IN: Name of the external file -///\param offset - IN: Location to return an offset value -///\param size - OUT: Location to return the size of the external file data -///\exception H5::PropListIException +///\param name - IN: Name of the external file +///\param offset - IN: Location to return an offset value +///\param size - OUT: Location to return the size of the external file data +///\exception H5::PropListIException ///\par Description /// The parameter \a idx ranges [0..N-1] where N is returned by -/// getExternalCount(). At most \a name_size characters are copied -/// into the name array. If the external file name is longer than -/// name_size with the null terminator, the return value is not -/// null terminated (similar to strncpy()). -/// If \a name_size is zero or \a name is a null pointer, the -/// external file name will not be returned. If \a offset or -/// \a size are null pointers then the corresponding information +/// getExternalCount(). At most \a name_size characters are copied +/// into the name array. If the external file name is longer than +/// name_size with the null terminator, the return value is not +/// null terminated (similar to strncpy()). +/// If \a name_size is zero or \a name is a null pointer, the +/// external file name will not be returned. If \a offset or +/// \a size are null pointers then the corresponding information /// will not be returned. +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- void DSetCreatPropList::getExternal( int idx, size_t name_size, char* name, off_t& offset, hsize_t& size ) const { @@ -604,7 +635,7 @@ void DSetCreatPropList::getExternal( int idx, size_t name_size, char* name, off_ //-------------------------------------------------------------------------- // Function: DSetCreatPropList destructor ///\brief Noop destructor. -// Programmer Binh-Minh Ribler - 2000 +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- DSetCreatPropList::~DSetCreatPropList () {} |