question about vector of handl

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

question about vector of handl

Yang, Rui

Hihi,

 

I have a problem to define a constructor which takes vector of handles as arguments, like

const std::vector<QuantLib::Handle<QuantLib::YieldTermStructure> >&

 

I can see const QuantLib::Handle<QuantLib::YieldTermStructure>& in QuantLibObjects

The xml is defined as:

          <Parameter name='YieldCurve' exampleValue='EURYC' default='""'>

            <type>QuantLib::YieldTermStructure</type>

            <superType>libToHandle</superType>

            <tensorRank>scalar</tensorRank>

            <description>forecasting yield term structure.</description>

          </Parameter>

 

Accordingly, I define my xml as:

          <Parameter name='YieldCurve' exampleValue='EURYC' default='""'>

            <type>QuantLib::YieldTermStructure</type>

            <superType>libToHandle</superType>

            <tensorRank>vector</tensorRank>

            <description>forecasting yield term structure.</description>

          </Parameter>

 

But when the create_ xxx.cpp is generated, I get one statement:

std::vector<boost::shared_ptr<QuantLib::YieldTermStructure> > DiscountCurvesLibObj =

ObjectHandler::ohVariantToObjectVector<QuantLib::YieldTermStructure, QuantLibAddin::YieldTermStructure>(

            DiscountCurves, "DiscountCurves");

 

This get the error msg: 'ohVariantToObjectVector' : is not a member of 'ObjectHandler'

My version is ql_0_9_7. In this version, I can’t find 'ohVariantToObjectVector' in 'ObjectHandler'. But in previous version, I can. It seems I didn’t define the xml file correctly. Can anybody tell me how to solve this problem? Thanks a lot for your help!

 

This email and any attachments are confidential and may also be privileged.  If you are not the addressee, do not disclose, copy, circulate or in any other way use or rely on the information contained in this email or any attachments.  If received in error, notify the sender immediately and delete this email and any attachments from your system.  Emails cannot be guaranteed to be secure or error free as the message and any attachments could be intercepted, corrupted, lost, delayed, incomplete or amended.  Standard Chartered PLC and its subsidiaries do not accept liability for damage caused by this email or any attachments and may monitor email traffic.

 

Standard Chartered PLC is incorporated in England with limited liability under company number 966425 and has its registered office at 1 Aldermanbury Square, London, EC2V 7SB.

 

Standard Chartered Bank ("SCB") is incorporated in England with limited liability by Royal Charter 1853, under reference ZC18.  The Principal Office of SCB is situated in England at 1 Aldermanbury Square, London EC2V 7SB. In the United Kingdom, SCB is authorised and regulated by the Financial Services Authority under FSA register number 114276.

 

If you are receiving this email from SCB outside the UK, please click http://www.standardchartered.com/global/email_disclaimer.html to refer to the information on other jurisdictions.


------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
QuantLib-dev mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-dev
Reply | Threaded
Open this post in threaded view
|

Re: question about vector of handl

Eric Ehlers-2
Hello,

On Fri, 2009-11-06 at 14:52 +0800, Yang, Rui wrote:

> Hihi,
>
>  
>
> I have a problem to define a constructor which takes vector of handles
> as arguments, like
>
> conststd::vector<QuantLib::Handle<QuantLib::YieldTermStructure> >&
>
>  
>
> I can see const QuantLib::Handle<QuantLib::YieldTermStructure>& in
> QuantLibObjects
>
> The xml is defined as:
>
>           <Parameter name='YieldCurve' exampleValue='EURYC'
> default='""'>
>
>             <type>QuantLib::YieldTermStructure</type>
>
>             <superType>libToHandle</superType>
>
>             <tensorRank>scalar</tensorRank>
>
>             <description>forecasting yield term
> structure.</description>
>
>           </Parameter>
>
>  
>
> Accordingly, I define my xml as:
>
>           <Parameter name='YieldCurve' exampleValue='EURYC'
> default='""'>
>
>             <type>QuantLib::YieldTermStructure</type>
>
>             <superType>libToHandle</superType>
>
>             <tensorRank>vector</tensorRank>
>
>             <description>forecasting yield term
> structure.</description>
>
>           </Parameter>
>
>  
>
> But when the create_ xxx.cpp is generated, I get one statement:
>
> std::vector<boost::shared_ptr<QuantLib::YieldTermStructure> >
> DiscountCurvesLibObj =
>
> ObjectHandler::ohVariantToObjectVector<QuantLib::YieldTermStructure,
> QuantLibAddin::YieldTermStructure>(
>
>             DiscountCurves, "DiscountCurves");
>
>  
>
> This get the error msg: 'ohVariantToObjectVector' : is not a member of
> 'ObjectHandler'
>
> My version is ql_0_9_7. In this version, I can’t find
> 'ohVariantToObjectVector' in 'ObjectHandler'. But in previous version,
> I can. It seems I didn’t define the xml file correctly. Can anybody
> tell me how to solve this problem? Thanks a lot for your help!

My best guess would be that you defined the XML file correctly, but that
the resulting autogenerated code requires a conversion function that has
not been implemented.

If you see that conversion function in a previous release it probably
means that I deleted it because it was broken and no longer required for
the core code.

Regards,
Eric



------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
QuantLib-dev mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-dev