Manuals >Reference >Drivers Print version of this Book (PDF file) |
![]() ![]() |
|||||||||||
|
||||||||||||
Class Hierarchy for User-Contributed DriversThe diagram in the following figure depicts the relationships of the classes that are of principle interest to a user creating a driver. The arrows without labels indicate pointers held in the objects.
At the top of the hierarchy are classes named unit, instr, and instr_options. All instrument drivers in IC-CAP consist of classes derived from these 3 classes. When Agilent Technologies adds a driver to IC-CAP, one new class is derived from instr, one or more new classes are derived from unit, and one new class is derived from instr_options. The process of deriving new classes from these base classes permits the new driver to efficiently reuse generic functionality present in the base classes, while also introducing new code where necessary to accommodate the specialized needs of the new instrument. The division of a driver into unit, instr, and instr_options components helps modularity. Generally, the role of each of these parts is as follows:
Intermediate in the hierarchy are 3 classes named user_unit, user_instr, and user_instr_options. These serve the following purposes:
At the bottom of the hierarchy are examples of classes introduced by the Driver Generation Scripts. When a user adds a driver to IC-CAP, the Driver Generation Scripts add a class derived from user_instr, one or more classes derived from user_unit, and a class derived from user_instr_options. The class derived from user_instr_options, which is hp4194_table in the example driver, is completely declared and implemented when the user runs the mk_instr_ui script. In other words, a programmer using the Open Measurement Interface need not become involved with any coding that pertains to this user interface component of the driver. The programmer also does not need to provide declarations for any new classes needed for the driver, since these are completely written out when the driver generation scripts mk_unit, mk_instr, and mk_instr_ui are run. However, the programmer is required to fill-in the implementations of several functions that ultimately perform the work done by the driver. |
||||||||||||
|
||||||||||||
![]() ![]() |