Exemple #1
0
//--------------------------------------------------------------------------
// Function:	DataSet overload constructor - dereference
///\brief	Given a reference, ref, to an hdf5 dataset, creates a
///		DataSet object
///\param	h5file - IN: Location referenced object is in
///\param	ref - IN: Reference pointer
///\param	ref_type - IN: Reference type - default to H5R_OBJECT
///\exception	H5::DataSetIException
// Programmer	Binh-Minh Ribler - Oct, 2006
// Modification
//	Jul, 2008
//		Added for application convenience.
//--------------------------------------------------------------------------
DataSet::DataSet(H5File& h5file, const void* ref, H5R_type_t ref_type) : H5Object(), AbstractDs()
{
    try {
	id = p_dereference(h5file.getId(), ref, ref_type);
    } catch (ReferenceException deref_error) {
	throw ReferenceException("DataSet constructor - located by HDF5 file",
		deref_error.getDetailMsg());
    }
}
Exemple #2
0
//--------------------------------------------------------------------------
// Function:	Group overload constructor - dereference
///\brief	Given a reference, ref, to an hdf5 group, creates a Group object
///\param	h5file - IN: Location referenced object is in
///\param	ref - IN: Reference pointer
///\param	ref_type - IN: Reference type - default to H5R_OBJECT
///\exception	H5::ReferenceException
// Programmer	Binh-Minh Ribler - Oct, 2006
//--------------------------------------------------------------------------
Group::Group(H5File& h5file, const void* ref, H5R_type_t ref_type) : H5Object()
{
    try {
	id = p_dereference(h5file.getId(), ref, ref_type);
    } catch (ReferenceException deref_error) {
	throw ReferenceException("Group constructor - located by an H5File",
		deref_error.getDetailMsg());
    }
}
Exemple #3
0
//--------------------------------------------------------------------------
// Function:	H5Object::dereference
///\brief	Dereferences a reference into an HDF5 object, given an HDF5 file.
///\param	h5file - IN: HDF5 file specifying the location of the referenced object
///\param	ref - IN: Reference pointer
///\param	ref_type - IN: Reference type
///\exception	H5::ReferenceException
// Programmer   Binh-Minh Ribler - Oct, 2006
// Modification
//	May, 2008
//		Corrected missing parameters. - BMR
//--------------------------------------------------------------------------
void H5Object::dereference(H5File& h5file, const void* ref, H5R_type_t ref_type)
{
   hid_t temp_id;
   try {
      temp_id = p_dereference(h5file.getId(), ref, ref_type);
   }
   catch (ReferenceException E) {
      throw ReferenceException("H5Object::dereference - located by file", E.getDetailMsg());
   }
   p_setId(temp_id);
}
//--------------------------------------------------------------------------
// Function:	CommonFG::mount
///\brief	Mounts the file \a child onto this group.
///\param	name  - IN: Name of the group
///\param	child - IN: File to mount
///\param	plist - IN: Property list to use
///\exception	H5::FileIException or H5::GroupIException
// Programmer	Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
void CommonFG::mount( const char* name, H5File& child, PropList& plist ) const
{
   // Obtain identifiers for C API
   hid_t plist_id = plist.getId();
   hid_t child_id = child.getId();

   // Call C routine H5Fmount to do the mouting
   herr_t ret_value = H5Fmount( getLocId(), name, child_id, plist_id );

   // Raise exception if H5Fmount returns negative value
   if( ret_value < 0 )
   {
      throwException("mount", "H5Fmount failed");
   }
}
Exemple #5
0
//--------------------------------------------------------------------------
// Function:	H5File copy constructor
///\brief	Copy constructor: makes a copy of the original
///		H5File object.
///\param	original - IN: H5File instance to copy
// Programmer	Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
H5File::H5File(const H5File& original) : H5Location(original)
{
    id = original.getId();
    incRefCount(); // increment number of references to this id
}