[svn-r10050] Purpose: Fix bugzilla #241

Description:
    Checked return value from C API for failure condition.
    Added/Modified some comments appropriately.

Platforms tested:
    Linux 2.4 (heping)
    AIX 5.1 (copper) - tests passed but there were some old warnings about
			duplicate symbols on std::string; I'll check on that.
This commit is contained in:
Binh-Minh Ribler 2005-02-20 15:45:44 -05:00
parent 322297809c
commit 6f2de2c62c
7 changed files with 38 additions and 6 deletions

View File

@ -260,6 +260,9 @@ string Attribute::getName() const
// Function: Attribute destructor
///\brief Properly terminates access to this attribute.
// Programmer Binh-Minh Ribler - 2000
// Modification
// Replaced resetIdComponent with decRefCount to use new ID
// reference counting mechanisms by Quincey Koziol, June 1, 2004
//--------------------------------------------------------------------------
Attribute::~Attribute()
{

View File

@ -482,6 +482,9 @@ DataSpace DataSet::getRegion(void *ref, H5R_type_t ref_type) const
// Function: DataSet destructor
///\brief Properly terminates access to this dataset.
// Programmer Binh-Minh Ribler - 2000
// Modification
// Replaced resetIdComponent with decRefCount to use new ID
// reference counting mechanisms by Quincey Koziol, June 1, 2004
//--------------------------------------------------------------------------
DataSet::~DataSet()
{

View File

@ -93,6 +93,9 @@ DataSpace::DataSpace( const DataSpace& original ) : IdComponent( original ) {}
///\param like_space - IN: Dataspace to be copied
///\exception H5::DataSpaceIException
// Programmer Binh-Minh Ribler - 2000
// Modification
// Replaced resetIdComponent with decRefCount to use new ID
// reference counting mechanisms by Quincey Koziol, June 1, 2004
//--------------------------------------------------------------------------
void DataSpace::copy( const DataSpace& like_space )
{
@ -538,6 +541,9 @@ void DataSpace::selectHyperslab( H5S_seloper_t op, const hsize_t *count, const h
// Function: DataSpace destructor
///\brief Properly terminates access to this dataspace.
// Programmer Binh-Minh Ribler - 2000
// Modification
// Replaced resetIdComponent with decRefCount to use new ID
// reference counting mechanisms by Quincey Koziol, June 1, 2004
//--------------------------------------------------------------------------
DataSpace::~DataSpace()
{

View File

@ -94,6 +94,9 @@ DataType::DataType(const DataType& original) : H5Object(original)
///\param like_type - IN: Datatype to be copied
///\exception H5::DataTypeIException
// Programmer Binh-Minh Ribler - 2000
// Modification
// Replaced resetIdComponent with decRefCount to use new ID
// reference counting mechanisms by Quincey Koziol, June 1, 2004
//--------------------------------------------------------------------------
void DataType::copy( const DataType& like_type )
{
@ -598,6 +601,9 @@ DataSpace DataType::getRegion(void *ref, H5R_type_t ref_type) const
// Function: DataType destructor
///\brief Properly terminates access to this datatype.
// Programmer Binh-Minh Ribler - 2000
// Modification
// Replaced resetIdComponent with decRefCount to use new ID
// reference counting mechanisms by Quincey Koziol, June 1, 2004
//--------------------------------------------------------------------------
DataType::~DataType()
{

View File

@ -181,11 +181,16 @@ bool H5File::isHdf5(const string& name )
// If this object has represented another HDF5 file, the previous
// HDF5 file need to be closed first.
// Programmer Binh-Minh Ribler - 2000
// Modification
// Replaced resetIdComponent with decRefCount to use new ID
// reference counting mechanisms by Quincey Koziol, June 1, 2004
// Note: This wrapper doesn't seem right regarding the 'id' and should
// be investigated. BMR - 2/20/2005
//--------------------------------------------------------------------------
void H5File::reOpen()
{
// reset the identifier of this H5File - send 'this' in so that
// H5Fclose can be called appropriately
// If this object has a valid id, appropriately decrement reference
// counter and close the id.
try {
decRefCount();
}
@ -551,6 +556,9 @@ void H5File::throwException(const string func_name, const string msg) const
// Function: H5File destructor
///\brief Properly terminates access to this file.
// Programmer Binh-Minh Ribler - 2000
// Modification
// Replaced resetIdComponent with decRefCount to use new ID
// reference counting mechanisms by Quincey Koziol, June 1, 2004
//--------------------------------------------------------------------------
H5File::~H5File()
{

View File

@ -166,6 +166,9 @@ void Group::throwException(const string func_name, const string msg) const
// Function: Group destructor
///\brief Properly terminates access to this group.
// Programmer Binh-Minh Ribler - 2000
// Modification
// Replaced resetIdComponent with decRefCount to use new ID
// reference counting mechanisms by Quincey Koziol, June 1, 2004
//--------------------------------------------------------------------------
Group::~Group()
{

View File

@ -86,11 +86,14 @@ PropList::PropList( const hid_t plist_id ) : IdComponent(0)
///\param like_plist - IN: Reference to the existing property list
///\exception H5::PropListIException
// Programmer Binh-Minh Ribler - 2000
// Modification
// Replaced resetIdComponent with decRefCount to use new ID
// reference counting mechanisms by Quincey Koziol, June 1, 2004
//--------------------------------------------------------------------------
void PropList::copy( const PropList& like_plist )
{
// reset the identifier of this PropList - send 'this' in so that
// H5Pclose can be called appropriately
// If this object has a valid id, appropriately decrement reference
// counter and close the id.
try {
decRefCount();
}
@ -324,7 +327,7 @@ size_t PropList::getPropSize(const char *name) const
{
size_t prop_size;
herr_t ret_value = H5Pget_size(id, name, &prop_size);
if (prop_size < 0)
if (ret_value < 0)
{
throw PropListIException("PropList::getPropSize", "H5Pget_size failed");
}
@ -376,7 +379,7 @@ size_t PropList::getNumProps() const
{
size_t nprops;
herr_t ret_value = H5Pget_nprops (id, &nprops);
if( nprops < 0 )
if (ret_value < 0)
{
throw PropListIException("PropList::getNumProps", "H5Pget_nprops failed");
}