Impact Acquire SDK C++
Locating Properties

To bind a C++ property object to a certain feature offered by the device at runtime the C++ interface can be used in several ways. One possibility is to use a mvIMPACT::acquire::DeviceComponentLocator object. Let's assume an application wants to access a 64 bit integer property that is called Width and is located somewhere in the devices feature tree. In this case, we want to bind the property of the base setting. The code to bind the device feature to a C++ object would look more or less like this:

Device* pDev = getTheDevicePointerFromSomewhere();
PropertyI64 width;
// create a locator object that can iterate and find a driver feature
DeviceComponentLocator locator(pDev, dltSetting, "Base");
// find the feature and bind it to the property object
locator.bindComponent( width, "Width" );
// now the property is ready to use when available:
if( width.isValid() )
{
width.write( width.read( plMaxValue ) / 2 ); // set the width to half of its maximum value
}
else
{
// oops... The feature is not offered by this device
}