static void binopchk(int op, int p1, int p2) { if (ASPLUS == op) op = PLUS; else if (ASMINUS == op) op = MINUS; if (inttype(p1) && inttype(p2)) return; else if (comptype(p1) || comptype(p2)) /* fail */; else if (PVOID == p1 || PVOID == p2) /* fail */; else if (PLUS == op && (inttype(p1) || inttype(p2))) return; else if (MINUS == op && (!inttype(p1) || inttype(p2))) return; else if ((EQUAL == op || NOTEQ == op || LESS == op || GREATER == op || LTEQ == op || GTEQ == op) && (p1 == p2 || (VOIDPTR == p1 && !inttype(p2)) || (VOIDPTR == p2 && !inttype(p1))) ) return; error("invalid operands to binary operator", NULL); }
//-------------------------------------------------------------------------- // Function: CompType::getMemberCompType ///\brief Returns the compound datatype of the specified member in this /// compound datatype. ///\param member_num - IN: Zero-based index of the member ///\return CompType instance ///\exception H5::DataTypeIException // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- CompType CompType::getMemberCompType( unsigned member_num ) const { try { CompType comptype(p_get_member_type(member_num)); return(comptype); } catch (DataTypeIException E) { throw DataTypeIException("CompType::getMemberCompType", E.getDetailMsg()); } }
//-------------------------------------------------------------------------- // Function: AbstractDs::getCompType ///\brief Returns the compound datatype of this abstract dataset which /// can be a dataset or an attribute. ///\return CompType instance ///\exception H5::DataTypeIException // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- CompType AbstractDs::getCompType() const { // Gets the id of the datatype used by this dataset or attribute using // p_get_type. p_get_type calls either H5Dget_type or H5Aget_type // depending on which object invokes getCompType. Then, create and // return the CompType object try { CompType comptype(p_get_type()); return(comptype); } catch (DataSetIException E) { throw DataTypeIException("DataSet::getCompType", E.getDetailMsg()); } catch (AttributeIException E) { throw DataTypeIException("Attribute::getCompType", E.getDetailMsg()); } }