예제 #1
0
파일: H5DataSet.cpp 프로젝트: CapeDrew/DITK
//--------------------------------------------------------------------------
// 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());
    }
}
예제 #2
0
파일: H5Group.cpp 프로젝트: svn2github/hdf5
//--------------------------------------------------------------------------
// 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());
    }
}
예제 #3
0
파일: H5Object.cpp 프로젝트: VisBlank/hdf5
//--------------------------------------------------------------------------
// 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);
}
예제 #4
0
//--------------------------------------------------------------------------
// 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");
   }
}
예제 #5
0
파일: H5File.cpp 프로젝트: Hulalazz/rnnlib
//--------------------------------------------------------------------------
// 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
}