Ejemplo n.º 1
0
//--------------------------------------------------------------------------
// Function:	AbstractDs::getTypeClass
///\brief	Returns the class of the datatype that is used by this
///		object, which can be a dataset or an attribute.
///\return	Datatype class identifier
///\exception	H5::DataTypeIException
// Programmer	Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
H5T_class_t AbstractDs::getTypeClass() const
{
    // Gets the datatype used by this dataset or attribute.
    // p_get_type calls either H5Dget_type or H5Aget_type depending on
    // which object invokes getTypeClass
    hid_t datatype_id;
    try {
        datatype_id = p_get_type();  // returned value is already validated
    }
    catch (DataSetIException E) {
        throw DataTypeIException("DataSet::getTypeClass", E.getDetailMsg());
    }
    catch (AttributeIException E) {
        throw DataTypeIException("Attribute::getTypeClass", E.getDetailMsg());
    }

    // Gets the class of the datatype and validate it before returning
    H5T_class_t type_class = H5Tget_class(datatype_id);
    if( type_class != H5T_NO_CLASS )
        return( type_class );
    else
    {
        if (fromClass() == "DataSet")
            throw DataTypeIException("DataSet::getTypeClass", "H5Tget_class returns H5T_NO_CLASS");
        else if (fromClass() == "Attribute")
            throw DataTypeIException("Attribute::getTypeClass", "H5Tget_class returns H5T_NO_CLASS");
    }
}
Ejemplo n.º 2
0
//--------------------------------------------------------------------------
// Function:	IdComponent::inMemFunc
///\brief	Makes and returns string "<class-name>::<func_name>"
///\param	func_name - Name of the function where failure occurs
// Description
///		Concatenates the class name of this object with the
///		passed-in function name to create a string that indicates
///		where the failure occurs.  The class-name is provided by
///		fromClass().  This string will be used by a base class when
///		an exception is thrown.
// Programmer	Binh-Minh Ribler - Aug 6, 2005
//--------------------------------------------------------------------------
H5std_string IdComponent::inMemFunc(const char* func_name) const
{
#ifdef H5_VMS
   H5std_string full_name = fromClass();
   full_name.append("::");
   full_name.append(func_name);
#else
   H5std_string full_name = func_name;
   full_name.insert(0, "::");
   full_name.insert(0, fromClass());
#endif /*H5_VMS*/
   return (full_name);
}
Ejemplo n.º 3
0
//--------------------------------------------------------------------------
// Function:    IdComponent::inMemFunc
///\brief       Makes and returns string "<class-name>::<func_name>"
///\param       func_name - Name of the function where failure occurs
// Description
///             Concatenates the class name of this object with the
///             passed-in function name to create a string that indicates
///             where the failure occurs.  The class-name is provided by
///             fromClass().  This string will be used by a base class when
///             an exception is thrown.
// Programmer   Binh-Minh Ribler - Aug 6, 2005
//--------------------------------------------------------------------------
H5std_string IdComponent::inMemFunc(const char* func_name) const
{
    H5std_string full_name = func_name;
    full_name.insert(0, "::");
    full_name.insert(0, fromClass());
    return (full_name);
}