User`s guide
4 Defining Your Adaptor Class
4-2
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” on page 3-2.)
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” on page 4-9). For complete information about
implementing this exported function, see “Defining Device-Specific Properties” on page
6-2.
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” on page 4-5) and create the
constructor and destructor for this class, see “Instantiating an Adaptor Object” on page
4-11. In “Acquiring Image Data” on page 5-2 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.