예제 #1
0
//--------------------------------------------------------------------------
// Function:	IntType overloaded constructor
///\brief	Gets the integer datatype of the specified dataset.
///\param	dataset - IN: Dataset that this integer datatype associates with
///\exception	H5::DataTypeIException
// Programmer	Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
IntType::IntType( const DataSet& dataset ) : AtomType()
{
   // Calls C function H5Dget_type to get the id of the datatype
   id = H5Dget_type( dataset.getId() );

   if( id < 0 )
   {
      throw DataSetIException("IntType constructor", "H5Dget_type failed");
   }
}
예제 #2
0
파일: H5CompType.cpp 프로젝트: Andy-Sun/VTK
//--------------------------------------------------------------------------
// Function:	CompType overloaded constructor
///\brief	Gets the compound datatype of the specified dataset.
///\param	dataset - IN: Dataset that this enum datatype associates with
///\return	CompType instance
///\exception	H5::DataTypeIException
// Programmer	Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
CompType::CompType( const DataSet& dataset ) : DataType()
{
   // Calls C function H5Dget_type to get the id of the datatype
   id = H5Dget_type( dataset.getId() );

   // If the datatype id is invalid, throw exception
   if( id < 0 )
   {
      throw DataSetIException("CompType constructor", "H5Dget_type failed");
   }
}
예제 #3
0
//--------------------------------------------------------------------------
// Function:	EnumType overloaded constructor
///\brief	Creates a new enum datatype based on an integer datatype.
///\param	data_type - IN: Base datatype
///\exception	H5::DataTypeIException
// Programmer	Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
EnumType::EnumType( const IntType& data_type ) : DataType()
{
   // Calls C function H5Tenum_create to get the id of the datatype
   id = H5Tenum_create( data_type.getId() );

   // If the datatype id is not valid, throw an exception
   if( id < 0 )
   {
      throw DataSetIException("EnumType constructor", "H5Tenum_create failed");
   }
}