|
From: Eric E. <eri...@na...> - 2009-11-10 23:08:08
|
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 |