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" );
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:
break;
}
}
else
{
}