[svn-r4580]

Purpose:
    Bug fixing
Description:
    + added operator= to PredType
    + removed 'using namespace std' from H5RefCounter.cpp because it's not
        used and leaving it there requires #include some standard header file
    + added 'using namespace std' in H5Exception.cpp

Platforms tested:
    SunOS 5.7 (arabica)
    Windows 98
This commit is contained in:
Binh-Minh Ribler 2001-10-31 11:01:35 -05:00
parent 356626bd34
commit 1398cc0eef
4 changed files with 14 additions and 5 deletions

View File

@ -5,11 +5,11 @@
#endif
#include "H5Include.h"
#include <string>
#include "H5Exception.h"
#ifndef H5_NO_NAMESPACE
namespace H5 {
using namespace std;
#endif
// Default constructor

View File

@ -27,6 +27,13 @@ PredType::PredType( const hid_t predtype_id ) : AtomType( predtype_id )
// Copy constructor: makes a copy of this PredType object.
PredType::PredType( const PredType& original ) : AtomType( original ) {}
// Makes a copy of the predefined type and stores the new
// id in the left hand side object.
DataType& PredType::operator=( const PredType& rhs )
{
return(DataType::operator=(rhs));
}
const PredType PredType::NotAtexit; // only for atexit/global dest. problem
// Definition of pre-defined types
@ -461,7 +468,7 @@ void PredType::commit( H5Object& loc, const string& name )
bool PredType::committed()
{
throw DataTypeIException("PredType::committed", "Error: Attempting to check for commit status on a predefined datatype." );
return (-1);
return (0);
}
// Default destructor

View File

@ -19,8 +19,7 @@ class PredType : public AtomType {
// Copy constructor - makes copy of the original object
PredType( const PredType& original );
virtual hid_t getId() const;
hid_t getenum() const { return id; } // remove when done
virtual hid_t getId() const;
// Declaration of predefined types; their definition is in Predtype.C
static const PredType STD_I8BE;
@ -225,6 +224,10 @@ hid_t getenum() const { return id; } // remove when done
// Creates a pre-defined type using an HDF5 pre-defined constant
PredType( const hid_t predtype_id ); // used by the library only
// Makes a copy of the predefined type and stores the new
// id in the left hand side object.
DataType& operator=( const PredType& rhs );
};
#ifndef H5_NO_NAMESPACE
}

View File

@ -2,7 +2,6 @@
#ifndef H5_NO_NAMESPACE
namespace H5 {
using namespace std;
#endif
// Creates a reference counter to be used by an HDF5 object