Click or drag to resize

DriverSession Class

The DriverSession class houses a great deal of the functionality in the Nimbus Runtime Library. Each IVI-C driver project contains a definition for a single DriverSession-derived class maintained in the driver project's DriverSession.h file. This class is named <driverProject>DriverSession, and a single instance of this class is created when a client application calls the driver's init or InitWithOptions function.

The driver session class serves a couple of very important roles in implementing an IVI-C driver. First, it serves as a repository for session-specific state. Each driver session must track the value of driver operational attriutes, such as the simulation state, the state of range checking, etc. Each driver session also holds the cached value of any attributes for which state caching has been enabled. It also holds special maps for supporting repeated capabilities.

The driver session class also provides a means to override the default behavior of certain driver operations provided by the Nimbus Runtime Library. For instance, drivers that do not use the VISA library for their I/O communications must override functions such as InitializeIO and CloseIO. These overrides are placed within the definition of the driver session class in the driver project's DriverSession.h file.

Because the driver session class plays such a central role in IVI-C driver operation, its functions can be accessed in two ways -- from within the DriverSession-derived class in the DriverSession.h file, and by using global functions from within a function or attribute implementation in the driver project's <prefix>.cpp file. Both forms are functionally equivalent and differ only the first parameter -- the ViSession parameter which must be supplied when accessing the driver session class from outside the class definition. For this reason, both forms of each function are presented together in this section.

In This Section

Download a complete CHM version of this documentation here.