User`s guide
Creating Stub Implementation of Your Adaptor Class
4-5
Creating Stub Implementation of Your Adaptor Class
To create a stub implementation of your adaptor class, follow this procedure:
1
Add a C++ header file to the adaptor C++ project. This header file will hold the
definition of your adaptor class. You can give your class any name. This example
uses the following naming convention:
vendor_name + adaptor
For this example, the header file that contains the adaptor class definition is named
MyDeviceAdaptor.h.
2
Copy the following class definition into the header file. This adaptor class contains
all the virtual functions defined by the IAdaptor abstract class.
#include "mwadaptorimaq.h" // required header
class MyDeviceAdaptor : public imaqkit::IAdaptor {
public:
// Constructor and Destructor
MyDeviceAdaptor(imaqkit::IEngine* engine, const
imaqkit::IDeviceInfo* deviceInfo,
const char* formatName);
virtual ~MyDeviceAdaptor();
// Adaptor and Image Information Functions
virtual const char* getDriverDescription() const;
virtual const char* getDriverVersion() const;
virtual int getMaxWidth() const;
virtual int getMaxHeight() const;
virtual int getNumberOfBands() const;
virtual imaqkit::frametypes::FRAMETYPE getFrameType() const;
// Image Acquisition Functions
virtual bool openDevice();
virtual bool closeDevice();
virtual bool startCapture();
virtual bool stopCapture();
};