HDF5HeaderData Class Reference

#include <CH_HDF5.H>

List of all members.


Detailed Description

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");
   

Public Member Functions

int writeToFile (HDF5Handle &file) const
int readFromFile (HDF5Handle &file)
void clear ()
int writeToLocation (hid_t loc_id) const
int readFromLocation (hid_t loc_id)
void dump () const
 useful for debugging. dumps contents to std::cout

Public Attributes

map< std::string, Realm_real
map< std::string, int > m_int
map< std::string, std::string > m_string
map< std::string, IntVectm_intvect
map< std::string, Boxm_box
map< std::string, RealVectm_realvect

Static Private Member Functions

static herr_t attributeScan (hid_t loc_id, const char *name, void *opdata)

Member Function Documentation

int HDF5HeaderData::writeToFile ( HDF5Handle file  )  const

Writes this HDF5HeaderData's current attribute list to the current group in 'file.' Returns 0 on success, returns the error code from HDF5 on failure.

Referenced by blockWrite(), blockWriteLevel(), write(), writeLevel(), and WriteMultiData< T >::WriteMultiData().

int HDF5HeaderData::readFromFile ( HDF5Handle file  ) 

Reads into this HDF5HeaderData's attribute list from file. Read process is add/change, does not remove key-value pairs. Reads from current group. Returns 0 on success, positive number if a particular member of group caused an error, negative on general error.

Referenced by blockRead(), blockReadLevel(), read(), and readLevel().

void HDF5HeaderData::clear (  ) 

int HDF5HeaderData::writeToLocation ( hid_t  loc_id  )  const

int HDF5HeaderData::readFromLocation ( hid_t  loc_id  ) 

void HDF5HeaderData::dump (  )  const

useful for debugging. dumps contents to std::cout

static herr_t HDF5HeaderData::attributeScan ( hid_t  loc_id,
const char *  name,
void *  opdata 
) [static, private]


Member Data Documentation

map<std::string, Real> HDF5HeaderData::m_real

map<std::string, int> HDF5HeaderData::m_int

map<std::string, std::string> HDF5HeaderData::m_string

map<std::string, Box> HDF5HeaderData::m_box

Referenced by readLevel(), and writeLevel().


The documentation for this class was generated from the following file:

Generated on Fri Apr 5 04:25:06 2019 for Chombo + EB by  doxygen 1.5.5