next up previous contents
Next: A minimal example Up: C++ plug-in source code Previous: C++ plug-in source code   Contents

Introduction

The following code fragments illustrate the extraction of pointers to QSAS data objects from the plug-in argument, the use of QDOS methods to read the input data-object contents, and the construction and return of new output data-objects. These constitute the essential C++ wrapper that must surround a plug-in; this wrapper may call functions coded in other languages to apply algorithms to the data extracted from the QDOS data-objects.

Note that dynamic loading implies that an executing plug-in is part of the QSAS application process: this permits shared memory and so avoids copying of large data-objects simply to read them, and allows the plug-in to call any QSAS built-in procedure, not just QDOS methods. But it also permits a plug-in bug to corrupt the contents of data-objects and other parts of QSAS, and crash the whole application through a fatal error. Great care should therefore be taken to trap plug-in errors, even if only to print a generic failure message and return error status to the QPLUGUI, as this is greatly preferable to crashing QSAS.


next up previous contents
Next: A minimal example Up: C++ plug-in source code Previous: C++ plug-in source code   Contents
Anthony Allen 2005-11-07