855e2007a0
DeviceInterface, and the main code talks to the devices using virtual methods of Device Interface. |
||
---|---|---|
.. | ||
main.cc | ||
main.h | ||
Makefile.in | ||
module1.cc | ||
module2.cc | ||
modules.h | ||
README | ||
uselib.out.expected |
test10-modvirtual Create an interface class in modules.h called DeviceInterface. Each module creates a child class of DeviceInterface, and implements its methods. This test loads the modules, calls the module's module_init() which instantiates a subclass of DeviceInterface and returns a pointer to it. Then main can call operate on this object using the DeviceInterface class.