User`s guide
Implementing Get and Set Support for Device-Specific Properties
6-11
In this example, the constructor accepts a handle to an IAdaptor object. Because the
toolbox establishes listeners on a per-instance basis, passing this handle can be helpful,
but it is not a requirement.
The IPropCustomGetFcn class defines one virtual function: the getValue() member
function. In this function, you define how your adaptor responds when a user requests
the current value of a property. For more information about the getValue() function,
see “Creating the getValue() Function for Your Class” on page 6-11.
#include "mwadaptorimaq.h"
#include "MyDeviceImaq.h" // For this example
class MyDevicePropGetListener : public IPropCustomGetFcn
{
public:
// Constructor/Destructor
MyDevicePropGetListener(MyDeviceAdaptor* parent):
_parent(parent) {}
virtual ~MyDevicePropGetListener() {};
virtual void getValue(imaqkit::IPropInfo* propertyInfo,
void* value);
private:
// Declare handle to parent as member data.
MyDeviceAdaptor* _parent;
};
Creating the getValue() Function for Your Class
When a user requests the current value of a property, the engine calls the getValue()
function of the get listener class associated with the property.
Your getValue() function must accept two parameters:
void getValue(IPropInfo* propertyInfo, void* value)
• propertyInfo is a handle to an IPropInfo object.—The IPropInfo class is
the interface that lets you get information about the property. For example, using