Posted by
Luigi Ballabio on
URL: http://quantlib.414.s1.nabble.com/reference-of-boost-shared-ptr-instead-of-Handle-tp7623p7644.html
On Thu, 2009-09-17 at 09:02 +1000, Yan Kuang wrote:
> I don't think we need to reverting the change, I think my suggestion
> will work, please give a comment
> on my email from yesterday (and I retached below).
Yes, I'm sure it will work. However, it's a bigger change, and I'm not
sure that the resulting interface is the one we want in the end. We'll
have to think a bit more about it.
For instance, about the sketch you made:
> EuriborSwap::EuriborSwap(const Period& tenor,
> const Handle<YieldTermStructure>& fdw6M,
> const Handle<YieldTermStructure>& fdw3M,
> const Handle<YieldTermStructure>& discount)
Now if you want to create a swap index, you have to pass two forward
curves even though you're only going to use one.
Moreover:
> Add two data members (private) to EuriborSwap
> Handle<YieldTermStructure> fdw6M_;
> Handle<YieldTermStructure> fdw3M_;
>
> Add one data member (protected) in swapIndex
>
> Handle<YieldTermStructure> discount_;
>
> EurLiborSwap::create(const Period& tenor) const {
> return boost::shared_ptr<SwapIndex>(
> new EurLiborSwap(tenor, fdw6M_, fdw3M_, discount_);
It's three more data members and one method, now. Do we want to add the
baggage to SwapIndex, or do we leave SwapIndex alone and create a
separate factory class?
Luigi
--
The wisdom of the wise and the experience of the ages are perpetuated
by quotations.
-- Benjamin Disraeli
------------------------------------------------------------------------------
Come build with us! The BlackBerry® Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9-12, 2009. Register now!
http://p.sf.net/sfu/devconf_______________________________________________
QuantLib-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-users