Impact Acquire SDK C++
Bind Features Of An Unknown Type

If the type is unclear for a particular feature some more complex code is needed:

Device* pDev = getTheDevicePointerFromSomewhere();
DeviceComponentLocator locator(pDev, dltSetting, "Base");
Component feature;
locator.bindComponent( feature, "Feature" );
// now the feature is ready to use when available:
if( feature.isValid() )
{
cout << "Feature " << feature.name() << " is a " << feature.typeAsString() << endl;
switch( feature.type() )
{
case ctPropString:
PropertyS stringProp( feature );
doStringPropAction( stringProp );
break;
case ctPropInt:
PropertyI intProp( feature );
doIntPropAction( intProp );
break;
case ctPropInt64:
PropertyI64 longProp( feature );
doLongPropAction( longProp );
break;
case ctPropFloat:
PropertyF floatProp( feature );
doFloatPropAction( floatProp );
break;
default:
// don't handle this feature. This might be a method or a list or a property
// of a type not dealt with in the 'case' statements from above
break;
}
}
else
{
// oops... The feature is not offered by this device
}