Monday, September 17, 2007

Note03: How can we add our own function to QuantLibAddin

1. Add a new function to an existing category
A. Eg: Our function contains in
QuantLibAddin/qla/****.cpp
QuantLibAddin/qla/****.hpp
B. File generalutils.hpp in the qla directory can be included to pick up additional utility functions.
C. QuantLibAddin is itself a C++ Addin which can be loaded directly to standalone C++ client applications. So it's best to test the new functionality in a standalone program before autogenerating the source for the spreadsheets.
Then Edit the file
QuantLibAddin/Clients/C++/instruments.cpp
adding some example code to demonstrate the use of the new function.
D. Edit QuantLibAddin/srcgen/instruments.xml to provide definition of the new function. See the link for the details of the Edition!

E. Rebuild the srcgen project to generate the source for the Addins
F. Rebuild the Addins.
G. Amend the client files ...
QuantLibAddin/Clients/Excel/instruments.xls QuantLibAddin/Clients/Calc/instruments.sxc QuantLibAddin/Clients/C/instruments.c
... to demonstrate the use of the new function.

2. Add a new category
see link...

No comments: