diff options
author | Binh-Minh Ribler <bmribler@hdfgroup.org> | 2004-07-26 22:35:18 (GMT) |
---|---|---|
committer | Binh-Minh Ribler <bmribler@hdfgroup.org> | 2004-07-26 22:35:18 (GMT) |
commit | 954e4f48178656d45a0fa7e20ab5328b6f900bbc (patch) | |
tree | d5b10bf0cf96e6a2846160cee3dbcdc726082732 | |
parent | 231d363a5cf8b59d9c15498cd14fadee5471bcc4 (diff) | |
download | hdf5-954e4f48178656d45a0fa7e20ab5328b6f900bbc.zip hdf5-954e4f48178656d45a0fa7e20ab5328b6f900bbc.tar.gz hdf5-954e4f48178656d45a0fa7e20ab5328b6f900bbc.tar.bz2 |
[svn-r8950] Purpose: Updated documentation
Description:
Updated various function headers for the RM.
Added DOXYGEN_SHOULD_SKIP_THIS to selectively un-display some
info, that shouldn't be needed by application users.
Added mainpage to the RM via the new file H5CppDoc.h
Platforms tested:
SunOS 5.7 (arabica)
Linux 2.4 (verbena)
The new file will be added to windows project soon.
Misc. update:
-rw-r--r-- | c++/src/H5Attribute.cpp | 16 | ||||
-rw-r--r-- | c++/src/H5Attribute.h | 2 | ||||
-rw-r--r-- | c++/src/H5CommonFG.cpp | 4 | ||||
-rw-r--r-- | c++/src/H5CommonFG.h | 6 | ||||
-rw-r--r-- | c++/src/H5CppDoc.h | 70 | ||||
-rw-r--r-- | c++/src/H5DataSet.cpp | 12 | ||||
-rw-r--r-- | c++/src/H5DataSet.h | 2 | ||||
-rw-r--r-- | c++/src/H5DataSpace.cpp | 32 | ||||
-rw-r--r-- | c++/src/H5DataSpace.h | 2 | ||||
-rw-r--r-- | c++/src/H5DataType.cpp | 13 | ||||
-rw-r--r-- | c++/src/H5DataType.h | 3 | ||||
-rw-r--r-- | c++/src/H5DcreatProp.cpp | 4 | ||||
-rw-r--r-- | c++/src/H5DxferProp.cpp | 8 | ||||
-rw-r--r-- | c++/src/H5Exception.cpp | 72 | ||||
-rw-r--r-- | c++/src/H5File.cpp | 12 | ||||
-rw-r--r-- | c++/src/H5File.h | 2 | ||||
-rw-r--r-- | c++/src/H5Group.cpp | 15 | ||||
-rw-r--r-- | c++/src/H5Group.h | 14 | ||||
-rw-r--r-- | c++/src/H5IdComponent.cpp | 84 | ||||
-rw-r--r-- | c++/src/H5IdComponent.h | 15 | ||||
-rw-r--r-- | c++/src/H5Library.cpp | 3 | ||||
-rw-r--r-- | c++/src/H5Library.h | 2 | ||||
-rw-r--r-- | c++/src/H5Object.h | 2 | ||||
-rw-r--r-- | c++/src/H5PropList.cpp | 12 | ||||
-rw-r--r-- | c++/src/H5PropList.h | 2 | ||||
-rw-r--r-- | c++/src/H5RefCounter.cpp | 2 |
26 files changed, 282 insertions, 129 deletions
diff --git a/c++/src/H5Attribute.cpp b/c++/src/H5Attribute.cpp index 1e5e919..1b92a6f 100644 --- a/c++/src/H5Attribute.cpp +++ b/c++/src/H5Attribute.cpp @@ -258,14 +258,15 @@ string Attribute::getName() const return( attr_name ); } +#ifndef DOXYGEN_SHOULD_SKIP_THIS //-------------------------------------------------------------------------- -// Function: Attribute::p_close (private) -///\brief Closes this attribute. -///\exception H5::AttributeIException -///\note -/// This function will be obsolete because its functionality -/// is recently handled by the C library layer. - May, 2004 -// Programmer Binh-Minh Ribler - 2000 +// Function: Attribute::p_close (private) +// Purpose: Closes this attribute. +// Exception H5::AttributeIException +// Description +// This function will be obsolete because its functionality +// is recently handled by the C library layer. - May, 2004 +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- void Attribute::p_close() const { @@ -275,6 +276,7 @@ void Attribute::p_close() const throw AttributeIException(0, "H5Aclose failed"); } } +#endif // DOXYGEN_SHOULD_SKIP_THIS //-------------------------------------------------------------------------- // Function: Attribute destructor diff --git a/c++/src/H5Attribute.h b/c++/src/H5Attribute.h index 8b06a8b..8c15227 100644 --- a/c++/src/H5Attribute.h +++ b/c++/src/H5Attribute.h @@ -41,8 +41,10 @@ class H5_DLLCPP Attribute : public AbstractDs { // do not inherit iterateAttrs from H5Object int iterateAttrs() { return 0; } +#ifndef DOXYGEN_SHOULD_SKIP_THIS // Used by the API to appropriately close an attribute virtual void p_close() const; +#endif // DOXYGEN_SHOULD_SKIP_THIS // Creates a copy of an existing attribute using the attribute id Attribute( const hid_t attr_id ); diff --git a/c++/src/H5CommonFG.cpp b/c++/src/H5CommonFG.cpp index ee3e299..6d60c6d 100644 --- a/c++/src/H5CommonFG.cpp +++ b/c++/src/H5CommonFG.cpp @@ -757,7 +757,7 @@ hsize_t CommonFG::getNumObjs() const //-------------------------------------------------------------------------- // Function: CommonFG::getObjnameByIdx -///\brief Retrieves the name of an object in this group by giving the +///\brief Retrieves the name of an object in this group, given the /// object's index. ///\param idx - IN: Transient index of the object ///\param name - IN/OUT: Retrieved name of the object @@ -787,7 +787,7 @@ ssize_t CommonFG::getObjnameByIdx(hsize_t idx, string& name, size_t size) const //-------------------------------------------------------------------------- // Function: CommonFG::getObjTypeByIdx -///\brief Returns the type of an object in this group by giving the +///\brief Returns the type of an object in this group, given the /// object's index. ///\param idx - IN: Transient index of the object ///\return Object type diff --git a/c++/src/H5CommonFG.h b/c++/src/H5CommonFG.h index 9a51015..cde7c89 100644 --- a/c++/src/H5CommonFG.h +++ b/c++/src/H5CommonFG.h @@ -53,7 +53,7 @@ class H5_DLLCPP CommonFG { void unlink(const char* name) const; void unlink(const string& name) const; - /// For subclasses to get the correct object id, i.e. file or group id. + /// For subclasses to return the correct object id, i.e. file or group id. virtual hid_t getLocId() const = 0; // Renames an object at this location. @@ -117,11 +117,11 @@ class H5_DLLCPP CommonFG { // Returns the number of objects in this group. hsize_t getNumObjs() const; - // Retrieves the name of an object in this group by giving the + // Retrieves the name of an object in this group, given the // object's index. ssize_t getObjnameByIdx(hsize_t idx, string& name, size_t size) const; - // Returns the type of an object in this group by giving the + // Returns the type of an object in this group, given the // object's index. H5G_obj_t getObjTypeByIdx(hsize_t idx) const; H5G_obj_t getObjTypeByIdx(hsize_t idx, string& type_name) const; diff --git a/c++/src/H5CppDoc.h b/c++/src/H5CppDoc.h new file mode 100644 index 0000000..5ecd87a --- /dev/null +++ b/c++/src/H5CppDoc.h @@ -0,0 +1,70 @@ +// C++ informative line for the emacs editor: -*- C++ -*- +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * Copyright by the Board of Trustees of the University of Illinois. * + * All rights reserved. * + * * + * This file is part of HDF5. The full HDF5 copyright notice, including * + * terms governing use, modification, and redistribution, is contained in * + * the files COPYING and Copyright.html. COPYING can be found at the root * + * of the source code distribution tree; Copyright.html can be found at the * + * root level of an installed copy of the electronic HDF5 document set and * + * is linked from the top-level documents page. It can also be found at * + * http://hdf.ncsa.uiuc.edu/HDF5/doc/Copyright.html. If you do not have * + * access to either file, you may request a copy from hdfhelp@ncsa.uiuc.edu. * + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +#ifndef _H5CPPDOC_H +#define _H5CPPDOC_H + +//------------------------------------------------------------------------- +// The following section will be used to generate the 'Mainpage' +// and the 'Examples' for the RM. +// ------------------------------------------------------------------------ + +/*! \mainpage notitle + * + * \section intro_sec Introduction + * + * The C++ API provides C++ wrappers for the HDF5 C library. + * It is assumed that the user has knowledge of the HDF5 file format + * and its components. If you are not familiar with HDF5 file format, + * and would like to find out more, please refer to the HDF5 documentation + * at http://hdf.ncsa.uiuc.edu/HDF5/doc/H5.intro.html + * + * Because the HDF5 library maps very well to + * the object oriented design approach, classes in the C++ API can + * closely represent the interfaces of the HDF5 APIs, as followed: + * + * \verbatim + HDF5 C APIs C++ Classes + ----------- ----------- + Attribute Interface (H5A) Attribute + Datasets Interface (H5D) DataSet + Error Interface (H5E) Exception + File Interface (H5F) H5File + Group Interface (H5G) Group + Identifier Interface (H5I) IdComponent + Property List Interface (H5P) PropList + Reference Interface (H5R) Reference + Dataspace Interface (H5S) DataSpace + Datatype Interface (H5T) DataType + Filters and Compression Interface (H5Z) FilterCompress (not done) + \endverbatim + * \section install_sec Installation + * + * Please refer to the file release_docs/INSTALL + * under the top directory for information about installing, building, + * and testing the C++ API. + * + * + */ + +///\par Dataset example: +/// This example shows how to create datasets. +///\example create.cpp + +///\par Another example: +/// This example shows how to write datasets. +///\example writedata.cpp + +#endif diff --git a/c++/src/H5DataSet.cpp b/c++/src/H5DataSet.cpp index 5b38621..f344308 100644 --- a/c++/src/H5DataSet.cpp +++ b/c++/src/H5DataSet.cpp @@ -480,13 +480,14 @@ DataSpace DataSet::getRegion(void *ref, H5R_type_t ref_type) const return(dataspace); } +#ifndef DOXYGEN_SHOULD_SKIP_THIS //-------------------------------------------------------------------------- // Function: DataSet::p_close (private) -///\brief Closes this dataset. -///\exception H5::DataSetIException -///\note -/// This function will be obsolete because its functionality -/// is recently handled by the C library layer. +// Purpose: Closes this dataset. +// Exception H5::DataSetIException +// Description +// This function will be obsolete because its functionality +// is recently handled by the C library layer. - May, 2004 // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- void DataSet::p_close() const @@ -497,6 +498,7 @@ void DataSet::p_close() const throw DataSetIException(0, "H5Dclose failed"); } } +#endif // DOXYGEN_SHOULD_SKIP_THIS //-------------------------------------------------------------------------- // Function: DataSet destructor diff --git a/c++/src/H5DataSet.h b/c++/src/H5DataSet.h index c12a539..85aa974 100644 --- a/c++/src/H5DataSet.h +++ b/c++/src/H5DataSet.h @@ -82,8 +82,10 @@ class H5_DLLCPP DataSet : public AbstractDs { // Creates a copy of an existing DataSet using its id. DataSet(const hid_t existing_id); +#ifndef DOXYGEN_SHOULD_SKIP_THIS // Used by the API to appropriately close a dataset. virtual void p_close() const; +#endif // DOXYGEN_SHOULD_SKIP_THIS // Default constructor. DataSet(); diff --git a/c++/src/H5DataSpace.cpp b/c++/src/H5DataSpace.cpp index 9f35f13..8b6f508 100644 --- a/c++/src/H5DataSpace.cpp +++ b/c++/src/H5DataSpace.cpp @@ -37,14 +37,14 @@ const DataSpace DataSpace::ALL( H5S_ALL ); //-------------------------------------------------------------------------- // Function: DataSpace default constructor -///\brief Default constructor: Creates a stub datatype +///\brief Default constructor: creates a stub dataspace instance. // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- DataSpace::DataSpace() : IdComponent() {} //-------------------------------------------------------------------------- // Function: DataSpace overloaded constructor -///\brief Creates a dataspace given a dataspace type. +///\brief Creates a new dataspace given a dataspace type. ///\param type - IN: Type of the dataspace to be created, which /// currently can be either \c H5S_SCALAR or \c H5S_SIMPLE ///\exception H5::DataSpaceIException @@ -61,7 +61,7 @@ DataSpace::DataSpace( H5S_class_t type ) : IdComponent() //-------------------------------------------------------------------------- // Function: DataSpace overloaded constructor -///\brief Creates a new simple dataspace and opens it for access. +///\brief Creates a new simple dataspace. ///\param rank - IN: Number of dimensions of dataspace. ///\param dims - IN: An array of the size of each dimension. ///\param maxdims - IN: An array of the maximum size of each dimension. @@ -124,7 +124,7 @@ void DataSpace::copy( const DataSpace& like_space ) //-------------------------------------------------------------------------- // Function: DataSpace::operator= -///\brief Assignment operator +///\brief Assignment operator. ///\param rhs - IN: Reference to the existing dataspace ///\return Reference to DataSpace instance ///\exception H5::DataSpaceIException @@ -142,7 +142,7 @@ DataSpace& DataSpace::operator=( const DataSpace& rhs ) //-------------------------------------------------------------------------- // Function: DataSpace::isSimple ///\brief Determines whether this dataspace is a simple dataspace. -///\return true if the dataspace is a simple dataspace, and false, +///\return \c true if the dataspace is a simple dataspace, and \c false, /// otherwise ///\exception H5::DataSpaceIException // Programmer Binh-Minh Ribler - 2000 @@ -266,7 +266,7 @@ H5S_class_t DataSpace::getSimpleExtentType () const //-------------------------------------------------------------------------- // Function: DataSpace::extentCopy ///\brief Copies the extent of a dataspace. -///\param dest_space - IN: DataSpace to copy from +///\param dest_space - IN: Dataspace to copy from ///\exception H5::DataSpaceIException // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- @@ -497,8 +497,8 @@ void DataSpace::selectNone () const // Function: DataSpace::selectValid ///\brief Verifies that the selection is within the extent of the /// dataspace. -///\return true if the selection is within the extent of the -/// dataspace, and false, otherwise +///\return \c true if the selection is within the extent of the +/// dataspace, and \c false, otherwise ///\exception H5::DataSpaceIException // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- @@ -527,8 +527,8 @@ bool DataSpace::selectValid () const ///\exception H5::DataSpaceIException ///\par Description /// For more information, please refer to the C layer Reference -/// Manual at: -/// http: +/// Manual at: +/// http://hdf.ncsa.uiuc.edu/HDF5/doc/RM_H5S.html#Dataspace-SelectHyperslab // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- void DataSpace::selectHyperslab( H5S_seloper_t op, const hsize_t *count, const hssize_t *start, const hsize_t *stride, const hsize_t *block ) const @@ -542,7 +542,16 @@ void DataSpace::selectHyperslab( H5S_seloper_t op, const hsize_t *count, const h } } -// Closes the dataspace if it is not a constant +#ifndef DOXYGEN_SHOULD_SKIP_THIS +//-------------------------------------------------------------------------- +// Function: DataSpace::p_close (private) +// Purpose: Closes the dataspace if it is not a constant. +// Exception H5::DataSpaceIException +// Description +// This function will be obsolete because its functionality +// is recently handled by the C library layer. - May, 2004 +// Programmer Binh-Minh Ribler - 2000 +//-------------------------------------------------------------------------- void DataSpace::p_close() const { hid_t space_id = id; @@ -555,6 +564,7 @@ void DataSpace::p_close() const } } } +#endif // DOXYGEN_SHOULD_SKIP_THIS //-------------------------------------------------------------------------- // Function: DataSpace destructor diff --git a/c++/src/H5DataSpace.h b/c++/src/H5DataSpace.h index 4378f40..c56b7a5 100644 --- a/c++/src/H5DataSpace.h +++ b/c++/src/H5DataSpace.h @@ -103,8 +103,10 @@ class H5_DLLCPP DataSpace : public IdComponent { // or uses a default id to create a default dataspace object DataSpace( const hid_t space_id ); +#ifndef DOXYGEN_SHOULD_SKIP_THIS // Used by the API to close the dataspace void p_close() const; +#endif // DOXYGEN_SHOULD_SKIP_THIS // Default constructor DataSpace(); diff --git a/c++/src/H5DataType.cpp b/c++/src/H5DataType.cpp index d1cb1ee..1f01aa2 100644 --- a/c++/src/H5DataType.cpp +++ b/c++/src/H5DataType.cpp @@ -613,8 +613,16 @@ DataSpace DataType::getRegion(void *ref, H5R_type_t ref_type) const return(dataspace); } -// This private function calls the C API H5Tclose to close this datatype. -// Used by H5Object::p_reset. +#ifndef DOXYGEN_SHOULD_SKIP_THIS +//-------------------------------------------------------------------------- +// Function: DataType::p_close (private) +// Purpose: Closes the datatype if it is not a predefined type. +// Exception H5::DataTypeIException +// Description +// This function will be obsolete because its functionality +// is recently handled by the C library layer. - May, 2004 +// Programmer Binh-Minh Ribler - 2000 +//-------------------------------------------------------------------------- void DataType::p_close() const { // If this datatype is not a predefined type, call H5Tclose on it. @@ -627,6 +635,7 @@ void DataType::p_close() const } } } +#endif // DOXYGEN_SHOULD_SKIP_THIS //-------------------------------------------------------------------------- // Function: DataType destructor diff --git a/c++/src/H5DataType.h b/c++/src/H5DataType.h index d0141f8..6ac6418 100644 --- a/c++/src/H5DataType.h +++ b/c++/src/H5DataType.h @@ -105,8 +105,11 @@ class H5_DLLCPP DataType : public H5Object { // Retrieves a dataspace with the region pointed to selected. DataSpace getRegion(void *ref, H5R_type_t ref_type = H5R_DATASET_REGION) const; + +#ifndef DOXYGEN_SHOULD_SKIP_THIS // Used by the API to appropriately close a datatype void p_close() const; +#endif // DOXYGEN_SHOULD_SKIP_THIS // Creates a copy of an existing DataType using its id DataType( const hid_t type_id, bool predtype = false ); diff --git a/c++/src/H5DcreatProp.cpp b/c++/src/H5DcreatProp.cpp index d2a74f4..b263fa5 100644 --- a/c++/src/H5DcreatProp.cpp +++ b/c++/src/H5DcreatProp.cpp @@ -245,9 +245,9 @@ H5D_fill_value_t DSetCreatPropList::isFillValueDefined() /// during a \c DataSet::read() of the chunk. If this bit is clear /// and the filter fails then the entire I/O operation fails. //-------------------------------------------------------------------------- -void DSetCreatPropList::setFilter( H5Z_filter_t filter, unsigned int flags, size_t cd_nelmts, const unsigned int cd_values[] ) const +void DSetCreatPropList::setFilter( H5Z_filter_t filter_id, unsigned int flags, size_t cd_nelmts, const unsigned int cd_values[] ) const { - herr_t ret_value = H5Pset_filter( id, filter, flags, cd_nelmts, cd_values ); + herr_t ret_value = H5Pset_filter( id, filter_id, flags, cd_nelmts, cd_values ); if( ret_value < 0 ) { throw PropListIException("DSetCreatPropList::setFilter", diff --git a/c++/src/H5DxferProp.cpp b/c++/src/H5DxferProp.cpp index 1f9ade3..5ed6c82 100644 --- a/c++/src/H5DxferProp.cpp +++ b/c++/src/H5DxferProp.cpp @@ -265,9 +265,9 @@ void DSetMemXferPropList::getBtreeRatios( double& left, double& middle, double& //-------------------------------------------------------------------------- // Function: DSetMemXferPropList::setVlenMemManager ///\brief Sets the memory manager for variable-length datatype allocation. -///\param alloc - IN: User's allocate routine +///\param alloc_func - IN: User's allocate routine ///\param alloc_info - IN: User's allocation parameters -///\param free - IN: User's free routine +///\param free_func - IN: User's free routine ///\param free_info - IN: User's free parameters ///\exception H5::PropListIException // Programmer: Binh-Minh Ribler - 2000 @@ -298,9 +298,9 @@ void DSetMemXferPropList::setVlenMemManager() const //-------------------------------------------------------------------------- // Function: DSetMemXferPropList::getVlenMemManager ///\brief Gets the memory manager for variable-length datatype allocation -///\param alloc - OUT: User's allocate routine +///\param alloc_func - OUT: User's allocate routine ///\param alloc_info - OUT: User's allocation parameters -///\param free - OUT: User's free routine +///\param free_func - OUT: User's free routine ///\param free_info - OUT: User's free parameters ///\exception H5::PropListIException // Programmer: Binh-Minh Ribler - 2000 diff --git a/c++/src/H5Exception.cpp b/c++/src/H5Exception.cpp index 196205c..767385d 100644 --- a/c++/src/H5Exception.cpp +++ b/c++/src/H5Exception.cpp @@ -33,8 +33,8 @@ Exception::Exception() : detail_message(""), func_name("") {} //-------------------------------------------------------------------------- // Function: Exception overloaded constructor -///\brief Creates an exception with a function name where the failure -/// occurs and an optional detailed message +///\brief Creates an exception with the name of the function, +/// in which the failure occurs, and an optional detailed message. ///\param func_name - IN: Name of the function where failure occurs ///\param message - IN: Message on the failure ///\exception H5::DataTypeIException @@ -64,11 +64,11 @@ Exception::Exception( const Exception& orig ) /// will be returned. // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -string Exception::getMajorString( H5E_major_t major_num ) const +string Exception::getMajorString(H5E_major_t err_major) const { // calls the C API routine to get the major string - Note: in the // failure case, the string "Invalid major error number" will be returned. - string major_str( H5Eget_major( major_num )); + string major_str(H5Eget_major(err_major)); return( major_str ); } @@ -82,11 +82,11 @@ string Exception::getMajorString( H5E_major_t major_num ) const /// will be returned. // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -string Exception::getMinorString( H5E_minor_t minor_num ) const +string Exception::getMinorString(H5E_minor_t err_minor) const { // calls the C API routine to get the minor string - Note: in the // failure case, the string "Invalid minor error number" will be returned. - string minor_str( H5Eget_minor( minor_num )); + string minor_str(H5Eget_minor(err_minor)); return( minor_str ); } @@ -285,7 +285,7 @@ void Exception::printError( FILE* stream ) const Exception::~Exception() {} //-------------------------------------------------------------------------- -// Subclasses: FileIException +// Subclass: FileIException // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- //-------------------------------------------------------------------------- @@ -295,8 +295,8 @@ Exception::~Exception() {} FileIException::FileIException():Exception(){} //-------------------------------------------------------------------------- // Function: FileIException overloaded constructor -///\brief Creates a FileIException with a function name where the failure -/// occurs and an optional detailed message. +///\brief Creates a FileIException with the name of the function, +/// in which the failure occurs, and an optional detailed message. ///\param func_name - IN: Name of the function where failure occurs ///\param message - IN: Message on the failure //-------------------------------------------------------------------------- @@ -308,7 +308,7 @@ FileIException::FileIException(const string func_name, const string message) : E FileIException::~FileIException() {} //-------------------------------------------------------------------------- -// Subclasses: GroupIException +// Subclass: GroupIException // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- //-------------------------------------------------------------------------- @@ -318,8 +318,8 @@ FileIException::~FileIException() {} GroupIException::GroupIException():Exception(){} //-------------------------------------------------------------------------- // Function: GroupIException overloaded constructor -///\brief Creates a GroupIException with a function name where the -/// failure occurs and an optional detailed message. +///\brief Creates a GroupIException with the name of the function, +/// in which the failure occurs, and an optional detailed message. ///\param func_name - IN: Name of the function where failure occurs ///\param message - IN: Message on the failure //-------------------------------------------------------------------------- @@ -331,7 +331,7 @@ GroupIException::GroupIException(const string func_name, const string message) : GroupIException::~GroupIException() {} //-------------------------------------------------------------------------- -// Subclasses: DataSpaceIException +// Subclass: DataSpaceIException // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- //-------------------------------------------------------------------------- @@ -341,8 +341,8 @@ GroupIException::~GroupIException() {} DataSpaceIException::DataSpaceIException():Exception(){} //-------------------------------------------------------------------------- // Function: DataSpaceIException overloaded constructor -///\brief Creates a DataSpaceIException with a function name where -/// the failure occurs and an optional detailed message. +///\brief Creates a DataSpaceIException with the name of the function, +/// in which the failure occurs, and an optional detailed message. ///\param func_name - IN: Name of the function where failure occurs ///\param message - IN: Message on the failure //-------------------------------------------------------------------------- @@ -354,7 +354,7 @@ DataSpaceIException::DataSpaceIException(const string func_name, const string me DataSpaceIException::~DataSpaceIException() {} //-------------------------------------------------------------------------- -// Subclasses: DataTypeIException +// Subclass: DataTypeIException // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- //-------------------------------------------------------------------------- @@ -364,8 +364,8 @@ DataSpaceIException::~DataSpaceIException() {} DataTypeIException::DataTypeIException():Exception(){} //-------------------------------------------------------------------------- // Function: DataTypeIException overloaded constructor -///\brief Creates a DataTypeIException with a function name where the -/// failure occurs and an optional detailed message. +///\brief Creates a DataTypeIException with the name of the function, +/// in which the failure occurs, and an optional detailed message. ///\param func_name - IN: Name of the function where failure occurs ///\param message - IN: Message on the failure //-------------------------------------------------------------------------- @@ -377,7 +377,7 @@ DataTypeIException::DataTypeIException(const string func_name, const string mess DataTypeIException::~DataTypeIException() {} //-------------------------------------------------------------------------- -// Subclasses: PropListIException +// Subclass: PropListIException // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- //-------------------------------------------------------------------------- @@ -387,8 +387,8 @@ DataTypeIException::~DataTypeIException() {} PropListIException::PropListIException():Exception(){} //-------------------------------------------------------------------------- // Function: PropListIException overloaded constructor -///\brief Creates a PropListIException with a function name where -/// the failure occurs and an optional detailed message. +///\brief Creates a PropListIException with the name of the function, +/// in which the failure occurs, and an optional detailed message. ///\param func_name - IN: Name of the function where failure occurs ///\param message - IN: Message on the failure //-------------------------------------------------------------------------- @@ -400,7 +400,7 @@ PropListIException::PropListIException(const string func_name, const string mess PropListIException::~PropListIException() {} //-------------------------------------------------------------------------- -// Subclasses: DataSetIException +// Subclass: DataSetIException // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- //-------------------------------------------------------------------------- @@ -410,8 +410,8 @@ PropListIException::~PropListIException() {} DataSetIException::DataSetIException():Exception(){} //-------------------------------------------------------------------------- // Function: DataSetIException overloaded constructor -///\brief Creates a DataSetIException with a function name where -/// the failure occurs and an optional detailed message. +///\brief Creates a DataSetIException with the name of the function, +/// in which the failure occurs, and an optional detailed message. ///\param func_name - IN: Name of the function where failure occurs ///\param message - IN: Message on the failure //-------------------------------------------------------------------------- @@ -423,7 +423,7 @@ DataSetIException::DataSetIException(const string func_name, const string messag DataSetIException::~DataSetIException() {} //-------------------------------------------------------------------------- -// Subclasses: AttributeIException +// Subclass: AttributeIException // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- //-------------------------------------------------------------------------- @@ -433,8 +433,8 @@ DataSetIException::~DataSetIException() {} AttributeIException::AttributeIException():Exception(){} //-------------------------------------------------------------------------- // Function: AttributeIException overloaded constructor -///\brief Creates a AttributeIException with a function name where -/// the failure occurs and an optional detailed message. +///\brief Creates an AttributeIException with the name of the function, +/// in which the failure occurs, and an optional detailed message. ///\param func_name - IN: Name of the function where failure occurs ///\param message - IN: Message on the failure //-------------------------------------------------------------------------- @@ -446,7 +446,7 @@ AttributeIException::AttributeIException(const string func_name, const string me AttributeIException::~AttributeIException() {} //-------------------------------------------------------------------------- -// Subclasses: ReferenceException +// Subclass: ReferenceException // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- //-------------------------------------------------------------------------- @@ -456,8 +456,8 @@ AttributeIException::~AttributeIException() {} ReferenceException::ReferenceException():Exception(){} //-------------------------------------------------------------------------- // Function: ReferenceException overloaded constructor -///\brief Creates a ReferenceException with a function name where -/// the failure occurs and an optional detailed message. +///\brief Creates a ReferenceException with the name of the function, +/// in which the failure occurs, and an optional detailed message. ///\param func_name - IN: Name of the function where failure occurs ///\param message - IN: Message on the failure //-------------------------------------------------------------------------- @@ -469,7 +469,7 @@ ReferenceException::ReferenceException(const string func_name, const string mess ReferenceException::~ReferenceException() {} //-------------------------------------------------------------------------- -// Subclasses: LibraryIException +// Subclass: LibraryIException // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- //-------------------------------------------------------------------------- @@ -479,8 +479,8 @@ ReferenceException::~ReferenceException() {} LibraryIException::LibraryIException():Exception(){} //-------------------------------------------------------------------------- // Function: LibraryIException overloaded constructor -///\brief Creates a LibraryIException with a function name where -/// the failure occurs and an optional detailed message. +///\brief Creates a LibraryIException with the name of the function, +/// in which the failure occurs, and an optional detailed message. ///\param func_name - IN: Name of the function where failure occurs ///\param message - IN: Message on the failure //-------------------------------------------------------------------------- @@ -492,7 +492,7 @@ LibraryIException::LibraryIException(const string func_name, const string messag LibraryIException::~LibraryIException() {} //-------------------------------------------------------------------------- -// Subclasses: IdComponentException +// Subclass: IdComponentException // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- //-------------------------------------------------------------------------- @@ -502,8 +502,8 @@ LibraryIException::~LibraryIException() {} IdComponentException::IdComponentException(): Exception() {} //-------------------------------------------------------------------------- // Function: IdComponentException overloaded constructor -///\brief Creates a IdComponentException with a function name where -/// the failure occurs and an optional detailed message. +///\brief Creates a IdComponentException with the name of the function, +/// in which the failure occurs, and an optional detailed message. ///\param func_name - IN: Name of the function where failure occurs ///\param message - IN: Message on the failure //-------------------------------------------------------------------------- diff --git a/c++/src/H5File.cpp b/c++/src/H5File.cpp index 79ddf93..e176146 100644 --- a/c++/src/H5File.cpp +++ b/c++/src/H5File.cpp @@ -519,13 +519,14 @@ hid_t H5File::getLocId() const return( getId() ); } +#ifndef DOXYGEN_SHOULD_SKIP_THIS //-------------------------------------------------------------------------- // Function: H5File::p_close (private) -///\brief Closes this H5 file. -///\exception H5::FileIException -///\note -/// This function will be obsolete because its functionality -/// is recently handled by the C library layer. +// Purpose: Closes this HDF5 file. +// Exception H5::FileIException +// Description +// This function will be obsolete because its functionality +// is recently handled by the C library layer. - May, 2004 // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- void H5File::p_close() const @@ -536,6 +537,7 @@ void H5File::p_close() const throw FileIException(0, "H5Fclose failed"); } } +#endif // DOXYGEN_SHOULD_SKIP_THIS //-------------------------------------------------------------------------- // Function: H5File::throwException diff --git a/c++/src/H5File.h b/c++/src/H5File.h index 2e0eeec..6493a3b 100644 --- a/c++/src/H5File.h +++ b/c++/src/H5File.h @@ -90,8 +90,10 @@ class H5_DLLCPP H5File : public IdComponent, public CommonFG { // Throw file exception. virtual void throwException(const string func_name, const string msg) const; +#ifndef DOXYGEN_SHOULD_SKIP_THIS // Used by the API to appropriately close a file. void p_close() const; +#endif // DOXYGEN_SHOULD_SKIP_THIS // H5File destructor. virtual ~H5File(); diff --git a/c++/src/H5Group.cpp b/c++/src/H5Group.cpp index 8827630..398d181 100644 --- a/c++/src/H5Group.cpp +++ b/c++/src/H5Group.cpp @@ -142,7 +142,17 @@ DataSpace Group::getRegion(void *ref, H5R_type_t ref_type) const DataSpace dataspace(p_get_region(ref, ref_type)); return(dataspace); } -// Calls the C API H5Gclose to close this group. Used by IdComponent::reset + +#ifndef DOXYGEN_SHOULD_SKIP_THIS +//-------------------------------------------------------------------------- +// Function: Group::p_close (private) +// Purpose: Closes this group. +// Exception H5::GroupIException +// Description +// This function will be obsolete because its functionality +// is recently handled by the C library layer. - May, 2004 +// Programmer Binh-Minh Ribler - 2000 +//-------------------------------------------------------------------------- void Group::p_close() const { herr_t ret_value = H5Gclose( id ); @@ -151,10 +161,11 @@ void Group::p_close() const throw GroupIException(0, "H5Gclose failed"); } } +#endif // DOXYGEN_SHOULD_SKIP_THIS //-------------------------------------------------------------------------- // Function: Group::throwException -///\brief Throws group exception - initially implemented for CommonFG +///\brief Throws H5::GroupIException. ///\param func_name - Name of the function where failure occurs ///\param msg - Message describing the failure ///\exception H5::GroupIException diff --git a/c++/src/H5Group.h b/c++/src/H5Group.h index df299c3..6ed2a4a 100644 --- a/c++/src/H5Group.h +++ b/c++/src/H5Group.h @@ -28,26 +28,28 @@ class H5_DLLCPP Group : public H5Object, public CommonFG { // Copy constructor: makes a copy of the original object Group( const Group& original ); - // Creates a reference to a named Hdf5 object in this object. - void* Reference(const char* name) const; - // Creates a reference to a named Hdf5 object or to a dataset region // in this object. void* Reference(const char* name, DataSpace& dataspace, H5R_type_t ref_type = H5R_DATASET_REGION) const; + // Creates a reference to a named Hdf5 object in this object. + void* Reference(const char* name) const; + // Retrieves the type of object that an object reference points to. H5G_obj_t getObjType(void *ref, H5R_type_t ref_type) const; // Retrieves a dataspace with the region pointed to selected. DataSpace getRegion(void *ref, H5R_type_t ref_type = H5R_DATASET_REGION) const; - // for CommonFG to get the file id + // for CommonFG to get the file id. virtual hid_t getLocId() const; - // Throw group exception + // Throw group exception. virtual void throwException(const string func_name, const string msg) const; - // Used by the API to appropriately close a group +#ifndef DOXYGEN_SHOULD_SKIP_THIS + // Used by the API to appropriately close a group - will be obsolete. void p_close() const; +#endif // DOXYGEN_SHOULD_SKIP_THIS // Destructor virtual ~Group(); diff --git a/c++/src/H5IdComponent.cpp b/c++/src/H5IdComponent.cpp index e8b85c0..cf5ae95 100644 --- a/c++/src/H5IdComponent.cpp +++ b/c++/src/H5IdComponent.cpp @@ -84,8 +84,16 @@ void IdComponent::decRefCount() { ref_count->decrement(); } //-------------------------------------------------------------------------- int IdComponent::getCounter() { return( ref_count->getCounter()); } -// Decrements the reference counter then determines if there are no more -// reference to this object +//-------------------------------------------------------------------------- +// Function: IdComponent::noReference +///\brief Determines whether this object has any references. +///\return \c true if there is no reference, and \c false, otherwise. +///\note This function will be obsolete in the next release. +// Description +// Decrements the reference counter then determines if there +// are no more reference to this object. +// Programmer Binh-Minh Ribler - 2000 +//-------------------------------------------------------------------------- bool IdComponent::noReference() { if( ref_count->getCounter() > 0 ) @@ -173,6 +181,42 @@ void IdComponent::reset () } //-------------------------------------------------------------------------- +// Function: IdComponent destructor +///\brief Noop destructor. +// Programmer Binh-Minh Ribler - 2000 +//-------------------------------------------------------------------------- +IdComponent::~IdComponent() { + +/* uncomment this block and complete it when deciding to use dontAtExit + unless the atexit/global destructor problem is fixed, then + remove it- BMR 11/14/00 + + if( id == NOTATEXIT ) + { + // Call H5Library::close to clean up - temporary solution to avoid the + // trouble of atexit/global destructors + try { + if( H5Library::need_cleanup == true ) + { + H5Library::close(); + H5Library::need_cleanup = false; // reset the boolean just in case + } + } + // catch failure caused by the H5Library operations + catch( LibraryIException error ) + { + error.printError(); + } + } +*/ +} + +// +// Implementation of protected functions +// + +#ifndef DOXYGEN_SHOULD_SKIP_THIS +//-------------------------------------------------------------------------- // Function: IdComponent::p_get_file_name // Purpose: Gets the name of the file, in which this object belongs. // Exception: H5::IdComponentException @@ -212,41 +256,6 @@ string IdComponent::p_get_file_name() const } //-------------------------------------------------------------------------- -// Function: IdComponent destructor -///\brief Noop destructor. -// Programmer Binh-Minh Ribler - 2000 -//-------------------------------------------------------------------------- -IdComponent::~IdComponent() { - -/* uncomment this block and complete it when deciding to use dontAtExit - unless the atexit/global destructor problem is fixed, then - remove it- BMR 11/14/00 - - if( id == NOTATEXIT ) - { - // Call H5Library::close to clean up - temporary solution to avoid the - // trouble of atexit/global destructors - try { - if( H5Library::need_cleanup == true ) - { - H5Library::close(); - H5Library::need_cleanup = false; // reset the boolean just in case - } - } - // catch failure caused by the H5Library operations - catch( LibraryIException error ) - { - error.printError(); - } - } -*/ -} - -// -// Implementation of protected functions for HDF5 Reference Interface. -// - -//-------------------------------------------------------------------------- // Function: IdComponent::p_reference (protected) // Purpose Creates a reference to an HDF5 object or a dataset region. // Parameters @@ -315,6 +324,7 @@ hid_t IdComponent::p_get_region(void *ref, H5R_type_t ref_type) const } return(space_id); } +#endif // DOXYGEN_SHOULD_SKIP_THIS #ifndef H5_NO_NAMESPACE } diff --git a/c++/src/H5IdComponent.h b/c++/src/H5IdComponent.h index 12dc97f..bea8cd4 100644 --- a/c++/src/H5IdComponent.h +++ b/c++/src/H5IdComponent.h @@ -29,10 +29,6 @@ class H5_DLLCPP IdComponent { // before setting new id to control reference count void setId( hid_t new_id ); - // Pure virtual function so appropriate close function can - // be called by subclasses' for the corresponding object - virtual void p_close() const = 0; - // Creates an object to hold an HDF5 identifier IdComponent( const hid_t h5_id ); @@ -59,12 +55,20 @@ class H5_DLLCPP IdComponent { IdComponent& operator=( const IdComponent& rhs ); void reset(); - void resetId(); + + // Pure virtual function so appropriate close function can + // be called by subclasses' for the corresponding object + // This function will be obsolete because its functionality + // is recently handled by the C library layer. +#ifndef DOXYGEN_SHOULD_SKIP_THIS + virtual void p_close() const = 0; +#endif // DOXYGEN_SHOULD_SKIP_THIS // Destructor virtual ~IdComponent(); protected: +#ifndef DOXYGEN_SHOULD_SKIP_THIS hid_t id; // HDF5 object id RefCounter* ref_count; // used to keep track of the // number of copies of an object @@ -90,6 +94,7 @@ class H5_DLLCPP IdComponent { // Retrieves a dataspace with the region pointed to selected. hid_t p_get_region(void *ref, H5R_type_t ref_type) const; +#endif // DOXYGEN_SHOULD_SKIP_THIS }; // end class IdComponent diff --git a/c++/src/H5Library.cpp b/c++/src/H5Library.cpp index a449dc2..fa36e0f 100644 --- a/c++/src/H5Library.cpp +++ b/c++/src/H5Library.cpp @@ -14,6 +14,7 @@ #include <string> +#include "H5CppDoc.h" // included only for Doxygen to generate part of RM #include "H5Include.h" #include "H5Exception.h" #include "H5Library.h" @@ -22,8 +23,10 @@ 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; +#endif // DOXYGEN_SHOULD_SKIP_THIS //-------------------------------------------------------------------------- // Function: H5Library::open diff --git a/c++/src/H5Library.h b/c++/src/H5Library.h index 34b816b..9dac9a8 100644 --- a/c++/src/H5Library.h +++ b/c++/src/H5Library.h @@ -28,7 +28,9 @@ 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(); diff --git a/c++/src/H5Object.h b/c++/src/H5Object.h index 1ba8929..b99764c 100644 --- a/c++/src/H5Object.h +++ b/c++/src/H5Object.h @@ -34,6 +34,7 @@ typedef void (*attr_operator_t)( H5Object& loc/*in*/, const string attr_name/*in*/, void *operator_data/*in,out*/); +#ifndef DOXYGEN_SHOULD_SKIP_THIS class UserData4Aiterate { // user data for attribute iteration public: unsigned int* idx; @@ -41,6 +42,7 @@ class UserData4Aiterate { // user data for attribute iteration void* opData; H5Object* object; }; +#endif // DOXYGEN_SHOULD_SKIP_THIS // The above part is being moved into Iterator, but not completed diff --git a/c++/src/H5PropList.cpp b/c++/src/H5PropList.cpp index df56c69..30bb0f1 100644 --- a/c++/src/H5PropList.cpp +++ b/c++/src/H5PropList.cpp @@ -155,7 +155,16 @@ void PropList::copyProp( PropList& dest, PropList& src, const string& name ) con copyProp( dest, src, name.c_str()); } -// Closes the property list if it is not a default one +#ifndef DOXYGEN_SHOULD_SKIP_THIS +//-------------------------------------------------------------------------- +// Function: PropList::p_close (private) +// Purpose: Closes the property list if it is not a default one. +// Exception H5::PropListIException +// Description +// This function will be obsolete because its functionality +// is recently handled by the C library layer. - May, 2004 +// Programmer Binh-Minh Ribler - 2000 +//-------------------------------------------------------------------------- void PropList::p_close() const { if( id != H5P_NO_CLASS ) // not a constant, should call H5Pclose @@ -167,6 +176,7 @@ void PropList::p_close() const } } } +#endif // DOXYGEN_SHOULD_SKIP_THIS //-------------------------------------------------------------------------- // Function: PropList::getClass diff --git a/c++/src/H5PropList.h b/c++/src/H5PropList.h index 1c7d934..438b0ee 100644 --- a/c++/src/H5PropList.h +++ b/c++/src/H5PropList.h @@ -83,8 +83,10 @@ class H5_DLLCPP PropList : public IdComponent { PropList getClassParent() const; +#ifndef DOXYGEN_SHOULD_SKIP_THIS // Used by the API to close the property list void p_close() const; +#endif // DOXYGEN_SHOULD_SKIP_THIS virtual ~PropList(); }; diff --git a/c++/src/H5RefCounter.cpp b/c++/src/H5RefCounter.cpp index 896d06a..1a0eff4 100644 --- a/c++/src/H5RefCounter.cpp +++ b/c++/src/H5RefCounter.cpp @@ -62,10 +62,10 @@ void RefCounter::decrement() /// that uses this counter. ///\return true if there are no more reference to the object /// that uses this counter, and false, otherwise. +///\note This function will be obsolete in the next release. // Description // Decrements the reference counter then determines if there // are no more reference to the object that uses this counter. -///\note This function will be obsolete in the next release. // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- bool RefCounter::noReference() |