From daf50943115ba23e0a2839123a89d93a21d09ca2 Mon Sep 17 00:00:00 2001 From: Jerry Jin Date: Thu, 16 Feb 2017 19:35:38 +0800 Subject: [PATCH] convert enum --- README.md | 6 +----- src/capletvolstructure.cpp | 9 ++++++--- src/piecewiseyieldcurve.cpp | 4 +++- src/smilesection.cpp | 6 ++++-- src/termstructures.cpp | 3 ++- 5 files changed, 16 insertions(+), 12 deletions(-) diff --git a/README.md b/README.md index aae0e55..906bd29 100644 --- a/README.md +++ b/README.md @@ -13,14 +13,10 @@ All functions in this project are Async, they are exported to [Promise](https:// npm install quantlib ``` -* Windows - 32-Bit +* Windows `npm install quantlib` will do everything, including the node package installation and pre-built native addon (no dependency) download, you can start use it right away. -* Windows - 64-Bit - -I will try to build and upload the pre-built addon, before that, Please refer to [how to build](#building-the-native-addon) below - * Linux & Mac Please refer to [how to build](#building-the-native-addon) below diff --git a/src/capletvolstructure.cpp b/src/capletvolstructure.cpp index 7913f0f..cfa7ae5 100644 --- a/src/capletvolstructure.cpp +++ b/src/capletvolstructure.cpp @@ -154,6 +154,7 @@ void ConstantOptionletVolatilityWorker::Execute(){ )); // Construct the Object + std::map strEnum; boost::shared_ptr object( new QuantLibAddin::ConstantOptionletVolatility( valueObject, @@ -162,7 +163,7 @@ void ConstantOptionletVolatilityWorker::Execute(){ BusinessDayConventionEnum, VolatilityLibObj, DayCounterEnum, - mVolatilityType, + strEnum[mVolatilityType], mDisplacement, false )); @@ -512,6 +513,7 @@ void StrippedOptionletWorker::Execute(){ )); // Construct the Object + std::map strEnum; boost::shared_ptr object( new QuantLibAddin::StrippedOptionlet( valueObject, @@ -523,7 +525,7 @@ void StrippedOptionletWorker::Execute(){ mStrikes, VolatilitiesLibObj, DayCounterEnum, - mVolatilityType, + strEnum[mVolatilityType], mDisplacement, false )); @@ -717,6 +719,7 @@ void OptionletStripper1Worker::Execute(){ )); // Construct the Object + std::map strEnum; boost::shared_ptr object( new QuantLibAddin::OptionletStripper1( valueObject, @@ -725,7 +728,7 @@ void OptionletStripper1Worker::Execute(){ mSwitchStrike, mAccuracy, MaxIterLib, - mVolatilityType, + strEnum[mVolatilityType], mDisplacement, false )); diff --git a/src/piecewiseyieldcurve.cpp b/src/piecewiseyieldcurve.cpp index 3610d84..365dcfc 100644 --- a/src/piecewiseyieldcurve.cpp +++ b/src/piecewiseyieldcurve.cpp @@ -285,6 +285,8 @@ void PiecewiseYieldCurveMixedInterpolationWorker::Execute(){ )); // Construct the Object + + std::map strEnum; boost::shared_ptr object( new QuantLibAddin::PiecewiseYieldCurve( valueObject, @@ -297,7 +299,7 @@ void PiecewiseYieldCurveMixedInterpolationWorker::Execute(){ mAccuracy, mTraitsID, mInterpolatorID, - mMixedInterpolationBehavior, + strEnum[mMixedInterpolationBehavior], PillarsBeforeChangeLib, false )); diff --git a/src/smilesection.cpp b/src/smilesection.cpp index e268b0c..d93f50f 100644 --- a/src/smilesection.cpp +++ b/src/smilesection.cpp @@ -60,6 +60,7 @@ void FlatSmileSectionWorker::Execute(){ )); // Construct the Object + std::map strEnum; boost::shared_ptr object( new QuantLibAddin::FlatSmileSection( valueObject, @@ -68,7 +69,7 @@ void FlatSmileSectionWorker::Execute(){ DayCounterEnum, RefDateLib, mAtmValue, - mVolatilityType, + strEnum[mVolatilityType], mDisplacement, false )); @@ -989,6 +990,7 @@ void InterpolatedSmileSectionWorker::Execute(){ )); // Construct the Object + std::map strEnum; boost::shared_ptr object( new QuantLibAddin::InterpolatedSmileSection( valueObject, @@ -997,7 +999,7 @@ void InterpolatedSmileSectionWorker::Execute(){ StdDevsLibObj, AtmLevelLibObj, DayCounterEnum, - mVolatilityType, + strEnum[mVolatilityType], mDisplacement, false )); diff --git a/src/termstructures.cpp b/src/termstructures.cpp index 92470a9..83d395a 100644 --- a/src/termstructures.cpp +++ b/src/termstructures.cpp @@ -868,6 +868,7 @@ void InterpolatedYieldCurveWorker::Execute(){ )); // Construct the Object + std::map strEnum; boost::shared_ptr object( new QuantLibAddin::InterpolatedYieldCurve( valueObject, @@ -879,7 +880,7 @@ void InterpolatedYieldCurveWorker::Execute(){ JumpDatesLib, mTraitsID, mInterpolatorID, - mMixedInterpolationBehavior, + strEnum[mMixedInterpolationBehavior], NRateHelperLib, false ));