summaryrefslogtreecommitdiffstats
path: root/c++/src/H5Library.cpp
Commit message (Collapse)AuthorAgeFilesLines
* [svn-r27945] Purpose: Fix HDFFV-9529Binh-Minh Ribler2015-10-041-8/+110
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Description: Merged from hdf5_CppAPI_Constants r27942: ------ Description: - Added H5dont_atexit() to getPredType and all the getConstant's to prevent the C library from terminating before the C++ library cleanup. - More cleanup and added more comments r27923: ------ - Updated more comments and moved some things around for consistency - Removed check for "new" failure, exceptions would be thrown r27922: ------ Description: Added function headers and more comments for clarity. r27917: ------ Description: The C++ library has several types of global constants from different classes, such as PropList, PredType, DataSpace, etc... Previously, these global constants were declared statically and the C++ library used a constant, called PredType::AtExit, to detect when all the global contants are destroyed then close the C library (H5close). This method relied on the order of the constants being created and destroyed and that PredType constants be the last to be destroyed. In September 2015, it was recognized that the order in which the global constants were created and destroyed was actually undefined, thus can be different between different compilers. This resulted in failure when compilers destroy PredType constants before others because when PredType::AtExit was destroyed, the C library was closed, so when the constants of other classes such as PropList or DataSpace were being deleted, the C library would not be available. Solution: The static approach is changed to dynamic. In order to avoid an impact on existing applications, the static global constants are changed to constant references to the dynamically allocated objects. A detailed explanation of the new method and a description of the changes are in a Design Notes at the end of the file H5PredType.cpp. New functions added to support the new methods are listed below. class H5Library: // Returns a singleton H5Library to initialize the global // constants, invoked in IdComponent default constructor static H5Library* getInstance(); // public // Registers cleanup and terminating functions with atexit(), // called in IdComponent default constructor static void initH5cpp(void); // public // Calls H5close to terminate the library, registered with // atexit(), as the last thing to be done. static void termH5cpp(void); // public class PredType: // Creates the constants static void makePredTypes(); // private // Calls makePredTypes to create the constants and returns // the dummy constant PREDTYPE_CONST; static PredType* getPredTypes(); // private class DataSpace: // Creates the constant static DataSpace* getConstant(); // private class PropList: // Creates the constant static PropList* getConstant(); // private class DSetCreatPropList: // Creates the constant static DSetCreatPropList* getConstant(); // private class DSetMemXferPropList: // Creates the constant static DSetMemXferPropList* getConstant(); // private class FileCreatPropList: // Creates the constant static FileCreatPropList* getConstant(); // private class FileAccPropList: // Creates the constant static FileAccPropList* getConstant(); // private This function is added to PredType, DataSpace, PropList, and the four subclasses of PropList: // Deletes the constant static void deleteConstants(); // public Platforms tested: Linux/32 2.6 (jam) Linux/64 (platypus) Darwin (osx1010test)
* [svn-r22235] Purpose: Fixed bugs HDFFV-2761 & HDFFV-7852Binh-Minh Ribler2012-04-021-2/+2
| | | | | | | | | | | | | | | | | | | | Description: - Replaced PredType::NotAtexit() with PredType::AtExit(H5CPP_EXITED); and used PredType::AtExit as a flag to detect when all predefined types have been destroyed. Then, H5close will be called to terminate the library after its being re-initiated when the PredType destructors were activated. This change removed the memory leaks shown by the user's sample program. - Added H5CPP_EXITED for PredType::AtExit to use as a flag - Updated some inaccurate comments - Removed stream functions from FileAccPropList - Replaced H5_VMS with appropriate macro in H5IdComponent.cpp - Corrected many URLs (hdfgroup vs. ncsa) in comments - Replaced std::string with H5std_string in comments Platforms tested: Linux/32 2.6 (jam) Linux/64 2.6 (amani) SunOS 5.10 (linew)
* [svn-r13253] Updated all C and C++ style source code files with the THG ↵Albert Cheng2007-02-071-2/+3
| | | | | | | | | copyright notice. Tested platform: Kagiso only since it is only a comment block change. If it works in one machine, it should work in all, I hope. Still need to check the parallel build on copper.
* [svn-r12185] Purpose: Code cleanupBinh-Minh Ribler2006-03-311-2/+0
| | | | | | | | Description: Removed an empty #ifdef block that was left by mistake. Platforms tested: Linux 2.4 (heping) - very minor
* [svn-r12180] Purpose: MaintenanceBinh-Minh Ribler2006-03-301-3/+0
| | | | | | | | | | | Description: Added alias H5_std so either the global or std namespace can be used, depending on H5_NO_STD. Platforms tested: Linux 2.4 (heping) SunOS 5.8 64-bit (sol) AIX 5.1 (copper)
* [svn-r11755] Purpose: Code improvementBinh-Minh Ribler2005-12-031-0/+5
| | | | | | | | | | | | | | | | | Description: There was a workaround for predefined types, in the C++ library, implemented when the C++ library was handling the reference counting of the object ids on its own. Currently, the C++ library is using the available APIs from the C library for that purpose, and there were bugs reported involving that part of the C++ library. So, I decided to remove the workaround completely. Also, improved the use of std members. Platforms tested: Linux 2.4 (heping) SunOS 5.8 64-bit (sol) Linux 2.4 w/PGI (colonelk)
* [svn-r11487] Purpose:Quincey Koziol2005-10-011-12/+12
| | | | | | | | | | | Code cleanup Description: Tweak copyright on C++ source files to reduce whining by copyright checking script. Platforms tested: FreeBSD 4.11 (sleipnir) w/C++
* [svn-r11245] Purpose:Quincey Koziol2005-08-131-18/+18
| | | | | | | | | | | | | | | | | | | | Code cleanup Description: Trim trailing whitespace, which is making 'diff'ing the two branches difficult. Solution: Ran this script in each directory: foreach f (*.[ch] *.cpp) sed 's/[[:blank:]]*$//' $f > sed.out && mv sed.out $f end Platforms tested: FreeBSD 4.11 (sleipnir) Too minor to require h5committest
* [svn-r10825] Purpose: Fix RM bugBinh-Minh Ribler2005-05-291-0/+4
| | | | | | | | | | | | | | Description: Doxygen 1.4.2 has a bug that when an \exception immediately follows a \brief, the exception will be displayed prominently in the brief section. Solution: Temporarily added /// to after \brief to work around this problem and notified the Doxygen's author. Platforms tested: Linux 2.4 (heping) - only in documentation sections
* [svn-r9727] Purpose:Quincey Koziol2004-12-291-5/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Bug Fix/Code Cleanup/Doc Cleanup/Optimization/Branch Sync :-) Description: Generally speaking, this is the "signed->unsigned" change to selections. However, in the process of merging code back, things got stickier and stickier until I ended up doing a big "sync the two branches up" operation. So... I brought back all the "infrastructure" fixes from the development branch to the release branch (which I think were actually making some improvement in performance) as well as fixed several bugs which had been fixed in one branch, but not the other. I've also tagged the repository before making this checkin with the label "before_signed_unsigned_changes". Platforms tested: FreeBSD 4.10 (sleipnir) w/parallel & fphdf5 FreeBSD 4.10 (sleipnir) w/threadsafe FreeBSD 4.10 (sleipnir) w/backward compatibility Solaris 2.7 (arabica) w/"purify options" Solaris 2.8 (sol) w/FORTRAN & C++ AIX 5.x (copper) w/parallel & FORTRAN IRIX64 6.5 (modi4) w/FORTRAN Linux 2.4 (heping) w/FORTRAN & C++ Misc. update:
* [svn-r9129] Purpose: Updating documentationBinh-Minh Ribler2004-08-201-1/+3
| | | | | | | | | | Description: Updated various function headers for the RM as reviewing progresses. Rearranged functions in header files for more sensible look of the RM. Platforms tested: SunOS 5.7 (arabica) Linux 2.4 (eirene)
* [svn-r9046] Purpose:Binh-Minh Ribler2004-08-071-0/+1
| | | | | | | | | | | | | | | | | | | Code cleanup Description: DataType::commit had incorrect parameter, H5Object. Changed it to CommonFG, for H5File and Group. The change caused additional header files needed for several other cpp files. Moved some functions from Group into the base class CommonFG for H5File too. Platforms tested: SunOS 5.7 (arabica) Linux 2.4 (eirene) Misc. update:
* [svn-r8541] Purpose:Binh-Minh Ribler2004-05-191-8/+98
| | | | | | | | | | | | | | | | | Add more C++ wrappers and documentation - incrementally check-in Description: Added wrappers for: H5garbage_collect H5set_free_list_limits to H5Library.* Platforms: SunOS 5.7 (arabica) Linux 2.4 (eirene) Windows 2000 Misc. update:
* [svn-r6236] Purpose: CopyrightBinh-Minh Ribler2003-01-071-0/+14
| | | | | | | | | Description: Added copyright notice to C++ API files, including *.h, *.cpp, and Makefile.in Platforms: Linux 6.2 (eirene)
* [svn-r3602] Binh-Minh Ribler2001-03-101-5/+5
| | | | | | | | | | | | | | | | | | | | | Purpose: Usability enhancement Description: - Added more information about the failure to all the throw's, i.e, member function name and more detail about the failure, where appropriate. Also, added exception throws for private functions, such as p_close to provide more specific details. - Added two api functions: Exception::getFuncName() and Exception::getCFuncName() to provide the name of the member function where failure occurs. - Fixed some typos, one of which caused segn. fault in some situations (resetIdComponent was accidentally called twice in a couple of places :) Platforms: arabica (sparc-sun-solaris 2.7)
* [svn-r3080] Binh-Minh Ribler2000-12-071-0/+67
Purpose: Support portability Description: I forgot that source file extension .C will not work on Windows. Solution: Changed all source file from *.C to *.cpp for portability. Platforms tested: arabica (sparc-sun-solaris 2.7)