Login  Register

Exposing a new function in QLAddinCpp

Posted by Lapin on Dec 10, 2012; 1:17pm
URL: http://quantlib.414.s1.nabble.com/Exposing-a-new-function-in-QLAddinCpp-tp13793.html

All,

I have finally manage to compile a new C++ example with QLAddinCpp. I will post the update as soon as I can.
In the meantime, I want to expose new functions (that are already available in XL but not in C++) to play around.

For example, I want to expose ohObjectClassName.
To do so, I have changed the xml file (objects.xml in ohgensrc/functions) as below:

    <Procedure name='ohObjectClassName'>   
      <description>get the object class name</description>
      <alias>ObjectHandler::Repository::instance().className</alias>
      <SupportedPlatforms>
        <SupportedPlatform name='Excel'/>
        <SupportedPlatform name='Cpp'/>
      </SupportedPlatforms>
      <ParameterList>
        <Parameters>
          <Parameter name='ObjectID'>
            <type>string</type>
            <tensorRank>vector</tensorRank>
            <description>Object ID name.</description>
          </Parameter>
        </Parameters>
      </ParameterList>
      <ReturnValue>
        <type>string</type>
        <tensorRank>vector</tensorRank>
      </ReturnValue>
    </Procedure>

The challenge is as below. In AddinCpp, the file valueobjects.hpp is not picking up the changes. While it occurs very easily with the XL addins, the Cpp addins seems to be somewhat broken. My guess is gensrc does not rebuild the valueobjects.hpp/cpp files but I have no clue where to fix it.

If someone have faced the same issue, I would be very gratefull.

Regards