//-------------------------------------------------------------------------- // Function: H5Object::flush ///\brief Flushes all buffers associated with a file to disk. ///\param scope - IN: Specifies the scope of the flushing action, /// which can be either of these values: /// \li \c H5F_SCOPE_GLOBAL - Flushes the entire virtual file /// \li \c H5F_SCOPE_LOCAL - Flushes only the specified file ///\exception H5::AttributeIException ///\par Description /// This object is used to identify the file to be flushed. // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- void H5Object::flush(H5F_scope_t scope) const { herr_t ret_value = H5Fflush(getId(), scope); if( ret_value < 0 ) { throw FileIException(inMemFunc("flush"), "H5Fflush failed"); } }
//-------------------------------------------------------------------------- // Function: H5Object::getFileName ///\brief Gets the name of the file, in which this HDF5 object belongs. ///\return File name ///\exception H5::IdComponentException // Programmer Binh-Minh Ribler - Jul, 2004 //-------------------------------------------------------------------------- H5std_string H5Object::getFileName() const { try { return(p_get_file_name()); } catch (IdComponentException E) { throw FileIException(inMemFunc("getFileName"), E.getDetailMsg()); } }
//-------------------------------------------------------------------------- // Function: H5Location::getFileName ///\brief Gets the name of the file, in which this HDF5 object belongs. ///\return File name ///\exception H5::LocationException // Programmer Binh-Minh Ribler - Jul, 2004 //-------------------------------------------------------------------------- H5std_string H5Location::getFileName() const { try { return(p_get_file_name()); } catch (LocationException E) { throw FileIException(inMemFunc("getFileName"), E.getDetailMsg()); } }
//-------------------------------------------------------------------------- // Function: IdComponent::operator= ///\brief Assignment operator. ///\param rhs - IN: Reference to the existing object ///\return Reference to IdComponent instance ///\exception H5::IdComponentException when attempt to close the HDF5 /// object fails // Description // First, close the current valid id of this object. Then // copy the id from rhs to this object, and increment the // reference counter of the id to indicate that another object // is referencing that id. // Modification // 2010/5/9 - BMR // Removed close() and incRefCount() because setId/p_setId takes // care of close() and setId takes care incRefCount(). // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- IdComponent& IdComponent::operator=(const IdComponent& rhs) { if (this != &rhs) { // handling references to this id try { setId(rhs.getId()); // Note: a = b, so there are two objects with the same hdf5 id // that's why incRefCount is needed, and it is called by setId } catch (Exception& close_error) { throw FileIException(inMemFunc("operator="), close_error.getDetailMsg()); } } return *this; }
//-------------------------------------------------------------------------- // Function: IdComponent::operator= ///\brief Assignment operator. ///\param rhs - IN: Reference to the existing object ///\return Reference to IdComponent instance ///\exception H5::IdComponentException when attempt to close the HDF5 /// object fails // Description // First, close the current valid id of this object. Then // copy the id from rhs to this object, and increment the // reference counter of the id to indicate that another object // is referencing that id. // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- IdComponent& IdComponent::operator=( const IdComponent& rhs ) { if (this != &rhs) { // handling references to this id try { close(); } catch (Exception close_error) { throw FileIException(inMemFunc("operator="), close_error.getDetailMsg()); } // copy the data members from the rhs object p_setId(rhs.getId()); incRefCount(getId()); // a = b, so there are two objects with the same // hdf5 id } return *this; }