示例#1
0
LOCAL_C void TestFields(CContactItemFieldSet& aFields, TInt aField1,TInt aField2,TInt aField3,TInt aField4)
	{
	TestField(aFields,0,aField1);
	TestField(aFields,1,aField2);
	TestField(aFields,2,aField3);
	TestField(aFields,3,aField4);
	}
示例#2
0
int processInventoryRdr(SaHpiSessionIdT sessionId,
			SaHpiResourceIdT resourceId,
			SaHpiRdrT * rdr, SaHpiInventoryRecT * inventoryRec)
{
	SaErrorT status;
	int retval;
	SaHpiEntryIdT AreaId, NextAreaId;
	SaHpiIdrAreaHeaderT Header;
	SaHpiIdrInfoT Info;

	status = saHpiIdrInfoGet(sessionId, resourceId,
				 inventoryRec->IdrId, &Info);

	if (status != SA_OK) {
		retval = SAF_TEST_UNRESOLVED;
		e_print(saHpiIdrInfoGet, SA_OK, status);
	} else if (Info.ReadOnly) {
		retval = SAF_TEST_NOTSUPPORT;
	} else {

		retval = SAF_TEST_NOTSUPPORT;

		NextAreaId = SAHPI_FIRST_ENTRY;
		while ((retval == SAF_TEST_NOTSUPPORT) &&
		       (NextAreaId != SAHPI_LAST_ENTRY)) {

			AreaId = NextAreaId;
			status = saHpiIdrAreaHeaderGet(sessionId,
						       resourceId,
						       inventoryRec->IdrId,
						       SAHPI_IDR_AREATYPE_UNSPECIFIED,
						       AreaId,
						       &NextAreaId, &Header);

			if (status == SA_ERR_HPI_NOT_PRESENT) {
				// do nothing
			} else if (status != SA_OK) {

				retval = SAF_TEST_UNRESOLVED;
				e_print(saHpiIdrAreaHeaderGet, SA_OK, status);

			} else if (!Header.ReadOnly) {

				retval = TestField(sessionId, resourceId,
						   inventoryRec->IdrId, AreaId);
			}
		}
	}

	return retval;
}
示例#3
0
/**
 * Add a new component to the group.
 * It is assumed at this stage that the component is a good match for the group.
 * @param aComponent is the new component to add
 */
bool BOM_TABLE_GROUP::AddComponent( BOM_TABLE_COMPONENT* aComponent )
{
    if( !aComponent )
        return false;

    // To be a match, all fields must match!
    bool match = true;

    for( auto* column : m_columnList->Columns )
    {
        // Ignore any columns marked as "not used for sorting"
        if( !column->IsUsedToSort() )
            continue;

        match = TestField( column, aComponent );

        // Escape on first mismatch
        if( !match )
        {
            break;
        }
    }

    if( match )
    {
        aComponent->SetParent( this );
        Components.push_back( aComponent );
        return true;
    }
    else
    {
        return false;
    }

    return false;
}