data to be added to HDF5 files.
HDF5HeaderData is a wrapper for some data maps to be added to HDF5 files. instead of an overdose of access functions, the maps are made public and they can be manipulated by the user at will. They maintain type safety.to add a Real data entry, a user can simply program as follows:
Real dx; . . HDF5HeaderData metaData; metaData.m_real["dx"] = dx;If "dx" already existed, then it is overwritten, otherwise an entry is created and added with the new value;
To search for entries, the user does the following:
HDF5HeaderData metaData; HDF5Handle currentStep(filename); currentStep.setGroupToLevel(0); metaData.readFromFile(currentStep); if(metaData.m_intvect.find("ghost") != metaData.m_intvect.end()) ghost = metaData.m_intvect["ghost"]; else ghost = defaultGhostIntVect;A user can skip the check for existence if they have reason to "know" the data will be there. It is just good coding practice.
To erase an entry, you can use:
metaData.m_real.erase("dx");
This software is copyright (C) by the Lawrence Berkeley National Laboratory. Permission is granted to reproduce this software for non-commercial purposes provided that this notice is left intact.
It is acknowledged that the U.S. Government has rights to this software under Contract DE-AC03-765F00098 between the U.S. Department of Energy and the University of California.
This software is provided as a professional and academic contribution for joint exchange. Thus it is experimental, is provided ``as is'', with no warranties of any kind whatsoever, no support, no promise of updates, or printed documentation. By using this software, you acknowledge that the Lawrence Berkeley National Laboratory and Regents of the University of California shall have no liability with respect to the infringement of other copyrights by any part of this software.