mirror of
https://github.com/HDFGroup/hdf5.git
synced 2025-03-31 17:10:47 +08:00
[svn-r27946] Brought VDS branch in sync with trunk (up to r27945).
Tested on Ubuntu 15.04 (Linux 3.19 x86_64), gcc 4.9.2, MPICH 3.1.4 and CMake 3.3.2. - Autotools serial w/ Fortran, C++ - Autotools parallel w/ Fortran - CMake serial w/ Fortran, C++
This commit is contained in:
commit
914643490a
@ -45,6 +45,7 @@ namespace H5 {
|
||||
#endif
|
||||
|
||||
class H5_DLLCPP H5Object; // forward declaration for UserData4Aiterate
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: Attribute default constructor
|
||||
///\brief Default constructor: Creates a stub attribute
|
||||
|
@ -14,7 +14,6 @@
|
||||
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
|
||||
|
||||
#include <string>
|
||||
#include <iostream>
|
||||
|
||||
#include "H5Include.h"
|
||||
#include "H5Exception.h"
|
||||
@ -1268,7 +1267,7 @@ CommonFG::~CommonFG() {}
|
||||
//--------------------------------------------------------------------------
|
||||
void f_DataType_setId(DataType* dtype, hid_t new_id)
|
||||
{
|
||||
dtype->id = new_id;
|
||||
dtype->p_setId(new_id);
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
@ -1283,7 +1282,7 @@ void f_DataType_setId(DataType* dtype, hid_t new_id)
|
||||
//--------------------------------------------------------------------------
|
||||
void f_DataSet_setId(DataSet* dset, hid_t new_id)
|
||||
{
|
||||
dset->id = new_id;
|
||||
dset->p_setId(new_id);
|
||||
}
|
||||
|
||||
#endif // DOXYGEN_SHOULD_SKIP_THIS
|
||||
|
@ -33,10 +33,60 @@ namespace H5 {
|
||||
#endif // H5_NO_STD
|
||||
#endif
|
||||
|
||||
#ifndef DOXYGEN_SHOULD_SKIP_THIS
|
||||
// This DOXYGEN_SHOULD_SKIP_THIS block is a work-around approach to control
|
||||
// the order of creation and deletion of the global constants. See Design Notes
|
||||
// in "H5PredType.cpp" for information.
|
||||
|
||||
// Initialize a pointer for the constant
|
||||
DataSpace* DataSpace::ALL_ = 0;
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
///\brief Constant for default dataspace.
|
||||
// Function: DataSpace::getConstant
|
||||
// Creates a DataSpace object representing the HDF5 constant
|
||||
// H5S_ALL, pointed to by DataSpace::ALL_
|
||||
// Exception H5::DataSpaceIException
|
||||
// Description
|
||||
// If DataSpace::ALL_ already points to an allocated object, throw
|
||||
// a DataSpaceIException. This scenario should not happen.
|
||||
// Programmer Binh-Minh Ribler - 2015
|
||||
//--------------------------------------------------------------------------
|
||||
const DataSpace DataSpace::ALL( H5S_ALL );
|
||||
DataSpace* DataSpace::getConstant()
|
||||
{
|
||||
// Tell the C library not to clean up, H5Library::termH5cpp will call
|
||||
// H5close - more dependency if use H5Library::dontAtExit()
|
||||
if (!IdComponent::H5dontAtexit_called)
|
||||
{
|
||||
(void) H5dont_atexit();
|
||||
IdComponent::H5dontAtexit_called = true;
|
||||
}
|
||||
|
||||
// If the constant pointer is not allocated, allocate it. Otherwise,
|
||||
// throw because it shouldn't be.
|
||||
if (ALL_ == 0)
|
||||
ALL_ = new DataSpace(H5S_ALL);
|
||||
else
|
||||
throw DataSpaceIException("DataSpace::getConstant", "DataSpace::getConstant is being invoked on an allocated ALL_");
|
||||
return(ALL_);
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: DataSpace::deleteConstants
|
||||
// Purpose: Deletes the constant object that DataSpace::ALL_ points to
|
||||
// Programmer Binh-Minh Ribler - 2015
|
||||
//--------------------------------------------------------------------------
|
||||
void DataSpace::deleteConstants()
|
||||
{
|
||||
if (ALL_ != 0)
|
||||
delete ALL_;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Purpose Constant for default dataspace.
|
||||
//--------------------------------------------------------------------------
|
||||
const DataSpace& DataSpace::ALL = *getConstant();
|
||||
|
||||
#endif // DOXYGEN_SHOULD_SKIP_THIS
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: DataSpace constructor
|
||||
|
@ -24,8 +24,8 @@ namespace H5 {
|
||||
//! Class DataSpace operates on HDF5 dataspaces.
|
||||
class H5_DLLCPP DataSpace : public IdComponent {
|
||||
public:
|
||||
// Default DataSpace objects
|
||||
static const DataSpace ALL;
|
||||
///\brief Default DataSpace objects
|
||||
static const DataSpace& ALL;
|
||||
|
||||
// Creates a dataspace object given the space type
|
||||
DataSpace(H5S_class_t type = H5S_SCALAR);
|
||||
@ -118,20 +118,34 @@ class H5_DLLCPP DataSpace : public IdComponent {
|
||||
// Gets the dataspace id.
|
||||
virtual hid_t getId() const;
|
||||
|
||||
// Deletes the global constant
|
||||
static void deleteConstants();
|
||||
|
||||
// Destructor: properly terminates access to this dataspace.
|
||||
virtual ~DataSpace();
|
||||
|
||||
protected:
|
||||
#ifndef DOXYGEN_SHOULD_SKIP_THIS
|
||||
|
||||
protected:
|
||||
// Sets the dataspace id.
|
||||
virtual void p_setId(const hid_t new_id);
|
||||
|
||||
#endif // DOXYGEN_SHOULD_SKIP_THIS
|
||||
|
||||
private:
|
||||
hid_t id; // HDF5 dataspace id
|
||||
|
||||
#ifndef DOXYGEN_SHOULD_SKIP_THIS
|
||||
|
||||
static DataSpace* ALL_;
|
||||
|
||||
// Creates the global constant
|
||||
static DataSpace* getConstant();
|
||||
|
||||
// Friend function to set DataSpace id. For library use only.
|
||||
friend void f_DataSpace_setId(DataSpace *dspace, hid_t new_id);
|
||||
|
||||
#endif // DOXYGEN_SHOULD_SKIP_THIS
|
||||
};
|
||||
#ifndef H5_NO_NAMESPACE
|
||||
}
|
||||
|
@ -760,23 +760,17 @@ void DataType::close()
|
||||
// - Added the use of H5CPP_EXITED to terminate the HDF5 library
|
||||
// and elimiate previous memory leaks. See comments in the
|
||||
// header file "H5PredType.h" for details. - BMR, Mar 30, 2012
|
||||
// - Major re-implementation of the global constants was done
|
||||
// to avoid relying on the order of the creation and deletion
|
||||
// of the global constants. Hence, H5CPP_EXITED was removed.
|
||||
// See Design Notes in "H5PredType.cpp" for details.
|
||||
// - BMR, Sep 30, 2015
|
||||
//--------------------------------------------------------------------------
|
||||
DataType::~DataType()
|
||||
{
|
||||
try
|
||||
{
|
||||
/* If this is the object AtExit, terminate the HDF5 library. This is
|
||||
to eliminate memory leaks due to the library being re-initiated
|
||||
(after the program has ended) and not re-terminated. */
|
||||
if (id == H5CPP_EXITED)
|
||||
{
|
||||
herr_t ret_value = H5close();
|
||||
if (ret_value == FAIL)
|
||||
throw DataTypeIException(inMemFunc("~DataType - "), "H5close failed");
|
||||
}
|
||||
// Close the HDF5 datatype
|
||||
else
|
||||
close();
|
||||
close();
|
||||
}
|
||||
catch (Exception close_error) {
|
||||
cerr << inMemFunc("~DataType - ") << close_error.getDetailMsg() << endl;
|
||||
|
@ -28,10 +28,63 @@
|
||||
namespace H5 {
|
||||
#endif
|
||||
|
||||
#ifndef DOXYGEN_SHOULD_SKIP_THIS
|
||||
// This DOXYGEN_SHOULD_SKIP_THIS block is a work-around approach to control
|
||||
// the order of creation and deletion of the global constants. See Design Notes
|
||||
// in "H5PredType.cpp" for information.
|
||||
|
||||
// Initialize a pointer for the constant
|
||||
DSetCreatPropList* DSetCreatPropList::DEFAULT_ = 0;
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
///\brief Constant for dataset creation default property
|
||||
// Function: DSetCreatPropList::getConstant
|
||||
// Purpose: Creates a DSetCreatPropList object representing the HDF5
|
||||
// constant H5P_DATASET_CREATE, pointed to by
|
||||
// DSetCreatPropList::DEFAULT_
|
||||
// exception H5::PropListIException
|
||||
// Description
|
||||
// If DSetCreatPropList::DEFAULT_ already points to an allocated
|
||||
// object, throw a PropListIException. This scenario should
|
||||
// not happen.
|
||||
// Programmer Binh-Minh Ribler - 2015
|
||||
//--------------------------------------------------------------------------
|
||||
const DSetCreatPropList DSetCreatPropList::DEFAULT;
|
||||
DSetCreatPropList* DSetCreatPropList::getConstant()
|
||||
{
|
||||
// Tell the C library not to clean up, H5Library::termH5cpp will call
|
||||
// H5close - more dependency if use H5Library::dontAtExit()
|
||||
if (!IdComponent::H5dontAtexit_called)
|
||||
{
|
||||
(void) H5dont_atexit();
|
||||
IdComponent::H5dontAtexit_called = true;
|
||||
}
|
||||
|
||||
// If the constant pointer is not allocated, allocate it. Otherwise,
|
||||
// throw because it shouldn't be.
|
||||
if (DEFAULT_ == 0)
|
||||
DEFAULT_ = new DSetCreatPropList(H5P_DATASET_CREATE);
|
||||
else
|
||||
throw PropListIException("DSetCreatPropList::getConstant", "DSetCreatPropList::getConstant is being invoked on an allocated DEFAULT_");
|
||||
return(DEFAULT_);
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: DSetCreatPropList::deleteConstants
|
||||
// Purpose: Deletes the constant object that DSetCreatPropList::DEFAULT_
|
||||
// points to.
|
||||
// Programmer Binh-Minh Ribler - 2015
|
||||
//--------------------------------------------------------------------------
|
||||
void DSetCreatPropList::deleteConstants()
|
||||
{
|
||||
if (DEFAULT_ != 0)
|
||||
delete DEFAULT_;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Purpose Constant for dataset creation default property
|
||||
//--------------------------------------------------------------------------
|
||||
const DSetCreatPropList& DSetCreatPropList::DEFAULT = *getConstant();
|
||||
|
||||
#endif // DOXYGEN_SHOULD_SKIP_THIS
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: DSetCreatPropList default constructor
|
||||
|
@ -27,8 +27,8 @@ namespace H5 {
|
||||
*/
|
||||
class H5_DLLCPP DSetCreatPropList : public PropList {
|
||||
public:
|
||||
// Default dataset creation property list.
|
||||
static const DSetCreatPropList DEFAULT;
|
||||
///\brief Default dataset creation property list.
|
||||
static const DSetCreatPropList& DEFAULT;
|
||||
|
||||
// Creates a dataset creation property list.
|
||||
DSetCreatPropList();
|
||||
@ -123,6 +123,19 @@ class H5_DLLCPP DSetCreatPropList : public PropList {
|
||||
|
||||
// Noop destructor.
|
||||
virtual ~DSetCreatPropList();
|
||||
|
||||
#ifndef DOXYGEN_SHOULD_SKIP_THIS
|
||||
|
||||
// Deletes the global constant, should only be used by the library
|
||||
static void deleteConstants();
|
||||
|
||||
private:
|
||||
static DSetCreatPropList* DEFAULT_;
|
||||
|
||||
// Creates the global constant, should only be used by the library
|
||||
static DSetCreatPropList* getConstant();
|
||||
|
||||
#endif // DOXYGEN_SHOULD_SKIP_THIS
|
||||
};
|
||||
#ifndef H5_NO_NAMESPACE
|
||||
}
|
||||
|
@ -22,24 +22,67 @@
|
||||
#include "H5DxferProp.h"
|
||||
#include "H5private.h" // for HDmemset
|
||||
|
||||
#include <iostream>
|
||||
|
||||
#ifndef H5_NO_NAMESPACE
|
||||
#ifndef H5_NO_STD
|
||||
using std::cerr;
|
||||
using std::endl;
|
||||
#endif // H5_NO_STD
|
||||
#endif
|
||||
|
||||
|
||||
#ifndef H5_NO_NAMESPACE
|
||||
namespace H5 {
|
||||
#endif
|
||||
|
||||
#ifndef DOXYGEN_SHOULD_SKIP_THIS
|
||||
// This DOXYGEN_SHOULD_SKIP_THIS block is a work-around approach to control
|
||||
// the order of creation and deletion of the global constants. See Design Notes
|
||||
// in "H5PredType.cpp" for information.
|
||||
|
||||
// Initialize a pointer for the constant
|
||||
DSetMemXferPropList* DSetMemXferPropList::DEFAULT_ = 0;
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
///\brief Constant for default dataset memory and transfer property list.
|
||||
// Function: DSetMemXferPropList::getConstant
|
||||
// Creates a DSetMemXferPropList object representing the HDF5
|
||||
// constant H5P_DATASET_XFER, pointed to by
|
||||
// DSetMemXferPropList::DEFAULT_
|
||||
// exception H5::PropListIException
|
||||
// Description
|
||||
// If DSetMemXferPropList::DEFAULT_ already points to an allocated
|
||||
// object, throw a PropListIException. This scenario should not
|
||||
// happen.
|
||||
// Programmer Binh-Minh Ribler - 2015
|
||||
//--------------------------------------------------------------------------
|
||||
const DSetMemXferPropList DSetMemXferPropList::DEFAULT;
|
||||
DSetMemXferPropList* DSetMemXferPropList::getConstant()
|
||||
{
|
||||
// Tell the C library not to clean up, H5Library::termH5cpp will call
|
||||
// H5close - more dependency if use H5Library::dontAtExit()
|
||||
if (!IdComponent::H5dontAtexit_called)
|
||||
{
|
||||
(void) H5dont_atexit();
|
||||
IdComponent::H5dontAtexit_called = true;
|
||||
}
|
||||
|
||||
// If the constant pointer is not allocated, allocate it. Otherwise,
|
||||
// throw because it shouldn't be.
|
||||
if (DEFAULT_ == 0)
|
||||
DEFAULT_ = new DSetMemXferPropList(H5P_DATASET_XFER);
|
||||
else
|
||||
throw PropListIException("DSetMemXferPropList::getConstant", "DSetMemXferPropList::getConstant is being invoked on an allocated DEFAULT_");
|
||||
return(DEFAULT_);
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: DSetMemXferPropList::deleteConstants
|
||||
// Purpose: Deletes the constant object that DSetMemXferPropList::DEFAULT_
|
||||
// points to.
|
||||
// Programmer Binh-Minh Ribler - 2015
|
||||
//--------------------------------------------------------------------------
|
||||
void DSetMemXferPropList::deleteConstants()
|
||||
{
|
||||
if (DEFAULT_ != 0)
|
||||
delete DEFAULT_;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Purpose Constant for default dataset memory and transfer property list.
|
||||
//--------------------------------------------------------------------------
|
||||
const DSetMemXferPropList& DSetMemXferPropList::DEFAULT = *getConstant();
|
||||
|
||||
#endif // DOXYGEN_SHOULD_SKIP_THIS
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Function DSetMemXferPropList default constructor
|
||||
|
@ -27,7 +27,8 @@ namespace H5 {
|
||||
*/
|
||||
class H5_DLLCPP DSetMemXferPropList : public PropList {
|
||||
public:
|
||||
static const DSetMemXferPropList DEFAULT;
|
||||
///\brief Default dataset memory and transfer property list.
|
||||
static const DSetMemXferPropList& DEFAULT;
|
||||
|
||||
// Creates a dataset memory and transfer property list.
|
||||
DSetMemXferPropList();
|
||||
@ -113,6 +114,19 @@ class H5_DLLCPP DSetMemXferPropList : public PropList {
|
||||
|
||||
// Noop destructor
|
||||
virtual ~DSetMemXferPropList();
|
||||
|
||||
#ifndef DOXYGEN_SHOULD_SKIP_THIS
|
||||
|
||||
// Deletes the global constant, should only be used by the library
|
||||
static void deleteConstants();
|
||||
|
||||
private:
|
||||
static DSetMemXferPropList* DEFAULT_;
|
||||
|
||||
// Creates the global constant, should only be used by the library
|
||||
static DSetMemXferPropList* getConstant();
|
||||
|
||||
#endif // DOXYGEN_SHOULD_SKIP_THIS
|
||||
};
|
||||
#ifndef H5_NO_NAMESPACE
|
||||
}
|
||||
|
@ -25,10 +25,63 @@
|
||||
namespace H5 {
|
||||
#endif
|
||||
|
||||
#ifndef DOXYGEN_SHOULD_SKIP_THIS
|
||||
// This DOXYGEN_SHOULD_SKIP_THIS block is a work-around approach to control
|
||||
// the order of creation and deletion of the global constants. See Design Notes
|
||||
// in "H5PredType.cpp" for information.
|
||||
|
||||
// Initialize a pointer for the constant
|
||||
FileAccPropList* FileAccPropList::DEFAULT_ = 0;
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
///\brief Constant for default property
|
||||
// Function: FileAccPropList::getConstant
|
||||
// Creates a FileAccPropList object representing the HDF5 constant
|
||||
// H5P_FILE_ACCESS, pointed to by FileAccPropList::DEFAULT_
|
||||
// exception H5::PropListIException
|
||||
// Description
|
||||
// If FileAccPropList::DEFAULT_ already points to an allocated
|
||||
// object, throw a PropListIException. This scenario should not
|
||||
// happen.
|
||||
// Programmer Binh-Minh Ribler - 2015
|
||||
//--------------------------------------------------------------------------
|
||||
const FileAccPropList FileAccPropList::DEFAULT;
|
||||
FileAccPropList* FileAccPropList::getConstant()
|
||||
{
|
||||
// Tell the C library not to clean up, H5Library::termH5cpp will call
|
||||
// H5close - more dependency if use H5Library::dontAtExit()
|
||||
if (!IdComponent::H5dontAtexit_called)
|
||||
{
|
||||
(void) H5dont_atexit();
|
||||
IdComponent::H5dontAtexit_called = true;
|
||||
}
|
||||
|
||||
// If the constant pointer is not allocated, allocate it. Otherwise,
|
||||
// throw because it shouldn't be.
|
||||
if (DEFAULT_ == 0)
|
||||
DEFAULT_ = new FileAccPropList(H5P_FILE_ACCESS);
|
||||
else
|
||||
throw PropListIException("FileAccPropList::getConstant", "FileAccPropList::getConstant is being invoked on an allocated DEFAULT_");
|
||||
return(DEFAULT_);
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: FileAccPropList::deleteConstants
|
||||
// Purpose: Deletes the constant object that FileAccPropList::DEFAULT_
|
||||
// points to.
|
||||
// exception H5::PropListIException
|
||||
// Programmer Binh-Minh Ribler - 2015
|
||||
//--------------------------------------------------------------------------
|
||||
void FileAccPropList::deleteConstants()
|
||||
{
|
||||
if (DEFAULT_ != 0)
|
||||
delete DEFAULT_;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Purpose: Constant for default property
|
||||
//--------------------------------------------------------------------------
|
||||
const FileAccPropList& FileAccPropList::DEFAULT = *getConstant();
|
||||
|
||||
#endif // DOXYGEN_SHOULD_SKIP_THIS
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: Default Constructor
|
||||
|
@ -24,7 +24,8 @@ namespace H5 {
|
||||
//! Class FileAccPropList represents the HDF5 file access property list.
|
||||
class H5_DLLCPP FileAccPropList : public PropList {
|
||||
public:
|
||||
static const FileAccPropList DEFAULT;
|
||||
///\brief Default file access property list.
|
||||
static const FileAccPropList& DEFAULT;
|
||||
|
||||
// Creates a file access property list.
|
||||
FileAccPropList();
|
||||
@ -145,6 +146,20 @@ class H5_DLLCPP FileAccPropList : public PropList {
|
||||
|
||||
// Noop destructor
|
||||
virtual ~FileAccPropList();
|
||||
|
||||
#ifndef DOXYGEN_SHOULD_SKIP_THIS
|
||||
|
||||
// Deletes the global constant, should only be used by the library
|
||||
static void deleteConstants();
|
||||
|
||||
private:
|
||||
static FileAccPropList* DEFAULT_;
|
||||
|
||||
// Creates the global constant, should only be used by the library
|
||||
static FileAccPropList* getConstant();
|
||||
|
||||
#endif // DOXYGEN_SHOULD_SKIP_THIS
|
||||
|
||||
};
|
||||
#ifndef H5_NO_NAMESPACE
|
||||
}
|
||||
|
@ -25,10 +25,61 @@
|
||||
namespace H5 {
|
||||
#endif
|
||||
|
||||
#ifndef DOXYGEN_SHOULD_SKIP_THIS
|
||||
// This DOXYGEN_SHOULD_SKIP_THIS block is a work-around approach to control
|
||||
// the order of creation and deletion of the global constants. See Design Notes
|
||||
// in "H5PredType.cpp" for information.
|
||||
|
||||
// Initialize a pointer for the constant
|
||||
FileCreatPropList* FileCreatPropList::DEFAULT_ = 0;
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
///\brief Constant for default property
|
||||
// Function: FileCreatPropList::getConstant
|
||||
// Purpose: Creates a FileCreatPropList object representing the HDF5
|
||||
// constant H5P_FILE_ACCESS, pointed to by FileCreatPropList::DEFAULT_
|
||||
// exception H5::PropListIException
|
||||
// Description
|
||||
// If FileCreatPropList::DEFAULT_ already points to an allocated
|
||||
// object, throw a PropListIException. This scenario should not happen.
|
||||
// Programmer Binh-Minh Ribler - 2015
|
||||
//--------------------------------------------------------------------------
|
||||
const FileCreatPropList FileCreatPropList::DEFAULT;
|
||||
FileCreatPropList* FileCreatPropList::getConstant()
|
||||
{
|
||||
// Tell the C library not to clean up, H5Library::termH5cpp will call
|
||||
// H5close - more dependency if use H5Library::dontAtExit()
|
||||
if (!IdComponent::H5dontAtexit_called)
|
||||
{
|
||||
(void) H5dont_atexit();
|
||||
IdComponent::H5dontAtexit_called = true;
|
||||
}
|
||||
|
||||
// If the constant pointer is not allocated, allocate it. Otherwise,
|
||||
// throw because it shouldn't be.
|
||||
if (DEFAULT_ == 0)
|
||||
DEFAULT_ = new FileCreatPropList(H5P_FILE_CREATE);
|
||||
else
|
||||
throw PropListIException("FileCreatPropList::getConstant", "FileCreatPropList::getConstant is being invoked on an allocated DEFAULT_");
|
||||
return(DEFAULT_);
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: FileCreatPropList::deleteConstants
|
||||
// Purpose: Deletes the constant object that FileCreatPropList::DEFAULT_
|
||||
// points to.
|
||||
// Programmer Binh-Minh Ribler - 2015
|
||||
//--------------------------------------------------------------------------
|
||||
void FileCreatPropList::deleteConstants()
|
||||
{
|
||||
if (DEFAULT_ != 0)
|
||||
delete DEFAULT_;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Purpose Constant for default property
|
||||
//--------------------------------------------------------------------------
|
||||
const FileCreatPropList& FileCreatPropList::DEFAULT = *getConstant();
|
||||
|
||||
#endif // DOXYGEN_SHOULD_SKIP_THIS
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: FileCreatPropList default constructor
|
||||
|
@ -24,8 +24,8 @@ namespace H5 {
|
||||
//! Class FileCreatPropList represents the HDF5 file create property list.
|
||||
class H5_DLLCPP FileCreatPropList : public PropList {
|
||||
public:
|
||||
// Default file creation property list.
|
||||
static const FileCreatPropList DEFAULT;
|
||||
///\brief Default file creation property list.
|
||||
static const FileCreatPropList& DEFAULT;
|
||||
|
||||
// Creates a file create property list.
|
||||
FileCreatPropList();
|
||||
@ -74,6 +74,20 @@ class H5_DLLCPP FileCreatPropList : public PropList {
|
||||
|
||||
// Noop destructor
|
||||
virtual ~FileCreatPropList();
|
||||
|
||||
#ifndef DOXYGEN_SHOULD_SKIP_THIS
|
||||
|
||||
// Deletes the global constant, should only be used by the library
|
||||
static void deleteConstants();
|
||||
|
||||
private:
|
||||
static FileCreatPropList* DEFAULT_;
|
||||
|
||||
// Creates the global constant, should only be used by the library
|
||||
static FileCreatPropList* getConstant();
|
||||
|
||||
#endif // DOXYGEN_SHOULD_SKIP_THIS
|
||||
|
||||
};
|
||||
#ifndef H5_NO_NAMESPACE
|
||||
}
|
||||
|
@ -13,11 +13,6 @@
|
||||
* access to either file, you may request a copy from help@hdfgroup.org. *
|
||||
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
|
||||
|
||||
#ifdef OLD_HEADER_FILENAME
|
||||
#include <iostream.h>
|
||||
#else
|
||||
#include <iostream>
|
||||
#endif
|
||||
#include <string>
|
||||
|
||||
#include "H5Include.h"
|
||||
@ -31,11 +26,16 @@
|
||||
namespace H5 {
|
||||
#endif
|
||||
|
||||
// This flag controls whether H5Library::initH5cpp has been called to register
|
||||
// terminating functions with atexit()
|
||||
bool IdComponent::H5cppinit = false;
|
||||
bool IdComponent::H5dontAtexit_called = false;
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: IdComponent overloaded constructor
|
||||
///\brief Creates an IdComponent object using the id of an existing object.
|
||||
///\param h5_id - IN: Id of an existing object
|
||||
///\exception H5::DataTypeIException
|
||||
// Purpose Creates an IdComponent object using the id of an existing object.
|
||||
// Param h5_id - IN: Id of an existing object
|
||||
// Exception H5::DataTypeIException
|
||||
// Programmer Binh-Minh Ribler - 2000
|
||||
//
|
||||
// *** Deprecation warning ***
|
||||
@ -43,14 +43,10 @@ namespace H5 {
|
||||
// been moved to the sub-classes. It will be removed in 1.10 release. If its
|
||||
// removal does not raise any problems in 1.10, it will be removed from 1.8 in
|
||||
// subsequent releases.
|
||||
// - Removed from documentation in 1.8.16 -BMR (October 2015)
|
||||
//--------------------------------------------------------------------------
|
||||
IdComponent::IdComponent(const hid_t h5_id) {}
|
||||
|
||||
//void IdComponent::p_setId(const hid_t new_id)
|
||||
//{
|
||||
//p_setId(new_id);
|
||||
//}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: IdComponent copy constructor
|
||||
// Purpose: This noop copy constructor is removed as a result of the data
|
||||
@ -296,7 +292,16 @@ H5std_string IdComponent::inMemFunc(const char* func_name) const
|
||||
///\brief Default constructor.
|
||||
// Programmer Binh-Minh Ribler - 2000
|
||||
//--------------------------------------------------------------------------
|
||||
IdComponent::IdComponent() {}
|
||||
IdComponent::IdComponent()
|
||||
{
|
||||
// initH5cpp will register the terminating functions with atexit().
|
||||
// We only do this once.
|
||||
if (!H5cppinit)
|
||||
{
|
||||
H5Library::getInstance()->initH5cpp();
|
||||
H5cppinit = true;
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: IdComponent::p_get_file_name (protected)
|
||||
|
@ -31,6 +31,12 @@ class DataSpace;
|
||||
*/
|
||||
class H5_DLLCPP IdComponent {
|
||||
public:
|
||||
|
||||
#ifndef DOXYGEN_SHOULD_SKIP_THIS
|
||||
static bool H5cppinit;
|
||||
static bool H5dontAtexit_called;
|
||||
#endif // DOXYGEN_SHOULD_SKIP_THIS
|
||||
|
||||
// Increment reference counter.
|
||||
void incRefCount(const hid_t obj_id) const;
|
||||
void incRefCount() const;
|
||||
|
@ -14,10 +14,22 @@
|
||||
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
|
||||
|
||||
#include <string>
|
||||
#include <cstdlib>
|
||||
|
||||
#include "H5CppDoc.h" // included only for Doxygen to generate part of RM
|
||||
#include "H5CppDoc.h" // included only for Doxygen to generate part of RM
|
||||
#include "H5Include.h"
|
||||
#include "H5Exception.h"
|
||||
#include "H5IdComponent.h"
|
||||
#include "H5PropList.h"
|
||||
#include "H5FaccProp.h"
|
||||
#include "H5FcreatProp.h"
|
||||
#include "H5DxferProp.h"
|
||||
#include "H5Object.h"
|
||||
#include "H5DataType.h"
|
||||
#include "H5DcreatProp.h"
|
||||
#include "H5AtomType.h"
|
||||
#include "H5PredType.h"
|
||||
#include "H5DataSpace.h"
|
||||
#include "H5Library.h"
|
||||
|
||||
#ifndef H5_NO_NAMESPACE
|
||||
@ -25,8 +37,7 @@ namespace H5 {
|
||||
#endif
|
||||
|
||||
#ifndef DOXYGEN_SHOULD_SKIP_THIS
|
||||
// This static variable will be set to true when dontAtExit is called
|
||||
bool H5Library::need_cleanup = false;
|
||||
H5Library* H5Library::instance = 0;
|
||||
#endif // DOXYGEN_SHOULD_SKIP_THIS
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
@ -63,18 +74,17 @@ void H5Library::close()
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: H5Library::dontAtExit
|
||||
///\brief Instructs library not to install \c atexit cleanup routine
|
||||
///\brief Instructs library not to install the C \c atexit cleanup routine
|
||||
///
|
||||
///\exception H5::LibraryIException
|
||||
// Programmer Binh-Minh Ribler - 2000
|
||||
// Modification
|
||||
// Removed the check for failure returned from H5dont_atexit.
|
||||
// will be fixed to not fail (HDFFV-9540)
|
||||
//--------------------------------------------------------------------------
|
||||
void H5Library::dontAtExit()
|
||||
{
|
||||
herr_t ret_value = H5dont_atexit();
|
||||
if( ret_value < 0 )
|
||||
{
|
||||
throw LibraryIException("H5Library::dontAtExit", "H5dont_atexit failed");
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
@ -147,6 +157,91 @@ void H5Library::garbageCollect()
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: H5Library::initH5cpp
|
||||
///\brief Initializes C++ library and registers terminating functions at
|
||||
/// exit. Only for the library functions, not for user-defined
|
||||
/// functions.
|
||||
// Description
|
||||
// initH5cpp registers the following functions with std::atexit():
|
||||
// termH5cpp() - calls H5close() after all cleanup in
|
||||
// the C++ library is done
|
||||
// <classname>::deleteConstants - deletes all references for
|
||||
// <classname> global constants
|
||||
///\exception H5::LibraryIException
|
||||
//
|
||||
// Programmer Binh-Minh Ribler - September, 2015
|
||||
//--------------------------------------------------------------------------
|
||||
void H5Library::initH5cpp()
|
||||
{
|
||||
// Register terminating functions with atexit(); they will be invoked in the
|
||||
// reversed order
|
||||
int ret_value = 0;
|
||||
ret_value = std::atexit(termH5cpp);
|
||||
if (ret_value != 0)
|
||||
throw LibraryIException("H5Library::initH5cpp", "Registration of termH5cpp failed");
|
||||
|
||||
ret_value = std::atexit(PredType::deleteConstants);
|
||||
if (ret_value != 0)
|
||||
throw LibraryIException("H5Library::initH5cpp", "Registration of PredType::deleteConstants failed");
|
||||
|
||||
ret_value = std::atexit(PropList::deleteConstants);
|
||||
if (ret_value != 0)
|
||||
throw LibraryIException("H5Library::initH5cpp", "Registration of PropList::deleteConstants failed");
|
||||
|
||||
ret_value = std::atexit(FileAccPropList::deleteConstants);
|
||||
if (ret_value != 0)
|
||||
throw LibraryIException("H5Library::initH5cpp", "Registration of FileAccPropList::deleteConstants failed");
|
||||
|
||||
ret_value = std::atexit(FileCreatPropList::deleteConstants);
|
||||
if (ret_value != 0)
|
||||
throw LibraryIException("H5Library::initH5cpp", "Registration of FileCreatPropList::deleteConstants failed");
|
||||
|
||||
ret_value = std::atexit(DSetMemXferPropList::deleteConstants);
|
||||
if (ret_value != 0)
|
||||
throw LibraryIException("H5Library::initH5cpp", "Registration of DSetMemXferPropList::deleteConstants failed");
|
||||
|
||||
ret_value = std::atexit(DSetCreatPropList::deleteConstants);
|
||||
if (ret_value != 0)
|
||||
throw LibraryIException("H5Library::initH5cpp", "Registration of DSetCreatPropList::deleteConstants failed");
|
||||
|
||||
ret_value = std::atexit(DataSpace::deleteConstants);
|
||||
if (ret_value != 0)
|
||||
throw LibraryIException("H5Library::initH5cpp", "Registration of DataSpace::deleteConstants failed");
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: H5Library::termH5cpp
|
||||
///\brief Sends request for the C layer to terminate.
|
||||
///\par Description
|
||||
/// If the C library fails to terminate, exit with a failure.
|
||||
// Programmer Binh-Minh Ribler - September, 2015
|
||||
//--------------------------------------------------------------------------
|
||||
void H5Library::termH5cpp()
|
||||
{
|
||||
// Close the C library
|
||||
herr_t ret_value = H5close();
|
||||
if (ret_value == -1)
|
||||
exit(-1);
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: H5Library::getInstance
|
||||
///\brief Provides a way to instantiate the class.
|
||||
///\par Description
|
||||
/// getInstance ensures that only one instance of the H5Library
|
||||
/// is created.
|
||||
// Programmer Binh-Minh Ribler - September, 2015
|
||||
//--------------------------------------------------------------------------
|
||||
H5Library* H5Library::getInstance()
|
||||
{
|
||||
if (H5Library::instance == 0)
|
||||
{
|
||||
instance = new H5Library();
|
||||
}
|
||||
return(instance);
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: H5Library::setFreeListLimits
|
||||
///\brief Sets limits on the different kinds of free lists.
|
||||
@ -174,6 +269,13 @@ void H5Library::setFreeListLimits(int reg_global_lim, int reg_list_lim,
|
||||
throw LibraryIException("H5Library::setFreeListLimits", "H5set_free_list_limits failed");
|
||||
}
|
||||
}
|
||||
|
||||
// Default constructor - no instance ever created by outsiders
|
||||
H5Library::H5Library(){};
|
||||
|
||||
// Destructor
|
||||
H5Library::~H5Library(){};
|
||||
|
||||
#ifndef H5_NO_NAMESPACE
|
||||
} // end namespace
|
||||
#endif
|
||||
|
@ -21,14 +21,6 @@
|
||||
namespace H5 {
|
||||
#endif
|
||||
|
||||
#ifndef DOXYGEN_SHOULD_SKIP_THIS
|
||||
#define NOTATEXIT (-10) // just in case the HDF5 library use more
|
||||
// negative constants. Note: the solution used for the atexit/global
|
||||
// destructors is not reliable, and desperately needs improvement
|
||||
// It is not even working, inifiteloop message still printed when
|
||||
// calling H5close
|
||||
#endif // DOXYGEN_SHOULD_SKIP_THIS
|
||||
|
||||
/*! \class H5Library
|
||||
\brief Class H5Library operates the HDF5 library globably.
|
||||
|
||||
@ -37,10 +29,6 @@ namespace H5 {
|
||||
*/
|
||||
class H5_DLLCPP H5Library {
|
||||
public:
|
||||
#ifndef DOXYGEN_SHOULD_SKIP_THIS
|
||||
static bool need_cleanup; // indicates if H5close should be called
|
||||
#endif // DOXYGEN_SHOULD_SKIP_THIS
|
||||
|
||||
// Initializes the HDF5 library.
|
||||
static void open();
|
||||
|
||||
@ -65,9 +53,28 @@ class H5_DLLCPP H5Library {
|
||||
static void setFreeListLimits(int reg_global_lim, int reg_list_lim, int
|
||||
arr_global_lim, int arr_list_lim, int blk_global_lim, int blk_list_lim);
|
||||
|
||||
// Initializes C++ library and registers terminating functions at exit.
|
||||
// Only for the library functions, not for user-defined functions.
|
||||
static void initH5cpp(void);
|
||||
|
||||
// Sends request for terminating the HDF5 library.
|
||||
static void termH5cpp(void);
|
||||
|
||||
static H5Library* getInstance();
|
||||
|
||||
#ifndef DOXYGEN_SHOULD_SKIP_THIS
|
||||
|
||||
private:
|
||||
// Default constructor - no instance ever created
|
||||
H5Library() {};
|
||||
|
||||
// private instance to be created by H5Library only
|
||||
static H5Library* instance;
|
||||
|
||||
// Default constructor - no instance ever created from outsiders
|
||||
H5Library();
|
||||
|
||||
// Destructor
|
||||
~H5Library();
|
||||
#endif // DOXYGEN_SHOULD_SKIP_THIS
|
||||
|
||||
};
|
||||
#ifndef H5_NO_NAMESPACE
|
||||
|
@ -33,9 +33,6 @@
|
||||
#include "H5DataSet.h"
|
||||
#include "H5Attribute.h"
|
||||
#include "H5private.h" // for HDmemset
|
||||
#include <iostream>
|
||||
using namespace std;
|
||||
|
||||
|
||||
#ifndef H5_NO_NAMESPACE
|
||||
namespace H5 {
|
||||
@ -951,7 +948,7 @@ H5Location::~H5Location() {}
|
||||
//--------------------------------------------------------------------------
|
||||
void f_Attribute_setId(Attribute* attr, hid_t new_id)
|
||||
{
|
||||
attr->id = new_id;
|
||||
attr->p_setId(new_id);
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
@ -966,7 +963,7 @@ void f_Attribute_setId(Attribute* attr, hid_t new_id)
|
||||
//--------------------------------------------------------------------------
|
||||
void f_DataSpace_setId(DataSpace* dspace, hid_t new_id)
|
||||
{
|
||||
dspace->id = new_id;
|
||||
dspace->p_setId(new_id);
|
||||
}
|
||||
|
||||
#endif // DOXYGEN_SHOULD_SKIP_THIS
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -21,16 +21,6 @@
|
||||
namespace H5 {
|
||||
#endif
|
||||
|
||||
/* This constant is defined for a workaround to eliminate memory leaks due to
|
||||
the library being re-initiated when PredType destructors are invoked. A
|
||||
PredType instant with H5CPP_EXITED as the value of its "id" is constructed
|
||||
before the other PredType objects are created. At exit, when this special
|
||||
PredType object is to be destructed, no HDF5 library function will be called
|
||||
and the library will be terminated. -BMR, Mar 30, 2012 */
|
||||
#ifndef DOXYGEN_SHOULD_SKIP_THIS
|
||||
#define H5CPP_EXITED -3 // -3 is less likely to be used elsewhere
|
||||
#endif // DOXYGEN_SHOULD_SKIP_THIS
|
||||
|
||||
/*! \class PredType
|
||||
\brief Class PredType holds the definition of all the HDF5 predefined
|
||||
datatypes.
|
||||
@ -53,183 +43,6 @@ class H5_DLLCPP PredType : public AtomType {
|
||||
// Noop destructor
|
||||
virtual ~PredType();
|
||||
|
||||
// Declaration of predefined types; their definition is in H5PredType.cpp
|
||||
static const PredType STD_I8BE;
|
||||
static const PredType STD_I8LE;
|
||||
static const PredType STD_I16BE;
|
||||
static const PredType STD_I16LE;
|
||||
static const PredType STD_I32BE;
|
||||
static const PredType STD_I32LE;
|
||||
static const PredType STD_I64BE;
|
||||
static const PredType STD_I64LE;
|
||||
static const PredType STD_U8BE;
|
||||
static const PredType STD_U8LE;
|
||||
static const PredType STD_U16BE;
|
||||
static const PredType STD_U16LE;
|
||||
static const PredType STD_U32BE;
|
||||
static const PredType STD_U32LE;
|
||||
static const PredType STD_U64BE;
|
||||
static const PredType STD_U64LE;
|
||||
static const PredType STD_B8BE;
|
||||
static const PredType STD_B8LE;
|
||||
static const PredType STD_B16BE;
|
||||
static const PredType STD_B16LE;
|
||||
static const PredType STD_B32BE;
|
||||
static const PredType STD_B32LE;
|
||||
static const PredType STD_B64BE;
|
||||
static const PredType STD_B64LE;
|
||||
static const PredType STD_REF_OBJ;
|
||||
static const PredType STD_REF_DSETREG;
|
||||
|
||||
static const PredType C_S1;
|
||||
static const PredType FORTRAN_S1;
|
||||
|
||||
static const PredType IEEE_F32BE;
|
||||
static const PredType IEEE_F32LE;
|
||||
static const PredType IEEE_F64BE;
|
||||
static const PredType IEEE_F64LE;
|
||||
|
||||
static const PredType UNIX_D32BE;
|
||||
static const PredType UNIX_D32LE;
|
||||
static const PredType UNIX_D64BE;
|
||||
static const PredType UNIX_D64LE;
|
||||
|
||||
static const PredType INTEL_I8;
|
||||
static const PredType INTEL_I16;
|
||||
static const PredType INTEL_I32;
|
||||
static const PredType INTEL_I64;
|
||||
static const PredType INTEL_U8;
|
||||
static const PredType INTEL_U16;
|
||||
static const PredType INTEL_U32;
|
||||
static const PredType INTEL_U64;
|
||||
static const PredType INTEL_B8;
|
||||
static const PredType INTEL_B16;
|
||||
static const PredType INTEL_B32;
|
||||
static const PredType INTEL_B64;
|
||||
static const PredType INTEL_F32;
|
||||
static const PredType INTEL_F64;
|
||||
|
||||
static const PredType ALPHA_I8;
|
||||
static const PredType ALPHA_I16;
|
||||
static const PredType ALPHA_I32;
|
||||
static const PredType ALPHA_I64;
|
||||
static const PredType ALPHA_U8;
|
||||
static const PredType ALPHA_U16;
|
||||
static const PredType ALPHA_U32;
|
||||
static const PredType ALPHA_U64;
|
||||
static const PredType ALPHA_B8;
|
||||
static const PredType ALPHA_B16;
|
||||
static const PredType ALPHA_B32;
|
||||
static const PredType ALPHA_B64;
|
||||
static const PredType ALPHA_F32;
|
||||
static const PredType ALPHA_F64;
|
||||
|
||||
static const PredType MIPS_I8;
|
||||
static const PredType MIPS_I16;
|
||||
static const PredType MIPS_I32;
|
||||
static const PredType MIPS_I64;
|
||||
static const PredType MIPS_U8;
|
||||
static const PredType MIPS_U16;
|
||||
static const PredType MIPS_U32;
|
||||
static const PredType MIPS_U64;
|
||||
static const PredType MIPS_B8;
|
||||
static const PredType MIPS_B16;
|
||||
static const PredType MIPS_B32;
|
||||
static const PredType MIPS_B64;
|
||||
static const PredType MIPS_F32;
|
||||
static const PredType MIPS_F64;
|
||||
|
||||
static const PredType NATIVE_CHAR;
|
||||
static const PredType NATIVE_SCHAR;
|
||||
static const PredType NATIVE_UCHAR;
|
||||
static const PredType NATIVE_SHORT;
|
||||
static const PredType NATIVE_USHORT;
|
||||
static const PredType NATIVE_INT;
|
||||
static const PredType NATIVE_UINT;
|
||||
static const PredType NATIVE_LONG;
|
||||
static const PredType NATIVE_ULONG;
|
||||
static const PredType NATIVE_LLONG;
|
||||
static const PredType NATIVE_ULLONG;
|
||||
static const PredType NATIVE_FLOAT;
|
||||
static const PredType NATIVE_DOUBLE;
|
||||
static const PredType NATIVE_LDOUBLE;
|
||||
static const PredType NATIVE_B8;
|
||||
static const PredType NATIVE_B16;
|
||||
static const PredType NATIVE_B32;
|
||||
static const PredType NATIVE_B64;
|
||||
static const PredType NATIVE_OPAQUE;
|
||||
static const PredType NATIVE_HSIZE;
|
||||
static const PredType NATIVE_HSSIZE;
|
||||
static const PredType NATIVE_HERR;
|
||||
static const PredType NATIVE_HBOOL;
|
||||
|
||||
static const PredType NATIVE_INT8;
|
||||
static const PredType NATIVE_UINT8;
|
||||
static const PredType NATIVE_INT16;
|
||||
static const PredType NATIVE_UINT16;
|
||||
static const PredType NATIVE_INT32;
|
||||
static const PredType NATIVE_UINT32;
|
||||
static const PredType NATIVE_INT64;
|
||||
static const PredType NATIVE_UINT64;
|
||||
|
||||
// LEAST types
|
||||
#if H5_SIZEOF_INT_LEAST8_T != 0
|
||||
static const PredType NATIVE_INT_LEAST8;
|
||||
#endif /* H5_SIZEOF_INT_LEAST8_T */
|
||||
#if H5_SIZEOF_UINT_LEAST8_T != 0
|
||||
static const PredType NATIVE_UINT_LEAST8;
|
||||
#endif /* H5_SIZEOF_UINT_LEAST8_T */
|
||||
|
||||
#if H5_SIZEOF_INT_LEAST16_T != 0
|
||||
static const PredType NATIVE_INT_LEAST16;
|
||||
#endif /* H5_SIZEOF_INT_LEAST16_T */
|
||||
#if H5_SIZEOF_UINT_LEAST16_T != 0
|
||||
static const PredType NATIVE_UINT_LEAST16;
|
||||
#endif /* H5_SIZEOF_UINT_LEAST16_T */
|
||||
|
||||
#if H5_SIZEOF_INT_LEAST32_T != 0
|
||||
static const PredType NATIVE_INT_LEAST32;
|
||||
#endif /* H5_SIZEOF_INT_LEAST32_T */
|
||||
#if H5_SIZEOF_UINT_LEAST32_T != 0
|
||||
static const PredType NATIVE_UINT_LEAST32;
|
||||
#endif /* H5_SIZEOF_UINT_LEAST32_T */
|
||||
|
||||
#if H5_SIZEOF_INT_LEAST64_T != 0
|
||||
static const PredType NATIVE_INT_LEAST64;
|
||||
#endif /* H5_SIZEOF_INT_LEAST64_T */
|
||||
#if H5_SIZEOF_UINT_LEAST64_T != 0
|
||||
static const PredType NATIVE_UINT_LEAST64;
|
||||
#endif /* H5_SIZEOF_UINT_LEAST64_T */
|
||||
|
||||
// FAST types
|
||||
#if H5_SIZEOF_INT_FAST8_T != 0
|
||||
static const PredType NATIVE_INT_FAST8;
|
||||
#endif /* H5_SIZEOF_INT_FAST8_T */
|
||||
#if H5_SIZEOF_UINT_FAST8_T != 0
|
||||
static const PredType NATIVE_UINT_FAST8;
|
||||
#endif /* H5_SIZEOF_UINT_FAST8_T */
|
||||
|
||||
#if H5_SIZEOF_INT_FAST16_T != 0
|
||||
static const PredType NATIVE_INT_FAST16;
|
||||
#endif /* H5_SIZEOF_INT_FAST16_T */
|
||||
#if H5_SIZEOF_UINT_FAST16_T != 0
|
||||
static const PredType NATIVE_UINT_FAST16;
|
||||
#endif /* H5_SIZEOF_UINT_FAST16_T */
|
||||
|
||||
#if H5_SIZEOF_INT_FAST32_T != 0
|
||||
static const PredType NATIVE_INT_FAST32;
|
||||
#endif /* H5_SIZEOF_INT_FAST32_T */
|
||||
#if H5_SIZEOF_UINT_FAST32_T != 0
|
||||
static const PredType NATIVE_UINT_FAST32;
|
||||
#endif /* H5_SIZEOF_UINT_FAST32_T */
|
||||
|
||||
#if H5_SIZEOF_INT_FAST64_T != 0
|
||||
static const PredType NATIVE_INT_FAST64;
|
||||
#endif /* H5_SIZEOF_INT_FAST64_T */
|
||||
#if H5_SIZEOF_UINT_FAST64_T != 0
|
||||
static const PredType NATIVE_UINT_FAST64;
|
||||
#endif /* H5_SIZEOF_UINT_FAST64_T */
|
||||
|
||||
/*! \brief This dummy function do not inherit from DataType - it will
|
||||
throw a DataTypeIException if invoked.
|
||||
*/
|
||||
@ -243,21 +56,387 @@ class H5_DLLCPP PredType : public AtomType {
|
||||
*/
|
||||
bool committed();
|
||||
|
||||
protected:
|
||||
///\brief PredType constants
|
||||
static const PredType& STD_I8BE;
|
||||
static const PredType& STD_I8LE;
|
||||
static const PredType& STD_I16BE;
|
||||
static const PredType& STD_I16LE;
|
||||
static const PredType& STD_I32BE;
|
||||
static const PredType& STD_I32LE;
|
||||
static const PredType& STD_I64BE;
|
||||
static const PredType& STD_I64LE;
|
||||
static const PredType& STD_U8BE;
|
||||
static const PredType& STD_U8LE;
|
||||
static const PredType& STD_U16BE;
|
||||
static const PredType& STD_U16LE;
|
||||
static const PredType& STD_U32BE;
|
||||
static const PredType& STD_U32LE;
|
||||
static const PredType& STD_U64BE;
|
||||
static const PredType& STD_U64LE;
|
||||
static const PredType& STD_B8BE;
|
||||
static const PredType& STD_B8LE;
|
||||
static const PredType& STD_B16BE;
|
||||
static const PredType& STD_B16LE;
|
||||
static const PredType& STD_B32BE;
|
||||
static const PredType& STD_B32LE;
|
||||
static const PredType& STD_B64BE;
|
||||
static const PredType& STD_B64LE;
|
||||
static const PredType& STD_REF_OBJ;
|
||||
static const PredType& STD_REF_DSETREG;
|
||||
|
||||
static const PredType& C_S1;
|
||||
static const PredType& FORTRAN_S1;
|
||||
|
||||
static const PredType& IEEE_F32BE;
|
||||
static const PredType& IEEE_F32LE;
|
||||
static const PredType& IEEE_F64BE;
|
||||
static const PredType& IEEE_F64LE;
|
||||
|
||||
static const PredType& UNIX_D32BE;
|
||||
static const PredType& UNIX_D32LE;
|
||||
static const PredType& UNIX_D64BE;
|
||||
static const PredType& UNIX_D64LE;
|
||||
|
||||
static const PredType& INTEL_I8;
|
||||
static const PredType& INTEL_I16;
|
||||
static const PredType& INTEL_I32;
|
||||
static const PredType& INTEL_I64;
|
||||
static const PredType& INTEL_U8;
|
||||
static const PredType& INTEL_U16;
|
||||
static const PredType& INTEL_U32;
|
||||
static const PredType& INTEL_U64;
|
||||
static const PredType& INTEL_B8;
|
||||
static const PredType& INTEL_B16;
|
||||
static const PredType& INTEL_B32;
|
||||
static const PredType& INTEL_B64;
|
||||
static const PredType& INTEL_F32;
|
||||
static const PredType& INTEL_F64;
|
||||
|
||||
static const PredType& ALPHA_I8;
|
||||
static const PredType& ALPHA_I16;
|
||||
static const PredType& ALPHA_I32;
|
||||
static const PredType& ALPHA_I64;
|
||||
static const PredType& ALPHA_U8;
|
||||
static const PredType& ALPHA_U16;
|
||||
static const PredType& ALPHA_U32;
|
||||
static const PredType& ALPHA_U64;
|
||||
static const PredType& ALPHA_B8;
|
||||
static const PredType& ALPHA_B16;
|
||||
static const PredType& ALPHA_B32;
|
||||
static const PredType& ALPHA_B64;
|
||||
static const PredType& ALPHA_F32;
|
||||
static const PredType& ALPHA_F64;
|
||||
|
||||
static const PredType& MIPS_I8;
|
||||
static const PredType& MIPS_I16;
|
||||
static const PredType& MIPS_I32;
|
||||
static const PredType& MIPS_I64;
|
||||
static const PredType& MIPS_U8;
|
||||
static const PredType& MIPS_U16;
|
||||
static const PredType& MIPS_U32;
|
||||
static const PredType& MIPS_U64;
|
||||
static const PredType& MIPS_B8;
|
||||
static const PredType& MIPS_B16;
|
||||
static const PredType& MIPS_B32;
|
||||
static const PredType& MIPS_B64;
|
||||
static const PredType& MIPS_F32;
|
||||
static const PredType& MIPS_F64;
|
||||
|
||||
static const PredType& NATIVE_CHAR;
|
||||
static const PredType& NATIVE_SCHAR;
|
||||
static const PredType& NATIVE_UCHAR;
|
||||
static const PredType& NATIVE_SHORT;
|
||||
static const PredType& NATIVE_USHORT;
|
||||
static const PredType& NATIVE_INT;
|
||||
static const PredType& NATIVE_UINT;
|
||||
static const PredType& NATIVE_LONG;
|
||||
static const PredType& NATIVE_ULONG;
|
||||
static const PredType& NATIVE_LLONG;
|
||||
static const PredType& NATIVE_ULLONG;
|
||||
static const PredType& NATIVE_FLOAT;
|
||||
static const PredType& NATIVE_DOUBLE;
|
||||
static const PredType& NATIVE_LDOUBLE;
|
||||
static const PredType& NATIVE_B8;
|
||||
static const PredType& NATIVE_B16;
|
||||
static const PredType& NATIVE_B32;
|
||||
static const PredType& NATIVE_B64;
|
||||
static const PredType& NATIVE_OPAQUE;
|
||||
static const PredType& NATIVE_HSIZE;
|
||||
static const PredType& NATIVE_HSSIZE;
|
||||
static const PredType& NATIVE_HERR;
|
||||
static const PredType& NATIVE_HBOOL;
|
||||
|
||||
static const PredType& NATIVE_INT8;
|
||||
static const PredType& NATIVE_UINT8;
|
||||
static const PredType& NATIVE_INT16;
|
||||
static const PredType& NATIVE_UINT16;
|
||||
static const PredType& NATIVE_INT32;
|
||||
static const PredType& NATIVE_UINT32;
|
||||
static const PredType& NATIVE_INT64;
|
||||
static const PredType& NATIVE_UINT64;
|
||||
|
||||
// LEAST types
|
||||
#if H5_SIZEOF_INT_LEAST8_T != 0
|
||||
static const PredType& NATIVE_INT_LEAST8;
|
||||
#endif /* H5_SIZEOF_INT_LEAST8_T */
|
||||
#if H5_SIZEOF_UINT_LEAST8_T != 0
|
||||
static const PredType& NATIVE_UINT_LEAST8;
|
||||
#endif /* H5_SIZEOF_UINT_LEAST8_T */
|
||||
|
||||
#if H5_SIZEOF_INT_LEAST16_T != 0
|
||||
static const PredType& NATIVE_INT_LEAST16;
|
||||
#endif /* H5_SIZEOF_INT_LEAST16_T */
|
||||
#if H5_SIZEOF_UINT_LEAST16_T != 0
|
||||
static const PredType& NATIVE_UINT_LEAST16;
|
||||
#endif /* H5_SIZEOF_UINT_LEAST16_T */
|
||||
|
||||
#if H5_SIZEOF_INT_LEAST32_T != 0
|
||||
static const PredType& NATIVE_INT_LEAST32;
|
||||
#endif /* H5_SIZEOF_INT_LEAST32_T */
|
||||
#if H5_SIZEOF_UINT_LEAST32_T != 0
|
||||
static const PredType& NATIVE_UINT_LEAST32;
|
||||
#endif /* H5_SIZEOF_UINT_LEAST32_T */
|
||||
|
||||
#if H5_SIZEOF_INT_LEAST64_T != 0
|
||||
static const PredType& NATIVE_INT_LEAST64;
|
||||
#endif /* H5_SIZEOF_INT_LEAST64_T */
|
||||
#if H5_SIZEOF_UINT_LEAST64_T != 0
|
||||
static const PredType& NATIVE_UINT_LEAST64;
|
||||
#endif /* H5_SIZEOF_UINT_LEAST64_T */
|
||||
|
||||
// FAST types
|
||||
#if H5_SIZEOF_INT_FAST8_T != 0
|
||||
static const PredType& NATIVE_INT_FAST8;
|
||||
#endif /* H5_SIZEOF_INT_FAST8_T */
|
||||
#if H5_SIZEOF_UINT_FAST8_T != 0
|
||||
static const PredType& NATIVE_UINT_FAST8;
|
||||
#endif /* H5_SIZEOF_UINT_FAST8_T */
|
||||
|
||||
#if H5_SIZEOF_INT_FAST16_T != 0
|
||||
static const PredType& NATIVE_INT_FAST16;
|
||||
#endif /* H5_SIZEOF_INT_FAST16_T */
|
||||
#if H5_SIZEOF_UINT_FAST16_T != 0
|
||||
static const PredType& NATIVE_UINT_FAST16;
|
||||
#endif /* H5_SIZEOF_UINT_FAST16_T */
|
||||
|
||||
#if H5_SIZEOF_INT_FAST32_T != 0
|
||||
static const PredType& NATIVE_INT_FAST32;
|
||||
#endif /* H5_SIZEOF_INT_FAST32_T */
|
||||
#if H5_SIZEOF_UINT_FAST32_T != 0
|
||||
static const PredType& NATIVE_UINT_FAST32;
|
||||
#endif /* H5_SIZEOF_UINT_FAST32_T */
|
||||
|
||||
#if H5_SIZEOF_INT_FAST64_T != 0
|
||||
static const PredType& NATIVE_INT_FAST64;
|
||||
#endif /* H5_SIZEOF_INT_FAST64_T */
|
||||
#if H5_SIZEOF_UINT_FAST64_T != 0
|
||||
static const PredType& NATIVE_UINT_FAST64;
|
||||
#endif /* H5_SIZEOF_UINT_FAST64_T */
|
||||
|
||||
#ifndef DOXYGEN_SHOULD_SKIP_THIS
|
||||
|
||||
// Deletes the PredType global constants
|
||||
static void deleteConstants();
|
||||
|
||||
// Dummy constant
|
||||
static const PredType& PREDTYPE_CONST; // dummy constant
|
||||
|
||||
protected:
|
||||
// Default constructor
|
||||
PredType();
|
||||
|
||||
// Creates a pre-defined type using an HDF5 pre-defined constant
|
||||
PredType( const hid_t predtype_id ); // used by the library only
|
||||
|
||||
#endif // DOXYGEN_SHOULD_SKIP_THIS
|
||||
|
||||
private:
|
||||
// Added this to work around the atexit/global destructor problem.
|
||||
// It'll help to terminate the library after other PredType instances
|
||||
// are closed. -BMR, Mar 30, 2012
|
||||
static const PredType AtExit;
|
||||
// Activates the creation of the PredType global constants
|
||||
static PredType* getPredTypes();
|
||||
|
||||
// Dynamically allocates PredType global constants
|
||||
static void makePredTypes();
|
||||
|
||||
// Dummy constant
|
||||
static PredType* PREDTYPE_CONST_;
|
||||
|
||||
// Declaration of pointers to constants
|
||||
static PredType* STD_I8BE_;
|
||||
static PredType* STD_I8LE_;
|
||||
static PredType* STD_I16BE_;
|
||||
static PredType* STD_I16LE_;
|
||||
static PredType* STD_I32BE_;
|
||||
static PredType* STD_I32LE_;
|
||||
static PredType* STD_I64BE_;
|
||||
static PredType* STD_I64LE_;
|
||||
static PredType* STD_U8BE_;
|
||||
static PredType* STD_U8LE_;
|
||||
static PredType* STD_U16BE_;
|
||||
static PredType* STD_U16LE_;
|
||||
static PredType* STD_U32BE_;
|
||||
static PredType* STD_U32LE_;
|
||||
static PredType* STD_U64BE_;
|
||||
static PredType* STD_U64LE_;
|
||||
static PredType* STD_B8BE_;
|
||||
static PredType* STD_B8LE_;
|
||||
static PredType* STD_B16BE_;
|
||||
static PredType* STD_B16LE_;
|
||||
static PredType* STD_B32BE_;
|
||||
static PredType* STD_B32LE_;
|
||||
static PredType* STD_B64BE_;
|
||||
static PredType* STD_B64LE_;
|
||||
static PredType* STD_REF_OBJ_;
|
||||
static PredType* STD_REF_DSETREG_;
|
||||
|
||||
static PredType* C_S1_;
|
||||
static PredType* FORTRAN_S1_;
|
||||
|
||||
static PredType* IEEE_F32BE_;
|
||||
static PredType* IEEE_F32LE_;
|
||||
static PredType* IEEE_F64BE_;
|
||||
static PredType* IEEE_F64LE_;
|
||||
|
||||
static PredType* UNIX_D32BE_;
|
||||
static PredType* UNIX_D32LE_;
|
||||
static PredType* UNIX_D64BE_;
|
||||
static PredType* UNIX_D64LE_;
|
||||
|
||||
static PredType* INTEL_I8_;
|
||||
static PredType* INTEL_I16_;
|
||||
static PredType* INTEL_I32_;
|
||||
static PredType* INTEL_I64_;
|
||||
static PredType* INTEL_U8_;
|
||||
static PredType* INTEL_U16_;
|
||||
static PredType* INTEL_U32_;
|
||||
static PredType* INTEL_U64_;
|
||||
static PredType* INTEL_B8_;
|
||||
static PredType* INTEL_B16_;
|
||||
static PredType* INTEL_B32_;
|
||||
static PredType* INTEL_B64_;
|
||||
static PredType* INTEL_F32_;
|
||||
static PredType* INTEL_F64_;
|
||||
|
||||
static PredType* ALPHA_I8_;
|
||||
static PredType* ALPHA_I16_;
|
||||
static PredType* ALPHA_I32_;
|
||||
static PredType* ALPHA_I64_;
|
||||
static PredType* ALPHA_U8_;
|
||||
static PredType* ALPHA_U16_;
|
||||
static PredType* ALPHA_U32_;
|
||||
static PredType* ALPHA_U64_;
|
||||
static PredType* ALPHA_B8_;
|
||||
static PredType* ALPHA_B16_;
|
||||
static PredType* ALPHA_B32_;
|
||||
static PredType* ALPHA_B64_;
|
||||
static PredType* ALPHA_F32_;
|
||||
static PredType* ALPHA_F64_;
|
||||
|
||||
static PredType* MIPS_I8_;
|
||||
static PredType* MIPS_I16_;
|
||||
static PredType* MIPS_I32_;
|
||||
static PredType* MIPS_I64_;
|
||||
static PredType* MIPS_U8_;
|
||||
static PredType* MIPS_U16_;
|
||||
static PredType* MIPS_U32_;
|
||||
static PredType* MIPS_U64_;
|
||||
static PredType* MIPS_B8_;
|
||||
static PredType* MIPS_B16_;
|
||||
static PredType* MIPS_B32_;
|
||||
static PredType* MIPS_B64_;
|
||||
static PredType* MIPS_F32_;
|
||||
static PredType* MIPS_F64_;
|
||||
|
||||
static PredType* NATIVE_CHAR_;
|
||||
static PredType* NATIVE_SCHAR_;
|
||||
static PredType* NATIVE_UCHAR_;
|
||||
static PredType* NATIVE_SHORT_;
|
||||
static PredType* NATIVE_USHORT_;
|
||||
static PredType* NATIVE_INT_;
|
||||
static PredType* NATIVE_UINT_;
|
||||
static PredType* NATIVE_LONG_;
|
||||
static PredType* NATIVE_ULONG_;
|
||||
static PredType* NATIVE_LLONG_;
|
||||
static PredType* NATIVE_ULLONG_;
|
||||
static PredType* NATIVE_FLOAT_;
|
||||
static PredType* NATIVE_DOUBLE_;
|
||||
static PredType* NATIVE_LDOUBLE_;
|
||||
static PredType* NATIVE_B8_;
|
||||
static PredType* NATIVE_B16_;
|
||||
static PredType* NATIVE_B32_;
|
||||
static PredType* NATIVE_B64_;
|
||||
static PredType* NATIVE_OPAQUE_;
|
||||
static PredType* NATIVE_HSIZE_;
|
||||
static PredType* NATIVE_HSSIZE_;
|
||||
static PredType* NATIVE_HERR_;
|
||||
static PredType* NATIVE_HBOOL_;
|
||||
|
||||
static PredType* NATIVE_INT8_;
|
||||
static PredType* NATIVE_UINT8_;
|
||||
static PredType* NATIVE_INT16_;
|
||||
static PredType* NATIVE_UINT16_;
|
||||
static PredType* NATIVE_INT32_;
|
||||
static PredType* NATIVE_UINT32_;
|
||||
static PredType* NATIVE_INT64_;
|
||||
static PredType* NATIVE_UINT64_;
|
||||
|
||||
// LEAST types
|
||||
#if H5_SIZEOF_INT_LEAST8_T != 0
|
||||
static PredType* NATIVE_INT_LEAST8_;
|
||||
#endif /* H5_SIZEOF_INT_LEAST8_T */
|
||||
#if H5_SIZEOF_UINT_LEAST8_T != 0
|
||||
static PredType* NATIVE_UINT_LEAST8_;
|
||||
#endif /* H5_SIZEOF_UINT_LEAST8_T */
|
||||
|
||||
#if H5_SIZEOF_INT_LEAST16_T != 0
|
||||
static PredType* NATIVE_INT_LEAST16_;
|
||||
#endif /* H5_SIZEOF_INT_LEAST16_T */
|
||||
#if H5_SIZEOF_UINT_LEAST16_T != 0
|
||||
static PredType* NATIVE_UINT_LEAST16_;
|
||||
#endif /* H5_SIZEOF_UINT_LEAST16_T */
|
||||
|
||||
#if H5_SIZEOF_INT_LEAST32_T != 0
|
||||
static PredType* NATIVE_INT_LEAST32_;
|
||||
#endif /* H5_SIZEOF_INT_LEAST32_T */
|
||||
#if H5_SIZEOF_UINT_LEAST32_T != 0
|
||||
static PredType* NATIVE_UINT_LEAST32_;
|
||||
#endif /* H5_SIZEOF_UINT_LEAST32_T */
|
||||
|
||||
#if H5_SIZEOF_INT_LEAST64_T != 0
|
||||
static PredType* NATIVE_INT_LEAST64_;
|
||||
#endif /* H5_SIZEOF_INT_LEAST64_T */
|
||||
#if H5_SIZEOF_UINT_LEAST64_T != 0
|
||||
static PredType* NATIVE_UINT_LEAST64_;
|
||||
#endif /* H5_SIZEOF_UINT_LEAST64_T */
|
||||
|
||||
// FAST types
|
||||
#if H5_SIZEOF_INT_FAST8_T != 0
|
||||
static PredType* NATIVE_INT_FAST8_;
|
||||
#endif /* H5_SIZEOF_INT_FAST8_T */
|
||||
#if H5_SIZEOF_UINT_FAST8_T != 0
|
||||
static PredType* NATIVE_UINT_FAST8_;
|
||||
#endif /* H5_SIZEOF_UINT_FAST8_T */
|
||||
|
||||
#if H5_SIZEOF_INT_FAST16_T != 0
|
||||
static PredType* NATIVE_INT_FAST16_;
|
||||
#endif /* H5_SIZEOF_INT_FAST16_T */
|
||||
#if H5_SIZEOF_UINT_FAST16_T != 0
|
||||
static PredType* NATIVE_UINT_FAST16_;
|
||||
#endif /* H5_SIZEOF_UINT_FAST16_T */
|
||||
|
||||
#if H5_SIZEOF_INT_FAST32_T != 0
|
||||
static PredType* NATIVE_INT_FAST32_;
|
||||
#endif /* H5_SIZEOF_INT_FAST32_T */
|
||||
#if H5_SIZEOF_UINT_FAST32_T != 0
|
||||
static PredType* NATIVE_UINT_FAST32_;
|
||||
#endif /* H5_SIZEOF_UINT_FAST32_T */
|
||||
|
||||
#if H5_SIZEOF_INT_FAST64_T != 0
|
||||
static PredType* NATIVE_INT_FAST64_;
|
||||
#endif /* H5_SIZEOF_INT_FAST64_T */
|
||||
#if H5_SIZEOF_UINT_FAST64_T != 0
|
||||
static PredType* NATIVE_UINT_FAST64_;
|
||||
#endif /* H5_SIZEOF_UINT_FAST64_T */
|
||||
// End of Declaration of pointers
|
||||
|
||||
#endif // DOXYGEN_SHOULD_SKIP_THIS
|
||||
|
||||
};
|
||||
#ifndef H5_NO_NAMESPACE
|
||||
|
@ -36,10 +36,60 @@ namespace H5 {
|
||||
#endif // H5_NO_STD
|
||||
#endif
|
||||
|
||||
#ifndef DOXYGEN_SHOULD_SKIP_THIS
|
||||
// This DOXYGEN_SHOULD_SKIP_THIS block is a work-around approach to control
|
||||
// the order of creation and deletion of the global constants. See Design Notes
|
||||
// in "H5PredType.cpp" for information.
|
||||
|
||||
// Initialize a pointer for the constant
|
||||
PropList* PropList::DEFAULT_ = 0;
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
///\brief Constant for default property.
|
||||
// Function: PropList::getConstant
|
||||
// Purpose: Creates a PropList object representing the HDF5 constant
|
||||
// H5P_DEFAULT, pointed to by PropList::DEFAULT_.
|
||||
// Exception H5::PropListIException
|
||||
// Description
|
||||
// If PropList::DEFAULT_ already points to an allocated object,
|
||||
// throw a PropListIException. This scenario should not happen.
|
||||
// Programmer Binh-Minh Ribler - 2015
|
||||
//--------------------------------------------------------------------------
|
||||
const PropList PropList::DEFAULT;
|
||||
PropList* PropList::getConstant()
|
||||
{
|
||||
// Tell the C library not to clean up, H5Library::termH5cpp will call
|
||||
// H5close - more dependency if use H5Library::dontAtExit()
|
||||
if (!IdComponent::H5dontAtexit_called)
|
||||
{
|
||||
(void) H5dont_atexit();
|
||||
IdComponent::H5dontAtexit_called = true;
|
||||
}
|
||||
|
||||
// If the constant pointer is not allocated, allocate it. Otherwise,
|
||||
// throw because it shouldn't be.
|
||||
if (DEFAULT_ == 0)
|
||||
DEFAULT_ = new PropList(H5P_DEFAULT);
|
||||
else
|
||||
throw PropListIException("PropList::getConstant", "PropList::getConstant is being invoked on an allocated DEFAULT_");
|
||||
return(DEFAULT_);
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: PropList::deleteConstants
|
||||
// Purpose: Deletes the constant object that PropList::DEFAULT_ points to.
|
||||
// Programmer Binh-Minh Ribler - 2015
|
||||
//--------------------------------------------------------------------------
|
||||
void PropList::deleteConstants()
|
||||
{
|
||||
if (DEFAULT_ != 0)
|
||||
delete DEFAULT_;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Purpose Constant for default property.
|
||||
//--------------------------------------------------------------------------
|
||||
const PropList& PropList::DEFAULT = *getConstant();
|
||||
|
||||
#endif // DOXYGEN_SHOULD_SKIP_THIS
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Function Default constructor
|
||||
|
@ -24,8 +24,8 @@ namespace H5 {
|
||||
//! Class PropList provides operations for generic property lists.
|
||||
class H5_DLLCPP PropList : public IdComponent {
|
||||
public:
|
||||
// Default property list
|
||||
static const PropList DEFAULT;
|
||||
///\brief Default property list
|
||||
static const PropList& DEFAULT;
|
||||
|
||||
// Creates a property list of a given type or creates a copy of an
|
||||
// existing property list giving the property list id.
|
||||
@ -110,12 +110,23 @@ class H5_DLLCPP PropList : public IdComponent {
|
||||
// Destructor: properly terminates access to this property list.
|
||||
virtual ~PropList();
|
||||
|
||||
protected:
|
||||
#ifndef DOXYGEN_SHOULD_SKIP_THIS
|
||||
|
||||
// Deletes the PropList global constant
|
||||
static void deleteConstants();
|
||||
|
||||
protected:
|
||||
hid_t id; // HDF5 property list id
|
||||
|
||||
// Sets the property list id.
|
||||
virtual void p_setId(const hid_t new_id);
|
||||
|
||||
private:
|
||||
static PropList* DEFAULT_;
|
||||
|
||||
// Dynamically allocates the PropList global constant
|
||||
static PropList* getConstant();
|
||||
|
||||
#endif // DOXYGEN_SHOULD_SKIP_THIS
|
||||
};
|
||||
|
||||
|
@ -37,7 +37,7 @@ endif (TEST_ENV_VAR)
|
||||
|
||||
if (NOT TEST_INPUT)
|
||||
# run the test program, capture the stdout/stderr and the result var
|
||||
EXECUTE_PROCESS (
|
||||
execute_process (
|
||||
COMMAND ${TEST_PROGRAM} ${TEST_ARGS}
|
||||
WORKING_DIRECTORY ${TEST_FOLDER}
|
||||
RESULT_VARIABLE TEST_RESULT
|
||||
@ -48,7 +48,7 @@ if (NOT TEST_INPUT)
|
||||
)
|
||||
else (NOT TEST_INPUT)
|
||||
# run the test program with stdin, capture the stdout/stderr and the result var
|
||||
EXECUTE_PROCESS (
|
||||
execute_process (
|
||||
COMMAND ${TEST_PROGRAM} ${TEST_ARGS}
|
||||
WORKING_DIRECTORY ${TEST_FOLDER}
|
||||
RESULT_VARIABLE TEST_RESULT
|
||||
@ -80,13 +80,13 @@ message (STATUS "COMMAND Error: ${TEST_ERROR}")
|
||||
|
||||
if (TEST_MASK)
|
||||
file (READ ${TEST_FOLDER}/${TEST_OUTPUT} TEST_STREAM)
|
||||
STRING(REGEX REPLACE "Storage:[^\n]+\n" "Storage: <details removed for portability>\n" TEST_STREAM "${TEST_STREAM}")
|
||||
string (REGEX REPLACE "Storage:[^\n]+\n" "Storage: <details removed for portability>\n" TEST_STREAM "${TEST_STREAM}")
|
||||
file (WRITE ${TEST_FOLDER}/${TEST_OUTPUT} "${TEST_STREAM}")
|
||||
endif (TEST_MASK)
|
||||
|
||||
if (TEST_MASK_MOD)
|
||||
file (READ ${TEST_FOLDER}/${TEST_OUTPUT} TEST_STREAM)
|
||||
STRING(REGEX REPLACE "Modified:[^\n]+\n" "Modified: XXXX-XX-XX XX:XX:XX XXX\n" TEST_STREAM "${TEST_STREAM}")
|
||||
string (REGEX REPLACE "Modified:[^\n]+\n" "Modified: XXXX-XX-XX XX:XX:XX XXX\n" TEST_STREAM "${TEST_STREAM}")
|
||||
file (WRITE ${TEST_FOLDER}/${TEST_OUTPUT} "${TEST_STREAM}")
|
||||
endif (TEST_MASK_MOD)
|
||||
|
||||
@ -96,13 +96,13 @@ if (TEST_MASK_ERROR)
|
||||
else (NOT TEST_ERRREF)
|
||||
file (READ ${TEST_FOLDER}/${TEST_OUTPUT}.err TEST_STREAM)
|
||||
endif (NOT TEST_ERRREF)
|
||||
STRING(REGEX REPLACE "thread [0-9]*:" "thread (IDs):" TEST_STREAM "${TEST_STREAM}")
|
||||
STRING(REGEX REPLACE ": ([^\n]*)[.]c " ": (file name) " TEST_STREAM "${TEST_STREAM}")
|
||||
STRING(REGEX REPLACE " line [0-9]*" " line (number)" TEST_STREAM "${TEST_STREAM}")
|
||||
STRING(REGEX REPLACE "v[1-9]*[.][0-9]*[.]" "version (number)." TEST_STREAM "${TEST_STREAM}")
|
||||
STRING(REGEX REPLACE "[1-9]*[.][0-9]*[.][0-9]*[^)]*" "version (number)" TEST_STREAM "${TEST_STREAM}")
|
||||
STRING(REGEX REPLACE "H5Eget_auto[1-2]*" "H5Eget_auto(1 or 2)" TEST_STREAM "${TEST_STREAM}")
|
||||
STRING(REGEX REPLACE "H5Eset_auto[1-2]*" "H5Eset_auto(1 or 2)" TEST_STREAM "${TEST_STREAM}")
|
||||
string (REGEX REPLACE "thread [0-9]*:" "thread (IDs):" TEST_STREAM "${TEST_STREAM}")
|
||||
string (REGEX REPLACE ": ([^\n]*)[.]c " ": (file name) " TEST_STREAM "${TEST_STREAM}")
|
||||
string (REGEX REPLACE " line [0-9]*" " line (number)" TEST_STREAM "${TEST_STREAM}")
|
||||
string (REGEX REPLACE "v[1-9]*[.][0-9]*[.]" "version (number)." TEST_STREAM "${TEST_STREAM}")
|
||||
string (REGEX REPLACE "[1-9]*[.][0-9]*[.][0-9]*[^)]*" "version (number)" TEST_STREAM "${TEST_STREAM}")
|
||||
string (REGEX REPLACE "H5Eget_auto[1-2]*" "H5Eget_auto(1 or 2)" TEST_STREAM "${TEST_STREAM}")
|
||||
string (REGEX REPLACE "H5Eset_auto[1-2]*" "H5Eset_auto(1 or 2)" TEST_STREAM "${TEST_STREAM}")
|
||||
if (NOT TEST_ERRREF)
|
||||
file (WRITE ${TEST_FOLDER}/${TEST_OUTPUT} "${TEST_STREAM}")
|
||||
else (NOT TEST_ERRREF)
|
||||
@ -112,7 +112,7 @@ endif (TEST_MASK_ERROR)
|
||||
|
||||
if (TEST_FILTER)
|
||||
file (READ ${TEST_FOLDER}/${TEST_OUTPUT} TEST_STREAM)
|
||||
STRING(REGEX REPLACE "${TEST_FILTER}" "" TEST_STREAM "${TEST_STREAM}")
|
||||
string (REGEX REPLACE "${TEST_FILTER}" "" TEST_STREAM "${TEST_STREAM}")
|
||||
file (WRITE ${TEST_FOLDER}/${TEST_OUTPUT} "${TEST_STREAM}")
|
||||
endif (TEST_FILTER)
|
||||
|
||||
@ -123,21 +123,21 @@ if (NOT TEST_SKIP_COMPARE)
|
||||
endif (WIN32 AND NOT MINGW)
|
||||
|
||||
# now compare the output with the reference
|
||||
EXECUTE_PROCESS (
|
||||
execute_process (
|
||||
COMMAND ${CMAKE_COMMAND} -E compare_files ${TEST_FOLDER}/${TEST_OUTPUT} ${TEST_FOLDER}/${TEST_REFERENCE}
|
||||
RESULT_VARIABLE TEST_RESULT
|
||||
)
|
||||
if (NOT ${TEST_RESULT} STREQUAL 0)
|
||||
set (TEST_RESULT 0)
|
||||
file (STRINGS ${TEST_FOLDER}/${TEST_OUTPUT} test_act)
|
||||
LIST (LENGTH test_act len_act)
|
||||
list (LENGTH test_act len_act)
|
||||
file (STRINGS ${TEST_FOLDER}/${TEST_REFERENCE} test_ref)
|
||||
LIST (LENGTH test_ref len_ref)
|
||||
list (LENGTH test_ref len_ref)
|
||||
if (NOT ${len_act} STREQUAL "0")
|
||||
MATH (EXPR _FP_LEN "${len_ref} - 1")
|
||||
math (EXPR _FP_LEN "${len_ref} - 1")
|
||||
foreach (line RANGE 0 ${_FP_LEN})
|
||||
LIST (GET test_act ${line} str_act)
|
||||
LIST (GET test_ref ${line} str_ref)
|
||||
list (GET test_act ${line} str_act)
|
||||
list (GET test_ref ${line} str_ref)
|
||||
if (NOT "${str_act}" STREQUAL "${str_ref}")
|
||||
if (NOT "${str_act}" STREQUAL "")
|
||||
set (TEST_RESULT 1)
|
||||
@ -165,22 +165,22 @@ if (NOT TEST_SKIP_COMPARE)
|
||||
endif (WIN32 AND NOT MINGW)
|
||||
|
||||
# now compare the error output with the error reference
|
||||
EXECUTE_PROCESS (
|
||||
execute_process (
|
||||
COMMAND ${CMAKE_COMMAND} -E compare_files ${TEST_FOLDER}/${TEST_OUTPUT}.err ${TEST_FOLDER}/${TEST_ERRREF}
|
||||
RESULT_VARIABLE TEST_RESULT
|
||||
)
|
||||
if (NOT ${TEST_RESULT} STREQUAL 0)
|
||||
set (TEST_RESULT 0)
|
||||
file (STRINGS ${TEST_FOLDER}/${TEST_OUTPUT}.err test_act)
|
||||
LIST (LENGTH test_act len_act)
|
||||
list (LENGTH test_act len_act)
|
||||
file (STRINGS ${TEST_FOLDER}/${TEST_ERRREF} test_ref)
|
||||
LIST (LENGTH test_ref len_ref)
|
||||
MATH (EXPR _FP_LEN "${len_ref} - 1")
|
||||
list (LENGTH test_ref len_ref)
|
||||
math (EXPR _FP_LEN "${len_ref} - 1")
|
||||
if (NOT ${len_act} STREQUAL "0")
|
||||
MATH (EXPR _FP_LEN "${len_ref} - 1")
|
||||
math (EXPR _FP_LEN "${len_ref} - 1")
|
||||
foreach (line RANGE 0 ${_FP_LEN})
|
||||
LIST (GET test_act ${line} str_act)
|
||||
LIST (GET test_ref ${line} str_ref)
|
||||
list (GET test_act ${line} str_act)
|
||||
list (GET test_ref ${line} str_ref)
|
||||
if (NOT "${str_act}" STREQUAL "${str_ref}")
|
||||
if (NOT "${str_act}" STREQUAL "")
|
||||
set (TEST_RESULT 1)
|
||||
|
@ -20,20 +20,22 @@ if (HDF5_GENERATE_HEADERS)
|
||||
|
||||
add_custom_command (
|
||||
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/H5LTparse.c ${CMAKE_CURRENT_BINARY_DIR}/H5LTparse.h
|
||||
PRE_BUILD
|
||||
COMMAND "${CMAKE_COMMAND}"
|
||||
-D "GEN_DIR=genLT"
|
||||
-D "FILE_PARSE=H5LTparse"
|
||||
-P "${HDF_RESOURCES_DIR}/HDF5_Process_Flex_Files.cmake"
|
||||
DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/genLT/H5LTparse.c"
|
||||
DEPENDS "${BISON_H5LT_PARSER_OUTPUTS}"
|
||||
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
|
||||
)
|
||||
add_custom_command (
|
||||
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/H5LTanalyze.c
|
||||
PRE_BUILD
|
||||
COMMAND "${CMAKE_COMMAND}"
|
||||
-D "GEN_DIR=genLT"
|
||||
-D "FILE_ANALYZE=H5LTanalyze.c"
|
||||
-P "${HDF_RESOURCES_DIR}/HDF5_Process_Flex_Files.cmake"
|
||||
DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/genLT/H5LTanalyze.c"
|
||||
DEPENDS "${FLEX_H5LT_SCANNER_OUTPUTS}"
|
||||
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
|
||||
)
|
||||
add_custom_target (process_gen_H5LT
|
||||
|
@ -809,11 +809,8 @@ if (HDF5_GENERATE_HEADERS)
|
||||
COMMENT " Creating Assignment overflow macro"
|
||||
)
|
||||
|
||||
add_custom_target(generate_precompiled DEPENDS
|
||||
"${HDF5_SRC_DIR}/H5version.h;${HDF5_SRC_DIR}/H5overflow.h")
|
||||
|
||||
add_custom_target(run_perl_scripts ALL
|
||||
DEPENDS ${HDF5_SRC_DIR}/H5Edefin.h ${HDF5_SRC_DIR}/H5version.h ${HDF5_SRC_DIR}/H5overflow.h
|
||||
DEPENDS ${HDF5_SRC_DIR}/H5Edefin.h ${HDF5_SRC_DIR}/H5Einit.h ${HDF5_SRC_DIR}/H5Epubgen.h ${HDF5_SRC_DIR}/H5Eterm.h ${HDF5_SRC_DIR}/H5version.h ${HDF5_SRC_DIR}/H5overflow.h
|
||||
)
|
||||
else (PERL_FOUND)
|
||||
message (STATUS "Cannot generate headers - perl not found")
|
||||
@ -830,7 +827,7 @@ if (MSVC OR MINGW)
|
||||
target_link_libraries (H5detect "ws2_32.lib")
|
||||
endif (MSVC OR MINGW)
|
||||
if (HDF5_GENERATE_HEADERS)
|
||||
add_dependencies(H5detect generate_precompiled)
|
||||
add_dependencies(H5detect run_perl_scripts)
|
||||
else (HDF5_GENERATE_HEADERS)
|
||||
add_dependencies(H5detect "${H5_GENERATED_HEADERS}")
|
||||
endif (HDF5_GENERATE_HEADERS)
|
||||
@ -849,7 +846,7 @@ if (MSVC OR MINGW)
|
||||
target_link_libraries (H5make_libsettings "ws2_32.lib")
|
||||
endif (MSVC OR MINGW)
|
||||
if (HDF5_GENERATE_HEADERS)
|
||||
add_dependencies(H5detect generate_precompiled)
|
||||
add_dependencies(H5make_libsettings run_perl_scripts)
|
||||
else (HDF5_GENERATE_HEADERS)
|
||||
add_dependencies(H5make_libsettings "${H5_GENERATED_HEADERS}")
|
||||
endif (HDF5_GENERATE_HEADERS)
|
||||
|
24
src/H5A.c
24
src/H5A.c
@ -684,6 +684,7 @@ hid_t
|
||||
H5Aget_space(hid_t attr_id)
|
||||
{
|
||||
H5A_t *attr; /* Attribute object for ID */
|
||||
H5S_t *ds = NULL;
|
||||
hid_t ret_value;
|
||||
|
||||
FUNC_ENTER_API(FAIL)
|
||||
@ -693,10 +694,19 @@ H5Aget_space(hid_t attr_id)
|
||||
if(NULL == (attr = (H5A_t *)H5I_object_verify(attr_id, H5I_ATTR)))
|
||||
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not an attribute")
|
||||
|
||||
if((ret_value = H5A_get_space(attr)) < 0)
|
||||
if(NULL == (ds = H5A_get_space(attr)))
|
||||
HGOTO_ERROR(H5E_ARGS, H5E_CANTGET, FAIL, "can't get space ID of attribute")
|
||||
|
||||
/* Atomize */
|
||||
if((ret_value = H5I_register(H5I_DATASPACE, ds, TRUE)) < 0)
|
||||
HGOTO_ERROR(H5E_ATOM, H5E_CANTREGISTER, FAIL, "unable to register dataspace atom")
|
||||
|
||||
done:
|
||||
if(ret_value < 0) {
|
||||
if(ds && (H5S_close(ds) < 0))
|
||||
HDONE_ERROR(H5E_DATASET, H5E_CLOSEERROR, FAIL, "unable to release dataspace")
|
||||
} /* end if */
|
||||
|
||||
FUNC_LEAVE_API(ret_value)
|
||||
} /* H5Aget_space() */
|
||||
|
||||
@ -721,6 +731,7 @@ hid_t
|
||||
H5Aget_type(hid_t attr_id)
|
||||
{
|
||||
H5A_t *attr; /* Attribute object for ID */
|
||||
H5T_t *dt = NULL;
|
||||
hid_t ret_value; /* Return value */
|
||||
|
||||
FUNC_ENTER_API(FAIL)
|
||||
@ -730,10 +741,19 @@ H5Aget_type(hid_t attr_id)
|
||||
if(NULL == (attr = (H5A_t *)H5I_object_verify(attr_id, H5I_ATTR)))
|
||||
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not an attribute")
|
||||
|
||||
if((ret_value = H5A_get_type(attr)) < 0)
|
||||
if(NULL == (dt = H5A_get_type(attr)))
|
||||
HGOTO_ERROR(H5E_ARGS, H5E_CANTGET, FAIL, "can't get space ID of attribute")
|
||||
|
||||
/* Create an atom */
|
||||
if((ret_value = H5I_register(H5I_DATATYPE, dt, TRUE)) < 0)
|
||||
HGOTO_ERROR(H5E_ATOM, H5E_CANTREGISTER, FAIL, "unable to register datatype")
|
||||
|
||||
done:
|
||||
if(ret_value < 0) {
|
||||
if(dt && (H5T_close(dt) < 0))
|
||||
HDONE_ERROR(H5E_DATASET, H5E_CLOSEERROR, FAIL, "unable to release datatype")
|
||||
} /* end if */
|
||||
|
||||
FUNC_LEAVE_API(ret_value)
|
||||
} /* H5Aget_type() */
|
||||
|
||||
|
58
src/H5Aint.c
58
src/H5Aint.c
@ -734,39 +734,31 @@ H5A__get_name(H5A_t *attr, size_t buf_size, char *buf)
|
||||
/*-------------------------------------------------------------------------
|
||||
* Function: H5A_get_space
|
||||
*
|
||||
* Purpose: Returns and ID for the dataspace of the attribute.
|
||||
* Purpose: Returns dataspace of the attribute.
|
||||
*
|
||||
* Return: Success: ID for dataspace
|
||||
* Return: Success: dataspace
|
||||
*
|
||||
* Failure: FAIL
|
||||
* Failure: NULL
|
||||
*
|
||||
* Programmer: Mohamad Chaarawi
|
||||
* March, 2012
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
hid_t
|
||||
H5S_t *
|
||||
H5A_get_space(H5A_t *attr)
|
||||
{
|
||||
H5S_t *ds = NULL;
|
||||
hid_t ret_value = FAIL;
|
||||
H5S_t *ret_value = NULL;
|
||||
|
||||
FUNC_ENTER_NOAPI_NOINIT
|
||||
|
||||
/* Copy the attribute's dataspace */
|
||||
if(NULL == (ds = H5S_copy(attr->shared->ds, FALSE, TRUE)))
|
||||
HGOTO_ERROR(H5E_ATTR, H5E_CANTINIT, FAIL, "unable to copy dataspace")
|
||||
HDassert(attr);
|
||||
|
||||
/* Atomize */
|
||||
if((ret_value = H5I_register(H5I_DATASPACE, ds, TRUE)) < 0)
|
||||
HGOTO_ERROR(H5E_ATOM, H5E_CANTREGISTER, FAIL, "unable to register dataspace atom")
|
||||
/* Copy the attribute's dataspace */
|
||||
if(NULL == (ret_value = H5S_copy(attr->shared->ds, FALSE, TRUE)))
|
||||
HGOTO_ERROR(H5E_ATTR, H5E_CANTINIT, NULL, "unable to copy dataspace")
|
||||
|
||||
done:
|
||||
if(ret_value < 0 && ds) {
|
||||
if(H5S_close(ds) < 0)
|
||||
HDONE_ERROR(H5E_DATASET, H5E_CLOSEERROR, FAIL, "unable to release dataspace")
|
||||
} /* end if */
|
||||
|
||||
FUNC_LEAVE_NOAPI(ret_value)
|
||||
} /* end H5A_get_space() */
|
||||
|
||||
@ -774,28 +766,30 @@ done:
|
||||
/*-------------------------------------------------------------------------
|
||||
* Function: H5A_get_type
|
||||
*
|
||||
* Purpose: Returns and ID for the datatype of the dataset.
|
||||
* Purpose: Returns datatype of the dataset.
|
||||
*
|
||||
* Return: Success: ID for datatype
|
||||
* Return: Success: datatype
|
||||
*
|
||||
* Failure: FAIL
|
||||
* Failure: NULL
|
||||
*
|
||||
* Programmer: Mohamad Chaarawi
|
||||
* March, 2012
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
hid_t
|
||||
H5T_t *
|
||||
H5A_get_type(H5A_t *attr)
|
||||
{
|
||||
H5T_t *dt = NULL;
|
||||
hid_t ret_value = FAIL;
|
||||
H5T_t *dt = NULL;
|
||||
H5T_t *ret_value = NULL;
|
||||
|
||||
FUNC_ENTER_NOAPI_NOINIT
|
||||
|
||||
HDassert(attr);
|
||||
|
||||
/* Patch the datatype's "top level" file pointer */
|
||||
if(H5T_patch_file(attr->shared->dt, attr->oloc.file) < 0)
|
||||
HGOTO_ERROR(H5E_ATTR, H5E_CANTINIT, FAIL, "unable to patch datatype's file pointer")
|
||||
HGOTO_ERROR(H5E_ATTR, H5E_CANTINIT, NULL, "unable to patch datatype's file pointer")
|
||||
|
||||
/*
|
||||
* Copy the attribute's datatype. If the type is a named type then
|
||||
@ -803,25 +797,21 @@ H5A_get_type(H5A_t *attr)
|
||||
* read-only.
|
||||
*/
|
||||
if(NULL == (dt = H5T_copy(attr->shared->dt, H5T_COPY_REOPEN)))
|
||||
HGOTO_ERROR(H5E_ATTR, H5E_CANTINIT, FAIL, "unable to copy datatype")
|
||||
HGOTO_ERROR(H5E_ATTR, H5E_CANTINIT, NULL, "unable to copy datatype")
|
||||
|
||||
/* Mark any datatypes as being in memory now */
|
||||
if(H5T_set_loc(dt, NULL, H5T_LOC_MEMORY) < 0)
|
||||
HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "invalid datatype location")
|
||||
HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, NULL, "invalid datatype location")
|
||||
|
||||
/* Lock copied type */
|
||||
if(H5T_lock(dt, FALSE) < 0)
|
||||
HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "unable to lock transient datatype")
|
||||
HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, NULL, "unable to lock transient datatype")
|
||||
|
||||
/* Create an atom */
|
||||
if((ret_value = H5I_register(H5I_DATATYPE, dt, TRUE)) < 0)
|
||||
HGOTO_ERROR(H5E_ATOM, H5E_CANTREGISTER, FAIL, "unable to register datatype")
|
||||
ret_value = dt;
|
||||
|
||||
done:
|
||||
if(ret_value < 0) {
|
||||
if(dt && H5T_close(dt) < 0)
|
||||
HDONE_ERROR(H5E_DATASET, H5E_CLOSEERROR, FAIL, "unable to release datatype")
|
||||
} /* end if */
|
||||
if(!ret_value && dt && (H5T_close(dt) < 0))
|
||||
HDONE_ERROR(H5E_DATASET, H5E_CLOSEERROR, NULL, "unable to release datatype")
|
||||
|
||||
FUNC_LEAVE_NOAPI(ret_value)
|
||||
} /* end H5A_get_type() */
|
||||
|
@ -193,8 +193,6 @@ H5_DLL H5A_t *H5A_open_by_idx(const H5G_loc_t *loc, const char *obj_name,
|
||||
H5_DLL herr_t H5A__open_common(const H5G_loc_t *loc, H5A_t *attr);
|
||||
H5_DLL H5A_t *H5A_copy(H5A_t *new_attr, const H5A_t *old_attr);
|
||||
H5_DLL herr_t H5A__get_info(const H5A_t *attr, H5A_info_t *ainfo);
|
||||
H5_DLL hid_t H5A_get_type(H5A_t *attr);
|
||||
H5_DLL hid_t H5A_get_space(H5A_t *attr);
|
||||
H5_DLL hid_t H5A_get_create_plist(H5A_t* attr);
|
||||
H5_DLL herr_t H5A_free(H5A_t *attr);
|
||||
H5_DLL herr_t H5A_close(H5A_t *attr);
|
||||
|
@ -25,6 +25,7 @@
|
||||
/* Private headers needed by this file */
|
||||
#include "H5Gprivate.h" /* Groups */
|
||||
#include "H5Oprivate.h" /* Object headers */
|
||||
#include "H5Sprivate.h" /* Dataspace */
|
||||
#include "H5Tprivate.h" /* Datatypes */
|
||||
|
||||
|
||||
@ -77,6 +78,8 @@ typedef struct H5A_attr_iter_op_t {
|
||||
H5_DLL struct H5O_loc_t *H5A_oloc(H5A_t *attr);
|
||||
H5_DLL H5G_name_t *H5A_nameof(H5A_t *attr);
|
||||
H5_DLL H5T_t *H5A_type(const H5A_t *attr);
|
||||
H5_DLL H5T_t *H5A_get_type(H5A_t *attr);
|
||||
H5_DLL H5S_t *H5A_get_space(H5A_t *attr);
|
||||
H5_DLL herr_t H5O_attr_iterate_real(hid_t loc_id, const H5O_loc_t *loc,
|
||||
hid_t dxpl_id, H5_index_t idx_type, H5_iter_order_t order, hsize_t skip,
|
||||
hsize_t *last_attr, const H5A_attr_iter_op_t *attr_op, void *op_data);
|
||||
|
22
src/H5D.c
22
src/H5D.c
@ -697,7 +697,9 @@ herr_t
|
||||
H5Diterate(void *buf, hid_t type_id, hid_t space_id, H5D_operator_t op,
|
||||
void *operator_data)
|
||||
{
|
||||
H5T_t *type; /* Datatype */
|
||||
H5S_t *space; /* Dataspace for iteration */
|
||||
H5S_sel_iter_op_t dset_op; /* Operator for iteration */
|
||||
herr_t ret_value; /* Return value */
|
||||
|
||||
FUNC_ENTER_API(FAIL)
|
||||
@ -710,12 +712,18 @@ H5Diterate(void *buf, hid_t type_id, hid_t space_id, H5D_operator_t op,
|
||||
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid buffer")
|
||||
if(H5I_DATATYPE != H5I_get_type(type_id))
|
||||
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "invalid datatype")
|
||||
if(NULL == (type = (H5T_t *)H5I_object_verify(type_id, H5I_DATATYPE)))
|
||||
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not an valid base datatype")
|
||||
if(NULL == (space = (H5S_t *)H5I_object_verify(space_id, H5I_DATASPACE)))
|
||||
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "invalid dataspace")
|
||||
if(!(H5S_has_extent(space)))
|
||||
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "dataspace does not have extent set")
|
||||
|
||||
ret_value = H5D__iterate(buf, type_id, space, op, operator_data);
|
||||
dset_op.op_type = H5S_SEL_ITER_OP_APP;
|
||||
dset_op.u.app_op.op = op;
|
||||
dset_op.u.app_op.type_id = type_id;
|
||||
|
||||
ret_value = H5S_select_iterate(buf, type, space, &dset_op, operator_data);
|
||||
|
||||
done:
|
||||
FUNC_LEAVE_API(ret_value)
|
||||
@ -804,6 +812,8 @@ H5Dvlen_get_buf_size(hid_t dataset_id, hid_t type_id, hid_t space_id,
|
||||
char bogus; /* bogus value to pass to H5Diterate() */
|
||||
H5S_t *space; /* Dataspace for iteration */
|
||||
H5P_genplist_t *plist; /* Property list */
|
||||
H5T_t *type; /* Datatype */
|
||||
H5S_sel_iter_op_t dset_op; /* Operator for iteration */
|
||||
herr_t ret_value; /* Return value */
|
||||
|
||||
FUNC_ENTER_API(FAIL)
|
||||
@ -815,6 +825,8 @@ H5Dvlen_get_buf_size(hid_t dataset_id, hid_t type_id, hid_t space_id,
|
||||
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid argument")
|
||||
if(NULL == (dset = (H5D_t *)H5I_object(dataset_id)))
|
||||
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a dataset")
|
||||
if(NULL == (type = (H5T_t *)H5I_object_verify(type_id, H5I_DATATYPE)))
|
||||
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not an valid base datatype")
|
||||
if(NULL == (space = (H5S_t *)H5I_object_verify(space_id, H5I_DATASPACE)))
|
||||
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "invalid dataspace")
|
||||
if(!(H5S_has_extent(space)))
|
||||
@ -854,8 +866,12 @@ H5Dvlen_get_buf_size(hid_t dataset_id, hid_t type_id, hid_t space_id,
|
||||
/* Set the initial number of bytes required */
|
||||
vlen_bufsize.size = 0;
|
||||
|
||||
/* Call H5D__iterate with args, etc. */
|
||||
ret_value = H5D__iterate(&bogus, type_id, space, H5D__vlen_get_buf_size, &vlen_bufsize);
|
||||
/* Call H5S_select_iterate with args, etc. */
|
||||
dset_op.op_type = H5S_SEL_ITER_OP_APP;
|
||||
dset_op.u.app_op.op = H5D__vlen_get_buf_size;
|
||||
dset_op.u.app_op.type_id = type_id;
|
||||
|
||||
ret_value = H5S_select_iterate(&bogus, type, space, &dset_op, &vlen_bufsize);
|
||||
|
||||
/* Get the size if we succeeded */
|
||||
if(ret_value >= 0)
|
||||
|
@ -231,9 +231,9 @@ static herr_t H5D__create_chunk_map_single(H5D_chunk_map_t *fm,
|
||||
static herr_t H5D__create_chunk_file_map_hyper(H5D_chunk_map_t *fm,
|
||||
const H5D_io_info_t *io_info);
|
||||
static herr_t H5D__create_chunk_mem_map_hyper(const H5D_chunk_map_t *fm);
|
||||
static herr_t H5D__chunk_file_cb(void *elem, hid_t type_id, unsigned ndims,
|
||||
static herr_t H5D__chunk_file_cb(void *elem, const H5T_t *type, unsigned ndims,
|
||||
const hsize_t *coords, void *fm);
|
||||
static herr_t H5D__chunk_mem_cb(void *elem, hid_t type_id, unsigned ndims,
|
||||
static herr_t H5D__chunk_mem_cb(void *elem, const H5T_t *type, unsigned ndims,
|
||||
const hsize_t *coords, void *fm);
|
||||
static unsigned H5D__chunk_hash_val(const H5D_shared_t *shared, const hsize_t *scaled);
|
||||
static herr_t H5D__chunk_flush_entry(const H5D_t *dset, hid_t dxpl_id,
|
||||
@ -722,7 +722,7 @@ H5D__chunk_io_init(const H5D_io_info_t *io_info, const H5D_type_info_t *type_inf
|
||||
H5S_t *tmp_mspace = NULL; /* Temporary memory dataspace */
|
||||
hssize_t old_offset[H5O_LAYOUT_NDIMS]; /* Old selection offset */
|
||||
htri_t file_space_normalized = FALSE; /* File dataspace was normalized */
|
||||
hid_t f_tid = (-1); /* Temporary copy of file datatype for iteration */
|
||||
H5T_t *file_type = NULL; /* Temporary copy of file datatype for iteration */
|
||||
hbool_t iter_init = FALSE; /* Selection iteration info has been initialized */
|
||||
unsigned f_ndims; /* The number of dimensions of the file's dataspace */
|
||||
int sm_ndims; /* The number of dimensions of the memory buffer's dataspace (signed) */
|
||||
@ -875,11 +875,12 @@ H5D__chunk_io_init(const H5D_io_info_t *io_info, const H5D_type_info_t *type_inf
|
||||
} /* end while */
|
||||
} /* end if */
|
||||
else {
|
||||
H5S_sel_iter_op_t iter_op; /* Operator for iteration */
|
||||
H5D_chunk_file_iter_ud_t udata; /* User data for iteration */
|
||||
|
||||
/* Create temporary datatypes for selection iteration */
|
||||
if((f_tid = H5I_register(H5I_DATATYPE, H5T_copy(dataset->shared->type, H5T_COPY_ALL), FALSE)) < 0)
|
||||
HGOTO_ERROR(H5E_DATATYPE, H5E_CANTREGISTER, FAIL, "unable to register file datatype")
|
||||
if(NULL == (file_type = H5T_copy(dataset->shared->type, H5T_COPY_ALL)))
|
||||
HGOTO_ERROR(H5E_DATATYPE, H5E_CANTCOPY, FAIL, "unable to copy file datatype")
|
||||
|
||||
/* Initialize the user data */
|
||||
udata.fm = fm;
|
||||
@ -887,8 +888,11 @@ H5D__chunk_io_init(const H5D_io_info_t *io_info, const H5D_type_info_t *type_inf
|
||||
udata.io_info = io_info;
|
||||
#endif /* H5_HAVE_PARALLEL */
|
||||
|
||||
iter_op.op_type = H5S_SEL_ITER_OP_LIB;
|
||||
iter_op.u.lib_op = H5D__chunk_file_cb;
|
||||
|
||||
/* Spaces might not be the same shape, iterate over the file selection directly */
|
||||
if(H5S_select_iterate(&bogus, f_tid, file_space, H5D__chunk_file_cb, &udata) < 0)
|
||||
if(H5S_select_iterate(&bogus, file_type, file_space, &iter_op, &udata) < 0)
|
||||
HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to create file chunk selections")
|
||||
|
||||
/* Reset "last chunk" info */
|
||||
@ -908,6 +912,7 @@ H5D__chunk_io_init(const H5D_io_info_t *io_info, const H5D_type_info_t *type_inf
|
||||
HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to create memory chunk selections")
|
||||
} /* end if */
|
||||
else {
|
||||
H5S_sel_iter_op_t iter_op; /* Operator for iteration */
|
||||
size_t elmt_size; /* Memory datatype size */
|
||||
|
||||
/* Make a copy of equivalent memory space */
|
||||
@ -922,9 +927,9 @@ H5D__chunk_io_init(const H5D_io_info_t *io_info, const H5D_type_info_t *type_inf
|
||||
fm->mchunk_tmpl = tmp_mspace;
|
||||
|
||||
/* Create temporary datatypes for selection iteration */
|
||||
if(f_tid < 0) {
|
||||
if((f_tid = H5I_register(H5I_DATATYPE, H5T_copy(dataset->shared->type, H5T_COPY_ALL), FALSE)) < 0)
|
||||
HGOTO_ERROR(H5E_DATATYPE, H5E_CANTREGISTER, FAIL, "unable to register file datatype")
|
||||
if(!file_type) {
|
||||
if(NULL == (file_type = H5T_copy(dataset->shared->type, H5T_COPY_ALL)))
|
||||
HGOTO_ERROR(H5E_DATATYPE, H5E_CANTCOPY, FAIL, "unable to copy file datatype")
|
||||
} /* end if */
|
||||
|
||||
/* Create selection iterator for memory selection */
|
||||
@ -934,8 +939,11 @@ H5D__chunk_io_init(const H5D_io_info_t *io_info, const H5D_type_info_t *type_inf
|
||||
HGOTO_ERROR(H5E_DATASPACE, H5E_CANTINIT, FAIL, "unable to initialize selection iterator")
|
||||
iter_init = TRUE; /* Selection iteration info has been initialized */
|
||||
|
||||
iter_op.op_type = H5S_SEL_ITER_OP_LIB;
|
||||
iter_op.u.lib_op = H5D__chunk_mem_cb;
|
||||
|
||||
/* Spaces aren't the same shape, iterate over the memory selection directly */
|
||||
if(H5S_select_iterate(&bogus, f_tid, file_space, H5D__chunk_mem_cb, fm) < 0)
|
||||
if(H5S_select_iterate(&bogus, file_type, file_space, &iter_op, fm) < 0)
|
||||
HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to create memory chunk selections")
|
||||
|
||||
/* Clean up hyperslab stuff, if necessary */
|
||||
@ -978,8 +986,8 @@ done:
|
||||
|
||||
if(iter_init && H5S_SELECT_ITER_RELEASE(&(fm->mem_iter)) < 0)
|
||||
HDONE_ERROR(H5E_DATASPACE, H5E_CANTRELEASE, FAIL, "unable to release selection iterator")
|
||||
if(f_tid != (-1) && H5I_dec_ref(f_tid) < 0)
|
||||
HDONE_ERROR(H5E_DATASET, H5E_CANTFREE, FAIL, "Can't decrement temporary datatype ID")
|
||||
if(file_type && (H5T_close(file_type) < 0))
|
||||
HDONE_ERROR(H5E_DATATYPE, H5E_CANTFREE, FAIL, "Can't free temporary datatype")
|
||||
if(file_space_normalized) {
|
||||
/* (Casting away const OK -QAK) */
|
||||
if(H5S_hyper_denormalize_offset((H5S_t *)file_space, old_offset) < 0)
|
||||
@ -1525,7 +1533,7 @@ done:
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
static herr_t
|
||||
H5D__chunk_file_cb(void H5_ATTR_UNUSED *elem, hid_t H5_ATTR_UNUSED type_id, unsigned ndims, const hsize_t *coords, void *_udata)
|
||||
H5D__chunk_file_cb(void H5_ATTR_UNUSED *elem, const H5T_t H5_ATTR_UNUSED *type, unsigned ndims, const hsize_t *coords, void *_udata)
|
||||
{
|
||||
H5D_chunk_file_iter_ud_t *udata = (H5D_chunk_file_iter_ud_t *)_udata; /* User data for operation */
|
||||
H5D_chunk_map_t *fm = udata->fm; /* File<->memory chunk mapping info */
|
||||
@ -1642,7 +1650,7 @@ done:
|
||||
*/
|
||||
/* ARGSUSED */
|
||||
static herr_t
|
||||
H5D__chunk_mem_cb(void H5_ATTR_UNUSED *elem, hid_t H5_ATTR_UNUSED type_id, unsigned ndims, const hsize_t *coords, void *_fm)
|
||||
H5D__chunk_mem_cb(void H5_ATTR_UNUSED *elem, const H5T_t H5_ATTR_UNUSED *type, unsigned ndims, const hsize_t *coords, void *_fm)
|
||||
{
|
||||
H5D_chunk_map_t *fm = (H5D_chunk_map_t *)_fm; /* File<->memory chunk mapping info */
|
||||
H5D_chunk_info_t *chunk_info; /* Chunk information for current chunk */
|
||||
|
48
src/H5Dint.c
48
src/H5Dint.c
@ -2142,41 +2142,6 @@ done:
|
||||
FUNC_LEAVE_NOAPI(ret_value)
|
||||
} /* end H5D__get_offset() */
|
||||
|
||||
|
||||
/*-------------------------------------------------------------------------
|
||||
* Function: H5D__iterate
|
||||
*
|
||||
* Purpose: Internal version of H5Diterate()
|
||||
*
|
||||
* Return: Returns the return value of the last operator if it was non-zero,
|
||||
* or zero if all elements were processed. Otherwise returns a
|
||||
* negative value.
|
||||
*
|
||||
* Programmer: Quincey Koziol
|
||||
* Tuesday, November 22, 2005
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
herr_t
|
||||
H5D__iterate(void *buf, hid_t type_id, const H5S_t *space, H5D_operator_t op,
|
||||
void *operator_data)
|
||||
{
|
||||
herr_t ret_value = FAIL; /* Return value */
|
||||
|
||||
FUNC_ENTER_PACKAGE_NOERR
|
||||
|
||||
/* Check args */
|
||||
HDassert(buf);
|
||||
HDassert(H5I_DATATYPE == H5I_get_type(type_id));
|
||||
HDassert(space);
|
||||
HDassert(H5S_has_extent(space));
|
||||
HDassert(op);
|
||||
|
||||
ret_value = H5S_select_iterate(buf, type_id, space, op, operator_data);
|
||||
|
||||
FUNC_LEAVE_NOAPI(ret_value)
|
||||
} /* end H5D__iterate() */
|
||||
|
||||
|
||||
/*-------------------------------------------------------------------------
|
||||
* Function: H5D_vlen_reclaim
|
||||
@ -2196,6 +2161,8 @@ H5D__iterate(void *buf, hid_t type_id, const H5S_t *space, H5D_operator_t op,
|
||||
herr_t
|
||||
H5D_vlen_reclaim(hid_t type_id, H5S_t *space, hid_t plist_id, void *buf)
|
||||
{
|
||||
H5T_t *type; /* Datatype */
|
||||
H5S_sel_iter_op_t dset_op; /* Operator for iteration */
|
||||
H5T_vlen_alloc_info_t _vl_alloc_info; /* VL allocation info buffer */
|
||||
H5T_vlen_alloc_info_t *vl_alloc_info = &_vl_alloc_info; /* VL allocation info */
|
||||
herr_t ret_value = FAIL; /* Return value */
|
||||
@ -2208,12 +2175,19 @@ H5D_vlen_reclaim(hid_t type_id, H5S_t *space, hid_t plist_id, void *buf)
|
||||
HDassert(H5P_isa_class(plist_id, H5P_DATASET_XFER));
|
||||
HDassert(buf);
|
||||
|
||||
if(NULL == (type = (H5T_t *)H5I_object_verify(type_id, H5I_DATATYPE)))
|
||||
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not an valid base datatype")
|
||||
|
||||
/* Get the allocation info */
|
||||
if(H5T_vlen_get_alloc_info(plist_id,&vl_alloc_info) < 0)
|
||||
HGOTO_ERROR(H5E_DATATYPE, H5E_CANTGET, FAIL, "unable to retrieve VL allocation info")
|
||||
|
||||
/* Call H5D__iterate with args, etc. */
|
||||
ret_value = H5D__iterate(buf, type_id, space ,H5T_vlen_reclaim, vl_alloc_info);
|
||||
/* Call H5S_select_iterate with args, etc. */
|
||||
dset_op.op_type = H5S_SEL_ITER_OP_APP;
|
||||
dset_op.u.app_op.op = H5T_vlen_reclaim;
|
||||
dset_op.u.app_op.type_id = type_id;
|
||||
|
||||
ret_value = H5S_select_iterate(buf, type, space, &dset_op, vl_alloc_info);
|
||||
|
||||
done:
|
||||
FUNC_LEAVE_NOAPI(ret_value)
|
||||
|
@ -545,8 +545,6 @@ H5_DLL herr_t H5D__alloc_storage(const H5D_t *dset, hid_t dxpl_id, H5D_time_allo
|
||||
hbool_t full_overwrite, hsize_t old_dim[]);
|
||||
H5_DLL herr_t H5D__get_storage_size(H5D_t *dset, hid_t dxpl_id, hsize_t *storage_size);
|
||||
H5_DLL haddr_t H5D__get_offset(const H5D_t *dset);
|
||||
H5_DLL herr_t H5D__iterate(void *buf, hid_t type_id, const H5S_t *space,
|
||||
H5D_operator_t op, void *operator_data);
|
||||
H5_DLL void *H5D__vlen_get_buf_size_alloc(size_t size, void *info);
|
||||
H5_DLL herr_t H5D__vlen_get_buf_size(void *elem, hid_t type_id, unsigned ndim,
|
||||
const hsize_t *point, void *op_data);
|
||||
|
@ -31,6 +31,7 @@
|
||||
#include "H5Gprivate.h" /* Groups */
|
||||
#include "H5Oprivate.h" /* Object headers */
|
||||
#include "H5Pprivate.h" /* Property lists */
|
||||
#include "H5Tprivate.h" /* Datatypes */
|
||||
|
||||
/* Flags for H5S_find */
|
||||
#define H5S_CONV_PAR_IO_POSSIBLE 0x0001
|
||||
@ -115,6 +116,29 @@ typedef struct H5S_sel_iter_t {
|
||||
} u;
|
||||
} H5S_sel_iter_t;
|
||||
|
||||
/* Selection iteration operator for internal library callbacks */
|
||||
typedef herr_t (*H5S_sel_iter_lib_op_t)(void *elem, const H5T_t *type,
|
||||
unsigned ndim, const hsize_t *point, void *op_data);
|
||||
|
||||
/* Describe kind of callback to make */
|
||||
typedef enum H5S_sel_iter_op_type_t {
|
||||
H5S_SEL_ITER_OP_APP, /* Application callback */
|
||||
H5S_SEL_ITER_OP_LIB /* Library internal callback */
|
||||
} H5S_sel_iter_op_type_t;
|
||||
|
||||
typedef struct H5S_sel_iter_app_op_t {
|
||||
H5D_operator_t op; /* Callback */
|
||||
hid_t type_id; /* Type ID to be passed to callback */
|
||||
} H5S_sel_iter_app_op_t;
|
||||
|
||||
typedef struct H5S_sel_iter_op_t {
|
||||
H5S_sel_iter_op_type_t op_type;
|
||||
union {
|
||||
H5S_sel_iter_app_op_t app_op; /* Application callback */
|
||||
H5S_sel_iter_lib_op_t lib_op; /* Library internal callback */
|
||||
} u;
|
||||
} H5S_sel_iter_op_t;
|
||||
|
||||
/* If the module using this macro is allowed access to the private variables, access them directly */
|
||||
#ifdef H5S_MODULE
|
||||
#define H5S_GET_EXTENT_TYPE(S) ((S)->extent.type)
|
||||
@ -213,8 +237,8 @@ H5_DLL herr_t H5S_extent_copy(H5S_t *dst, const H5S_t *src);
|
||||
/* Operations on selections */
|
||||
H5_DLL herr_t H5S_select_deserialize(H5S_t **space, const uint8_t **p);
|
||||
H5_DLL H5S_sel_type H5S_get_select_type(const H5S_t *space);
|
||||
H5_DLL herr_t H5S_select_iterate(void *buf, hid_t type_id, const H5S_t *space,
|
||||
H5D_operator_t op, void *operator_data);
|
||||
H5_DLL herr_t H5S_select_iterate(void *buf, const H5T_t *type, const H5S_t *space,
|
||||
const H5S_sel_iter_op_t *op, void *op_data);
|
||||
H5_DLL herr_t H5S_select_fill(const void *fill, size_t fill_size,
|
||||
const H5S_t *space, void *buf);
|
||||
H5_DLL htri_t H5S_select_valid(const H5S_t *space);
|
||||
|
@ -1338,9 +1338,9 @@ H5S_select_iter_release(H5S_sel_iter_t *sel_iter)
|
||||
PURPOSE
|
||||
Iterate over the selected elements in a memory buffer.
|
||||
USAGE
|
||||
herr_t H5S_select_iterate(buf, type_id, space, operator, operator_data)
|
||||
herr_t H5S_select_iterate(buf, type, space, operator, operator_data)
|
||||
void *buf; IN/OUT: Buffer containing elements to iterate over
|
||||
hid_t type_id; IN: Datatype ID of BUF array.
|
||||
H5T_t *type; IN: Datatype of BUF array.
|
||||
H5S_t *space; IN: Dataspace object containing selection to iterate over
|
||||
H5D_operator_t op; IN: Function pointer to the routine to be
|
||||
called for each element in BUF iterated over.
|
||||
@ -1361,10 +1361,9 @@ H5S_select_iter_release(H5S_sel_iter_t *sel_iter)
|
||||
the selection is not modified.
|
||||
--------------------------------------------------------------------------*/
|
||||
herr_t
|
||||
H5S_select_iterate(void *buf, hid_t type_id, const H5S_t *space, H5D_operator_t op,
|
||||
void *operator_data)
|
||||
H5S_select_iterate(void *buf, const H5T_t *type, const H5S_t *space,
|
||||
const H5S_sel_iter_op_t *op, void *op_data)
|
||||
{
|
||||
H5T_t *dt; /* Datatype structure */
|
||||
H5S_sel_iter_t iter; /* Selection iteration info */
|
||||
hbool_t iter_init = FALSE; /* Selection iteration info has been initialized */
|
||||
hssize_t nelmts; /* Number of elements in selection */
|
||||
@ -1379,14 +1378,12 @@ H5S_select_iterate(void *buf, hid_t type_id, const H5S_t *space, H5D_operator_t
|
||||
|
||||
/* Check args */
|
||||
HDassert(buf);
|
||||
HDassert(H5I_DATATYPE == H5I_get_type(type_id));
|
||||
HDassert(type);
|
||||
HDassert(space);
|
||||
HDassert(op);
|
||||
|
||||
/* Get the datatype size */
|
||||
if(NULL == (dt = (H5T_t *)H5I_object_verify(type_id, H5I_DATATYPE)))
|
||||
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not an valid base datatype")
|
||||
if(0 == (elmt_size = H5T_get_size(dt)))
|
||||
if(0 == (elmt_size = H5T_get_size(type)))
|
||||
HGOTO_ERROR(H5E_DATATYPE, H5E_BADSIZE, FAIL, "datatype size invalid")
|
||||
|
||||
/* Initialize iterator */
|
||||
@ -1450,8 +1447,19 @@ H5S_select_iterate(void *buf, hid_t type_id, const H5S_t *space, H5D_operator_t
|
||||
/* Get the location within the user's buffer */
|
||||
loc = (unsigned char *)buf + curr_off;
|
||||
|
||||
/* Call user's callback routine */
|
||||
user_ret = (*op)(loc, type_id, ndims, coords, operator_data);
|
||||
/* Check which type of callback to make */
|
||||
switch(op->op_type) {
|
||||
case H5S_SEL_ITER_OP_APP:
|
||||
/* Make the application callback */
|
||||
user_ret = (op->u.app_op.op)(loc, op->u.app_op.type_id, ndims, coords, op_data);
|
||||
break;
|
||||
case H5S_SEL_ITER_OP_LIB:
|
||||
/* Call the library's callback */
|
||||
user_ret = (op->u.lib_op)(loc, type, ndims, coords, op_data);
|
||||
break;
|
||||
default:
|
||||
HGOTO_ERROR(H5E_DATASPACE, H5E_UNSUPPORTED, FAIL, "unsupported op type")
|
||||
} /* end switch */
|
||||
|
||||
/* Increment offset in dataspace */
|
||||
curr_off += elmt_size;
|
||||
|
@ -1159,6 +1159,7 @@ if (HDF5_TEST_VFD)
|
||||
set_tests_properties (VFD-${vfdname}-flush2 PROPERTIES DEPENDS VFD-${vfdname}-flush1)
|
||||
set_tests_properties (VFD-${vfdname}-flush1 PROPERTIES TIMEOUT 10)
|
||||
set_tests_properties (VFD-${vfdname}-flush2 PROPERTIES TIMEOUT 10)
|
||||
set_tests_properties (VFD-${vfdname}-istore PROPERTIES TIMEOUT 1800)
|
||||
if (NOT CYGWIN)
|
||||
set_tests_properties (VFD-${vfdname}-cache PROPERTIES TIMEOUT 1800)
|
||||
endif (NOT CYGWIN)
|
||||
@ -1166,6 +1167,7 @@ if (HDF5_TEST_VFD)
|
||||
set_tests_properties (VFD-${vfdname}-flush2-shared PROPERTIES DEPENDS VFD-${vfdname}-flush1-shared)
|
||||
set_tests_properties (VFD-${vfdname}-flush1-shared PROPERTIES TIMEOUT 10)
|
||||
set_tests_properties (VFD-${vfdname}-flush2-shared PROPERTIES TIMEOUT 10)
|
||||
set_tests_properties (VFD-${vfdname}-istore-shared PROPERTIES TIMEOUT 1800)
|
||||
if (NOT CYGWIN)
|
||||
set_tests_properties (VFD-${vfdname}-cache-shared PROPERTIES TIMEOUT 1800)
|
||||
endif (NOT CYGWIN)
|
||||
|
Loading…
x
Reference in New Issue
Block a user