diff options
author | Binh-Minh Ribler <bmribler@hdfgroup.org> | 2001-03-25 04:37:22 (GMT) |
---|---|---|
committer | Binh-Minh Ribler <bmribler@hdfgroup.org> | 2001-03-25 04:37:22 (GMT) |
commit | ba6cba5d30f35b2b75e36477041f8c82df68ea30 (patch) | |
tree | d9c731155c569f7b4a1870bfa682969faf19b920 /c++/src/H5PredType.h | |
parent | 4432a558f91d7eb81a3eea9b0c6155b62b4ce342 (diff) | |
download | hdf5-ba6cba5d30f35b2b75e36477041f8c82df68ea30.zip hdf5-ba6cba5d30f35b2b75e36477041f8c82df68ea30.tar.gz hdf5-ba6cba5d30f35b2b75e36477041f8c82df68ea30.tar.bz2 |
[svn-r3707] Purpose: Bug fixes and code clean up
Description and Solution:
- Predefined type objects become outdated when the application calls
H5close and then H5open to use the library again.
Solution:
+ Reimplemented PredType using enum type to obtain up-to-date
values for predefined types, i.e. H5T_xxx_yyy's, when they
are used.
+ Added to PredType its own version of getId() to return the
appropriate predefined type id according to the enum value.
+ Made IdComponent::getId() a virtual function
- Since Albert already fixed the "multiply defined RcsId" problem,
removed the now become unnessary "#undef RCSID" from H5Include.h
- Added a check for func_name != NULL in one of the Exception
constructors because seg. fault. might occur in some situations.
- It is more convenient to make a copy of a datatype, dataspace,
or property list by using assignment operator
Solution:
+ Added assignment operator to DataType, DataSpace, and
PropList so that they will invoke H5Tcopy, H5Scopy,
and H5Pcopy, respectively, instead of just simply
copying the data members as for other classes. So,
now a type, space, or property list can be copied by
either :
mytype = original_type, or
mytype.copy(original_type)
Note that copy constructors are still just copying the
data members.
+ Added an assignment operator to DataType that takes a
predefined type.
+ Made IdComponent::operator= a virtual function
Platforms tested:
arabica (sparc-sun-solaris 2.7)
Diffstat (limited to 'c++/src/H5PredType.h')
-rw-r--r-- | c++/src/H5PredType.h | 52 |
1 files changed, 51 insertions, 1 deletions
diff --git a/c++/src/H5PredType.h b/c++/src/H5PredType.h index 552605a..341954a 100644 --- a/c++/src/H5PredType.h +++ b/c++/src/H5PredType.h @@ -19,6 +19,8 @@ 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 // Declaration of predefined types; their definition is in Predtype.C static const PredType STD_I8BE; @@ -167,7 +169,55 @@ class PredType : public AtomType { private: // added this to work around the atexit/global destructor problem // temporarily - it'll prevent the use of atexit to clean up - static const PredType NotAtexit; + static const PredType NotAtexit; // not working yet + + // This enum type is used by this class only to handle the + // global PredType objects. These values will ensure that the + // application receives an appropriate and uptodated id for an + // HDF5 predefined type; particularly usefull when the application + // closes and opens the library again. + enum predefined_types { + + INVALID = 0, E_C_S1 = 1, E_FORTRAN_S1, + + E_STD_I8BE, E_STD_I8LE, E_STD_I16BE, E_STD_I16LE, E_STD_I32BE, + E_STD_I32LE, E_STD_I64BE, E_STD_I64LE, E_STD_U8BE, E_STD_U8LE, + E_STD_U16BE, E_STD_U16LE, E_STD_U32BE, E_STD_U32LE, E_STD_U64BE, + E_STD_U64LE, E_STD_B8BE, E_STD_B8LE, E_STD_B16BE, E_STD_B16LE, + E_STD_B32BE, E_STD_B32LE, E_STD_B64BE, E_STD_B64LE, E_STD_REF_OBJ, + E_STD_REF_DSETREG, + + E_IEEE_F32BE, E_IEEE_F32LE, E_IEEE_F64BE, E_IEEE_F64LE, + + E_UNIX_D32BE, E_UNIX_D32LE, E_UNIX_D64BE, E_UNIX_D64LE, + + E_INTEL_I8, E_INTEL_I16, E_INTEL_I32, E_INTEL_I64, E_INTEL_U8, + E_INTEL_U16, E_INTEL_U32, E_INTEL_U64, E_INTEL_B8, E_INTEL_B16, + E_INTEL_B32, E_INTEL_B64, E_INTEL_F32, E_INTEL_F64, + + E_ALPHA_I8, E_ALPHA_I16, E_ALPHA_I32, E_ALPHA_I64, E_ALPHA_U8, + E_ALPHA_U16, E_ALPHA_U32, E_ALPHA_U64, E_ALPHA_B8, E_ALPHA_B16, + E_ALPHA_B32, E_ALPHA_B64, E_ALPHA_F32, E_ALPHA_F64, + + E_MIPS_I8, E_MIPS_I16, E_MIPS_I32, E_MIPS_I64, E_MIPS_U8, + E_MIPS_U16, E_MIPS_U32, E_MIPS_U64, E_MIPS_B8, E_MIPS_B16, + E_MIPS_B32, E_MIPS_B64, E_MIPS_F32, E_MIPS_F64, + + E_NATIVE_CHAR, E_NATIVE_INT, E_NATIVE_FLOAT, E_NATIVE_SCHAR, + E_NATIVE_UCHAR, E_NATIVE_SHORT, E_NATIVE_USHORT, E_NATIVE_UINT, + E_NATIVE_LONG, E_NATIVE_ULONG, E_NATIVE_LLONG, E_NATIVE_ULLONG, + E_NATIVE_DOUBLE, E_NATIVE_LDOUBLE, E_NATIVE_B8, E_NATIVE_B16, + E_NATIVE_B32, E_NATIVE_B64, E_NATIVE_OPAQUE, E_NATIVE_HSIZE, + E_NATIVE_HSSIZE, E_NATIVE_HERR, E_NATIVE_HBOOL, E_NATIVE_INT8, + E_NATIVE_UINT8, E_NATIVE_INT_LEAST8, E_NATIVE_UINT_LEAST8, + E_NATIVE_INT_FAST8, E_NATIVE_UINT_FAST8, E_NATIVE_INT16, + E_NATIVE_UINT16, E_NATIVE_INT_LEAST16, E_NATIVE_UINT_LEAST16, + E_NATIVE_INT_FAST16, E_NATIVE_UINT_FAST16, E_NATIVE_INT32, + E_NATIVE_UINT32, E_NATIVE_INT_LEAST32, E_NATIVE_UINT_LEAST32, + E_NATIVE_INT_FAST32, E_NATIVE_UINT_FAST32, E_NATIVE_INT64, + E_NATIVE_UINT64, E_NATIVE_INT_LEAST64, E_NATIVE_UINT_LEAST64, + E_NATIVE_INT_FAST64, E_NATIVE_UINT_FAST64 + }; protected: // Default constructor |