Main Content

Defining Your Adaptor Class

The next four topics describe how to define your adaptor class and instantiate an object of this class. Every adaptor must define a class that is a subclass of the adaptor kit IAdaptor abstract class. This abstract class defines several virtual functions that your adaptor class must implement. The next four topics get you started with an adaptor class implementation by creating a stub implementation. This stub implementation will enable you to create a video input object with your adaptor using the videoinput function. In subsequent topics, you complete adaptor development by fleshing out the implementations of these virtual functions.

When a user calls the videoinput function to create a video input object, the toolbox engine calls two of the exported functions in your adaptor:

  • getDeviceAttributes()

  • createInstance()

(To see a flow-of-control diagram that shows how these functions fit with the other required exported functions, see Using Adaptor Exported Functions.)

The getDeviceAttributes() function defines which properties of the device that you want to expose to users. This function is described only briefly in this chapter (see Identifying Video Sources). For complete information about implementing this exported function, see Defining Device-Specific Properties.

The toolbox engine calls your adaptor's createInstance() function to instantiate an object of the adaptor class. Every adaptor must define a class that is a subclass of the IAdaptor abstract class, providing implementations of the pure virtual functions defined in this abstract class.

This chapter describes how to create a stub implementation of your adaptor class (see Creating Stub Implementation of Your Adaptor Class) and create the constructor and destructor for this class, see Instantiating an Adaptor Object. In Acquiring Image Data you flesh out the implementation of these functions.

Note

Because each instance of your adaptor class is associated with a specific format selected by the user, most of the information returned by these functions is static.