Tutorial to use ObjectHandler outside of QuantLibXL
Posted by
Lisa Ann on
Aug 12, 2015; 2:21pm
URL: http://quantlib.414.s1.nabble.com/Tutorial-to-use-ObjectHandler-outside-of-QuantLibXL-tp16776.html
Hi,
among M. Joshi's (and others)
xlw examples, a Visual C++ 2010 solution named "ObjectCacheDemo.sln" is present. README.txt by Narinder Claire says:
It has been asked several times on a number of forums and mailing lists how to implement the feature of persistent objects in XLW. The standard response from the XLW developers, and rightly so, is to use ObjectHandler. However sometimes what is required is a very small and an extremely light-weight solution and some other times just a demonstration of how it could possibly be done. For these requests I have coded a VERY simple implementation of the feature just to illustrate the concept.Source code shows that permanent Excel objects use multiple inheritance to inherit features either from singleton< class T > and from std::map< std::string, class T >, hence no multiple instances of the same object can be created and std::map indexing method can be used to retrieve objects by using a descriptive std::string.
I know that ObjectHandler is used by QuantLibXL to generate all the "obj_01270#0002"-like stuff in Excel cells, but I've not been able to find any documentation explaining how to include and use ObjectHandler classes and methods from scratch: assuming I take advantage of xlw's [cppinterface.h / source.cpp / xlwRapper.cpp / RunInterfaceGenerator] mechanism... I would like to know what to #include in my class and how to use ObjectHandler classes and methods to achieve the same result that QuantLibXL does.
Thanks