Programming Reference:GenericADC Class

From BCI2000 Wiki
Jump to: navigation, search

The GenericADC class is a base class for data acquisition components. Its main purpose is to provide a common ancestor for these components, to make them identifiable at run-time using run-time-type-information (RTTI). Thus, it forwards the GenericFilter class interface, except for the following changes:

Purely Virtual Halt

Unlike GenericFilter, the Halt member function is declared "purely virtual" in GenericADC. This implies that a derived class must provide its own implementation of Halt, even if that implementation may be empty.

This is to stress the importance of a proper implementation of Halt for smooth system operation. More often than not, a source module will rely on asynchronous activity in a hardware driver, or a separate data acquisition thread maintained by the GenericADC descendant itself. Such asynchronous activity must be halted from the Halt function in order to ensure proper behavior of the source module at reconfiguration and shutdown time.

Empty Output

For GenericADC descendants, the output signal's dimensions should be specified as "empty" in the Preflight function.

See also

Programming Tutorial:Implementing a Data Acquisition Module, Programming Reference:GenericFilter Class