diff options
author | Binh-Minh Ribler <bmribler@hdfgroup.org> | 2001-10-31 16:01:35 (GMT) |
---|---|---|
committer | Binh-Minh Ribler <bmribler@hdfgroup.org> | 2001-10-31 16:01:35 (GMT) |
commit | 1398cc0eef0cfcc69835edb5831681a573aadd14 (patch) | |
tree | acad548811604bafb7842c394573647116add890 /c++/src | |
parent | 356626bd348bb62193fffa2bfe63f2cc8c319fde (diff) | |
download | hdf5-1398cc0eef0cfcc69835edb5831681a573aadd14.zip hdf5-1398cc0eef0cfcc69835edb5831681a573aadd14.tar.gz hdf5-1398cc0eef0cfcc69835edb5831681a573aadd14.tar.bz2 |
[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
Diffstat (limited to 'c++/src')
-rw-r--r-- | c++/src/H5Exception.cpp | 2 | ||||
-rw-r--r-- | c++/src/H5PredType.cpp | 9 | ||||
-rw-r--r-- | c++/src/H5PredType.h | 7 | ||||
-rw-r--r-- | c++/src/H5RefCounter.cpp | 1 |
4 files changed, 14 insertions, 5 deletions
diff --git a/c++/src/H5Exception.cpp b/c++/src/H5Exception.cpp index 86b399f..045be68 100644 --- a/c++/src/H5Exception.cpp +++ b/c++/src/H5Exception.cpp @@ -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 diff --git a/c++/src/H5PredType.cpp b/c++/src/H5PredType.cpp index 0d0ddcb..d883ba5 100644 --- a/c++/src/H5PredType.cpp +++ b/c++/src/H5PredType.cpp @@ -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 diff --git a/c++/src/H5PredType.h b/c++/src/H5PredType.h index 341954a..eabb34a 100644 --- a/c++/src/H5PredType.h +++ b/c++/src/H5PredType.h @@ -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 } diff --git a/c++/src/H5RefCounter.cpp b/c++/src/H5RefCounter.cpp index 61fcff4..22d5cd5 100644 --- a/c++/src/H5RefCounter.cpp +++ b/c++/src/H5RefCounter.cpp @@ -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 |