Next: QSAS Template Language (QTPL) Up: Writing QSAS Plug-ins Previous: Related material Contents

#
Introduction

QSAS supports the dynamic loading and execution of separately-built plug-ins: these are software modules that accept QSAS data objects and constants as their input, and return new data objects or values as their output upon successful completion. This permits users to supplement QSAS's built-in facilities with their own specialised functions without having to rebuild the whole QSAS application. It also provides a mechanism for distributing self-contained additions to QSAS without the overhead of issuing a full new release.

QSAS plug-ins are loaded and run through a dynamic Plug-in Window which is described in the `QSAS Help Pages', CU-QMW-MA-0014. The user first selects a template file that describes the plug-in in QSAS Template Language (`QTPL`). The template describes the arguments of the plug-in, how to find and load it, and optionally provides additional labelling, layout, and help information for the Plug-in Window.

After a plug-in template has been read successfully, the Plug-in Window is constructed with slots for the input and output arguments of the plug-in according to the template description. When the user has supplied valid entries for all mandatory input arguments, QSAS can be asked to load and run the plug-in. Arguments are communicated between QSAS and the plug-in by means of a `C++` list object containing pointers to QSAS data objects, and the plug-in return value indicates its completion status. The plug-in can write status messages and diagnostic information to a scrolling text window within its Window.

`C++` is used for the software interface between QSAS and plug-ins because the QSAS Data Object System (QDOS) is itself written in `C++`, and so `C++` methods are used to extract data from the input data objects and to create new data objects in which to return results. However it is possible to use code in other languages such as `C` and `FORTRAN` as the kernel of a plug-in by enclosing it in a `C++` `wrapper': the wrapper takes care of the interfaces with QSAS and QDOS before and after calling the underlying non-`C++` function or subroutine with arguments of the types it requires. The details of how to bind together such mixed-programming-language components are system-dependent and outside the scope of this document.

Next: QSAS Template Language (QTPL) Up: Writing QSAS Plug-ins Previous: Related material Contents