-
Notifications
You must be signed in to change notification settings - Fork 1.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merge DatedOISRateHelper with OISRateHelper #2103
Merge DatedOISRateHelper with OISRateHelper #2103
Conversation
b052a36
to
b2654b6
Compare
Thanks! Is this compatible with #1912, or a subset of it, or alternative? Also, it seems to me that the duplication (or the additional template base class) are there because we wanted to inherit |
This is a subset of #1912 with a more self-contained and possibly slightly simpler implementation. The same approach can be used to add I don't think we need to copy-paste code from If we want "relative" and "dated" helpers to be different constructors in the same class, we can simply add a bool to
|
For the two classes solution another option is to use virtual base class and multiple inheritance instead of templates. I'm not sure if this is more easily understood and it has some run-time overhead. |
I'd try going for one class; it's the same instrument, having two classes was an accident of the implementation. Drawback 1 can be addressed in the SWIG layer: instead of exporting the dated constructor directly, we can export it via a |
b2654b6
to
571caf4
Compare
571caf4
to
9d9f90c
Compare
Add a second constructor overload to OISRateHelper which works like DatedOISRateHelper. Deprecate DatedOISRateHelper. This removes a lot of code duplication and also adds support for custom pillar dates to DatedOISRateHelper's equivalent.
9d9f90c
to
912c944
Compare
@lballabio I merged DatedOISRateHelper with OISRateHelper and deprecated the former as discussed. Please take a look. |
I've pushed a few very minor changes but it looks good to me, thanks a lot. |
We can add DatedSwapRateHelper in the same way. |
Add a second constructor overload to OISRateHelper which works like
DatedOISRateHelper. Deprecate DatedOISRateHelper.
This removes a lot of code duplication and also adds support for custom
pillar dates to DatedOISRateHelper's equivalent.