• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ OH_GET_REFERENCE函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中OH_GET_REFERENCE函数的典型用法代码示例。如果您正苦于以下问题:C++ OH_GET_REFERENCE函数的具体用法?C++ OH_GET_REFERENCE怎么用?C++ OH_GET_REFERENCE使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了OH_GET_REFERENCE函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: SEQSEQ

SEQSEQ(ANY) SAL_CALL CalcAddins_impl::qlRangeAccrualFloatersCouponSetPricer(
        const ANY &ObjectId,
        const ANY &RangeAccrualPricer,
        const ANY &Trigger) throw(RuntimeException) {
    try {

        // convert input datatypes to C++ datatypes

        std::string ObjectIdCpp;
        calcToScalar(ObjectIdCpp, ObjectId);

        std::string RangeAccrualPricerCpp;
        calcToScalar(RangeAccrualPricerCpp, RangeAccrualPricer);

        // convert object IDs into library objects

        OH_GET_REFERENCE(ObjectIdLibObjPtr, ObjectIdCpp,
            QuantLibAddin::RangeAccrualFloatersCoupon, QuantLib::RangeAccrualFloatersCoupon)

        OH_GET_REFERENCE(RangeAccrualPricerLibObjPtr, RangeAccrualPricerCpp,
            QuantLibAddin::RangeAccrualPricer, QuantLib::RangeAccrualPricer)

        // invoke the member function

        static bool returnValue = true;
        ObjectIdLibObjPtr->setPricer(
                RangeAccrualPricerLibObjPtr);

        // convert and return the return value



        SEQSEQ(ANY) retAnyArray;
        retAnyArray.realloc(1);
        SEQ(ANY) retAnyVector(1);
        STRING s = STRFROMASCII( std::string("VOID").c_str() );    
        retAnyVector[0] = CSS::uno::makeAny( s );
        retAnyArray[0] = retAnyVector;        
        return retAnyArray;

    } catch (const std::exception &e) {
        do { 
            std::ostringstream errorMsg; 
            errorMsg << "ERROR: qlRangeAccrualFloatersCouponSetPricer: " << e.what(); 
            OH_LOG_MESSAGE(errorMsg.str());
        
            SEQSEQ(ANY) retAnyArray;
            retAnyArray.realloc(1);
            SEQ(ANY) retAnyVector(1);
            STRING s = STRFROMASCII( errorMsg.str().c_str() );    
            retAnyVector[0] = CSS::uno::makeAny( s );
            retAnyArray[0] = retAnyVector;	    
            return retAnyArray;
        } while (false);
    }
}
开发者ID:mlbrock,项目名称:TmpRepo_QL,代码行数:56,代码来源:rangeaccrual.cpp


示例2: CALVanillaOption

    std::string CALVanillaOption(
            const std::string &ObjectId,
            const std::string &Payoff,
            const std::string &Exercise,
            const ObjectHandler::property_t &Permanent,
            const ObjectHandler::property_t &Trigger,
            const bool &Overwrite) {

        try {

        // convert input datatypes to C++ datatypes

        bool PermanentCpp = ObjectHandler::convert2<bool>(
            Permanent, "Permanent", false);

        // convert object IDs into library objects

        OH_GET_REFERENCE(PayoffLibObjPtr, Payoff,
            QuantLibAddin::StrikedTypePayoff, QuantLib::StrikedTypePayoff)

        OH_GET_REFERENCE(ExerciseLibObjPtr, Exercise,
            QuantLibAddin::Exercise, QuantLib::Exercise)

        // Construct the Value Object

        boost::shared_ptr<ObjectHandler::ValueObject> valueObject(
            new QuantLibAddin::ValueObjects::CALVanillaOption(
                ObjectId,
                Payoff,
                Exercise,
                PermanentCpp));

        // Construct the Object
        
        boost::shared_ptr<ObjectHandler::Object> object(
            new QuantLibAddin::VanillaOption(
                valueObject,
                PayoffLibObjPtr,
                ExerciseLibObjPtr,
                PermanentCpp));

        // Store the Object in the Repository

        std::string returnValue =
            ObjectHandler::Repository::instance().storeObject(ObjectId, object, Overwrite);

        // Convert and return the return value

        return returnValue;

        } catch (const std::exception &e) {
            OH_FAIL("Error in function CALVanillaOption : " << e.what());
        }
    }
开发者ID:jojogh,项目名称:QuantPlus,代码行数:54,代码来源:options.cpp


示例3: OH_GET_REFERENCE

XLL_DEC bool *qlRangeAccrualFloatersCouponSetPricer(
        char *ObjectId,
        char *RangeAccrualPricer,
        OPER *Trigger) {

    // declare a shared pointer to the Function Call object

    boost::shared_ptr<ObjectHandler::FunctionCall> functionCall;

    try {

        // instantiate the Function Call object

        functionCall = boost::shared_ptr<ObjectHandler::FunctionCall>(
            new ObjectHandler::FunctionCall("qlRangeAccrualFloatersCouponSetPricer"));

        ObjectHandler::validateRange(Trigger, "Trigger");

        // initialize the session ID (if enabled)

        SET_SESSION_ID

        // convert object IDs into library objects

        OH_GET_REFERENCE(ObjectIdLibObjPtr, ObjectId,
            QuantLibAddin::RangeAccrualFloatersCoupon, QuantLib::RangeAccrualFloatersCoupon)

        OH_GET_REFERENCE(RangeAccrualPricerLibObjPtr, RangeAccrualPricer,
            QuantLibAddin::RangeAccrualPricer, QuantLib::RangeAccrualPricer)

        // invoke the member function

        static bool returnValue = true;
        ObjectIdLibObjPtr->setPricer(
                RangeAccrualPricerLibObjPtr);

        // convert and return the return value

        return &returnValue;

    } catch (const std::exception &e) {
        ObjectHandler::RepositoryXL::instance().logError(e.what(), functionCall);
        return 0;
    } catch (...) {
        ObjectHandler::RepositoryXL::instance().logError("unkown error type", functionCall);
        return 0;
    }

}
开发者ID:fder78,项目名称:MyQuantLib,代码行数:49,代码来源:rangeaccrual.cpp


示例4: create_qlFwdToCotSwapAdapter

    boost::shared_ptr<ObjectHandler::Object> create_qlFwdToCotSwapAdapter(
        const boost::shared_ptr<ObjectHandler::ValueObject> &valueObject) {

        // convert input datatypes to C++ datatypes

        std::string ForwardModel =
            ObjectHandler::convert2<std::string>(valueObject->getProperty("ForwardModel"));

        bool Permanent =
            ObjectHandler::convert2<bool>(valueObject->getProperty("Permanent"));

        // convert object IDs into library objects

        OH_GET_REFERENCE(ForwardModelLibObjPtr, ForwardModel,
            QuantLibAddin::MarketModel, QuantLib::MarketModel)

        // update value object precedent IDs (if any)

        valueObject->processPrecedentID(ForwardModel);

        // construct and return the object

        boost::shared_ptr<ObjectHandler::Object> object(
            new QuantLibAddin::FwdToCotSwapAdapter(
                valueObject,
                ForwardModelLibObjPtr,
                Permanent));
        return object;
    }
开发者ID:fder78,项目名称:MyQuantLib,代码行数:29,代码来源:create_marketmodels.cpp


示例5: create_qlPseudoRootFacade

    boost::shared_ptr<ObjectHandler::Object> create_qlPseudoRootFacade(
        const boost::shared_ptr<ObjectHandler::ValueObject> &valueObject) {

        // convert input datatypes to C++ datatypes

        std::string Calibrator =
            ObjectHandler::convert2<std::string>(valueObject->getProperty("Calibrator"));

        bool Permanent =
            ObjectHandler::convert2<bool>(valueObject->getProperty("Permanent"));

        // convert object IDs into library objects

        OH_GET_REFERENCE(CalibratorLibObjPtr, Calibrator,
            QuantLibAddin::CTSMMCapletCalibration, QuantLib::CTSMMCapletCalibration)

        // update value object precedent IDs (if any)

        valueObject->processPrecedentID(Calibrator);

        // construct and return the object

        boost::shared_ptr<ObjectHandler::Object> object(
            new QuantLibAddin::PseudoRootFacade(
                valueObject,
                CalibratorLibObjPtr,
                Permanent));
        return object;
    }
开发者ID:fder78,项目名称:MyQuantLib,代码行数:29,代码来源:create_marketmodels.cpp


示例6: create_qlVanillaSwapFromSwapRateHelper

    boost::shared_ptr<ObjectHandler::Object> create_qlVanillaSwapFromSwapRateHelper(
        const boost::shared_ptr<ObjectHandler::ValueObject> &valueObject) {

        // convert input datatypes to C++ datatypes

        std::string SwapRateHelper =
            ObjectHandler::convert2<std::string>(valueObject->getProperty("SwapRateHelper"));

        bool Permanent =
            ObjectHandler::convert2<bool>(valueObject->getProperty("Permanent"));

        // convert object IDs into library objects

        OH_GET_REFERENCE(SwapRateHelperLibObjPtr, SwapRateHelper,
            QuantLibAddin::SwapRateHelper, QuantLib::SwapRateHelper)

        // update value object precedent IDs (if any)

        valueObject->processPrecedentID(SwapRateHelper);

        // construct and return the object

        boost::shared_ptr<ObjectHandler::Object> object(
            new QuantLibAddin::VanillaSwap(
                valueObject,
                SwapRateHelperLibObjPtr,
                Permanent));
        return object;
    }
开发者ID:fder78,项目名称:MyQuantLib,代码行数:29,代码来源:create_vanillaswap.cpp


示例7: create_qlGaussianDefaultProbLM

    boost::shared_ptr<ObjectHandler::Object> create_qlGaussianDefaultProbLM(
        const boost::shared_ptr<ObjectHandler::ValueObject> &valueObject) {

        // convert input datatypes to C++ datatypes

        std::string Basket =
            ObjectHandler::convert2<std::string>(valueObject->getProperty("Basket"));

        std::vector<std::vector<double> > Factors =
            ObjectHandler::matrix::convert2<double>(valueObject->getProperty("Factors"), "Factors");

        bool Permanent =
            ObjectHandler::convert2<bool>(valueObject->getProperty("Permanent"));

        // convert object IDs into library objects

        OH_GET_REFERENCE(BasketLibObjPtr, Basket,
            QuantLibAddin::Basket, QuantLib::Basket)

        // update value object precedent IDs (if any)

        valueObject->processPrecedentID(Basket);

        // construct and return the object

        boost::shared_ptr<ObjectHandler::Object> object(
            new QuantLibAddin::GaussianDefProbLM(
                valueObject,
                BasketLibObjPtr,
                Factors,
                Permanent));
        return object;
    }
开发者ID:fder78,项目名称:MyQuantLib,代码行数:33,代码来源:create_latentmodels.cpp


示例8: OH_GET_REFERENCE

XLL_DEC OPER *qlAbcdCalibrationK(
        char *ObjectId,
        OPER *Times,
        OPER *BlackVols,
        OPER *Trigger) {

    // declare a shared pointer to the Function Call object

    boost::shared_ptr<ObjectHandler::FunctionCall> functionCall;

    try {

        // instantiate the Function Call object

        functionCall = boost::shared_ptr<ObjectHandler::FunctionCall>(
            new ObjectHandler::FunctionCall("qlAbcdCalibrationK"));

        ObjectHandler::validateRange(Trigger, "Trigger");

        // initialize the session ID (if enabled)

        SET_SESSION_ID

        // convert input datatypes to C++ datatypes

        std::vector<double> TimesCpp =
            ObjectHandler::operToVector<double>(*Times, "Times");

        std::vector<double> BlackVolsCpp =
            ObjectHandler::operToVector<double>(*BlackVols, "BlackVols");

        // convert object IDs into library objects

        OH_GET_REFERENCE(ObjectIdLibObjPtr, ObjectId,
            QuantLibAddin::AbcdCalibration, QuantLib::AbcdCalibration)

        // invoke the member function

        std::vector<double> returnValue = ObjectIdLibObjPtr->k(
                TimesCpp,
                BlackVolsCpp);

        // convert and return the return value

        static OPER xRet;
        ObjectHandler::vectorToOper(returnValue, xRet);
        return &xRet;

    } catch (const std::exception &e) {
        ObjectHandler::RepositoryXL::instance().logError(e.what(), functionCall);
        return 0;
    } catch (...) {
        ObjectHandler::RepositoryXL::instance().logError("unkown error type", functionCall);
        return 0;
    }

}
开发者ID:fder78,项目名称:MyQuantLib,代码行数:57,代码来源:abcd.cpp


示例9: qlIssuer

    std::string qlIssuer(
            const std::string &ObjectId,
            const ObjectHandler::property_t &DefaultCurves,
            const std::string &DefaultEvents,
            const ObjectHandler::property_t &Permanent,
            const ObjectHandler::property_t &Trigger,
            const bool &Overwrite) {

        try {

        // convert input datatypes to C++ datatypes

        std::string DefaultCurvesCpp = ObjectHandler::convert2<std::string>(
            DefaultCurves, "DefaultCurves", "");

        bool PermanentCpp = ObjectHandler::convert2<bool>(
            Permanent, "Permanent", false);

        // convert object IDs into library objects

        OH_GET_REFERENCE_DEFAULT(DefaultCurvesLibObjPtr, DefaultCurvesCpp,
            QuantLibAddin::DefaultProbabilityTermStructure, QuantLib::DefaultProbabilityTermStructure)

        OH_GET_REFERENCE(DefaultEventsLibObjPtr, DefaultEvents,
            QuantLibAddin::DefaultEventSet, QuantLib::DefaultEventSet)

        // Construct the Value Object

        boost::shared_ptr<ObjectHandler::ValueObject> valueObject(
            new QuantLibAddin::ValueObjects::qlIssuer(
                ObjectId,
                DefaultCurvesCpp,
                DefaultEvents,
                PermanentCpp));

        // Construct the Object
        
        boost::shared_ptr<ObjectHandler::Object> object(
            new QuantLibAddin::Issuer(
                valueObject,
                DefaultCurvesLibObjPtr,
                DefaultEventsLibObjPtr,
                PermanentCpp));

        // Store the Object in the Repository

        std::string returnValue =
            ObjectHandler::Repository::instance().storeObject(ObjectId, object, Overwrite, valueObject);

        // Convert and return the return value

        return returnValue;

        } catch (const std::exception &e) {
            OH_FAIL("Error in function qlIssuer : " << e.what());
        }
    }
开发者ID:fder78,项目名称:MyQuantLib,代码行数:57,代码来源:credit.cpp


示例10: qlScheduleTruncated

    std::string qlScheduleTruncated(
            const std::string &ObjectId,
            const std::string &OriginalSchedule,
            const ObjectHandler::property_t &TruncationDate,
            const ObjectHandler::property_t &Permanent,
            const ObjectHandler::property_t &Trigger,
            const bool &Overwrite) {

        try {

        // convert input datatypes to C++ datatypes

        bool PermanentCpp = ObjectHandler::convert2<bool>(
            Permanent, "Permanent", false);

        // convert input datatypes to QuantLib datatypes

        QuantLib::Date TruncationDateLib = ObjectHandler::convert2<QuantLib::Date>(
            TruncationDate, "TruncationDate");

        // convert object IDs into library objects

        OH_GET_REFERENCE(OriginalScheduleLibObjPtr, OriginalSchedule,
            QuantLibAddin::Schedule, QuantLib::Schedule)

        // Construct the Value Object

        boost::shared_ptr<ObjectHandler::ValueObject> valueObject(
            new QuantLibAddin::ValueObjects::qlScheduleTruncated(
                ObjectId,
                OriginalSchedule,
                TruncationDate,
                PermanentCpp));

        // Construct the Object
        
        boost::shared_ptr<ObjectHandler::Object> object(
            new QuantLibAddin::Schedule(
                valueObject,
                OriginalScheduleLibObjPtr,
                TruncationDateLib,
                PermanentCpp));

        // Store the Object in the Repository

        std::string returnValue =
            ObjectHandler::Repository::instance().storeObject(ObjectId, object, Overwrite, valueObject);

        // Convert and return the return value

        return returnValue;

        } catch (const std::exception &e) {
            OH_FAIL("Error in function qlScheduleTruncated : " << e.what());
        }
    }
开发者ID:fder78,项目名称:MyQuantLib,代码行数:56,代码来源:schedule.cpp


示例11: qlVanillaSwapFromSwapIndex

    std::string qlVanillaSwapFromSwapIndex(
            const std::string &ObjectId,
            const std::string &SwapIndex,
            const ObjectHandler::property_t &FixingDate,
            const ObjectHandler::property_t &Permanent,
            const ObjectHandler::property_t &Trigger,
            const bool &Overwrite) {

        try {

        // convert input datatypes to C++ datatypes

        bool PermanentCpp = ObjectHandler::convert2<bool>(
            Permanent, "Permanent", false);

        // convert input datatypes to QuantLib datatypes

        QuantLib::Date FixingDateLib = ObjectHandler::convert2<QuantLib::Date>(
            FixingDate, "FixingDate");

        // convert object IDs into library objects

        OH_GET_REFERENCE(SwapIndexLibObjPtr, SwapIndex,
            QuantLibAddin::SwapIndex, QuantLib::SwapIndex)

        // Construct the Value Object

        boost::shared_ptr<ObjectHandler::ValueObject> valueObject(
            new QuantLibAddin::ValueObjects::qlVanillaSwapFromSwapIndex(
                ObjectId,
                SwapIndex,
                FixingDate,
                PermanentCpp));

        // Construct the Object
        
        boost::shared_ptr<ObjectHandler::Object> object(
            new QuantLibAddin::VanillaSwap(
                valueObject,
                SwapIndexLibObjPtr,
                FixingDateLib,
                PermanentCpp));

        // Store the Object in the Repository

        std::string returnValue =
            ObjectHandler::Repository::instance().storeObject(ObjectId, object, Overwrite, valueObject);

        // Convert and return the return value

        return returnValue;

        } catch (const std::exception &e) {
            OH_FAIL("Error in function qlVanillaSwapFromSwapIndex : " << e.what());
        }
    }
开发者ID:fder78,项目名称:MyQuantLib,代码行数:56,代码来源:vanillaswap.cpp


示例12: create_qlFlatVol

    boost::shared_ptr<ObjectHandler::Object> create_qlFlatVol(
        const boost::shared_ptr<ObjectHandler::ValueObject> &valueObject) {

        // convert input datatypes to C++ datatypes

        std::vector<double> Volatilities =
            ObjectHandler::vector::convert2<double>(valueObject->getProperty("Volatilities"), "Volatilities");

        std::string Correlations =
            ObjectHandler::convert2<std::string>(valueObject->getProperty("Correlations"));

        std::string EvolutionDescription =
            ObjectHandler::convert2<std::string>(valueObject->getProperty("EvolutionDescription"));

        long Factors =
            ObjectHandler::convert2<long>(valueObject->getProperty("Factors"));

        std::vector<double> InitialRates =
            ObjectHandler::vector::convert2<double>(valueObject->getProperty("InitialRates"), "InitialRates");

        std::vector<double> Displacements =
            ObjectHandler::vector::convert2<double>(valueObject->getProperty("Displacements"), "Displacements");

        bool Permanent =
            ObjectHandler::convert2<bool>(valueObject->getProperty("Permanent"));

        // convert object IDs into library objects

        OH_GET_REFERENCE(CorrelationsLibObjPtr, Correlations,
            QuantLibAddin::PiecewiseConstantCorrelation, QuantLib::PiecewiseConstantCorrelation)

        OH_GET_UNDERLYING(EvolutionDescriptionLibObj, EvolutionDescription,
            QuantLibAddin::EvolutionDescription, QuantLib::EvolutionDescription)

        // update value object precedent IDs (if any)

        valueObject->processPrecedentID(Correlations);
        valueObject->processPrecedentID(EvolutionDescription);

        // construct and return the object

        boost::shared_ptr<ObjectHandler::Object> object(
            new QuantLibAddin::FlatVol(
                valueObject,
                Volatilities,
                CorrelationsLibObjPtr,
                EvolutionDescriptionLibObj,
                Factors,
                InitialRates,
                Displacements,
                Permanent));
        return object;
    }
开发者ID:fder78,项目名称:MyQuantLib,代码行数:53,代码来源:create_marketmodels.cpp


示例13: SEQSEQ

SEQSEQ(ANY) SAL_CALL CalcAddins_impl::qlIndexName(
        const ANY &ObjectId,
        const ANY &Trigger) throw(RuntimeException) {
    try {

        // convert input datatypes to C++ datatypes

        std::string ObjectIdCpp;
        calcToScalar(ObjectIdCpp, ObjectId);

        // convert object IDs into library objects

        OH_GET_REFERENCE(ObjectIdLibObjPtr, ObjectIdCpp,
            QuantLibAddin::Index, QuantLib::Index)

        // invoke the member function

        std::string returnValue = ObjectIdLibObjPtr->name();

        // convert and return the return value



        ANY returnValueCalc;
        scalarToCalc(returnValueCalc, returnValue);

        SEQSEQ(ANY) retAnyArray;
        retAnyArray.realloc(1);
        SEQ(ANY) retAnyVector(1);
        retAnyVector[0] = returnValueCalc;
        retAnyArray[0] = retAnyVector;        
        return retAnyArray;

    } catch (const std::exception &e) {
        do { 
            std::ostringstream errorMsg; 
            errorMsg << "ERROR: qlIndexName: " << e.what(); 
            OH_LOG_MESSAGE(errorMsg.str());
        
            SEQSEQ(ANY) retAnyArray;
            retAnyArray.realloc(1);
            SEQ(ANY) retAnyVector(1);
            STRING s = STRFROMASCII( errorMsg.str().c_str() );    
            retAnyVector[0] = CSS::uno::makeAny( s );
            retAnyArray[0] = retAnyVector;	    
            return retAnyArray;
        } while (false);
    }
}
开发者ID:jojogh,项目名称:quantlib-1,代码行数:49,代码来源:index.cpp


示例14: OH_GET_REFERENCE

XLL_DEC OPER *qlEvolutionDescriptionFirstAliveRate(
        char *ObjectId,
        OPER *Trigger) {

    // declare a shared pointer to the Function Call object

    boost::shared_ptr<ObjectHandler::FunctionCall> functionCall;

    try {

        // instantiate the Function Call object

        functionCall = boost::shared_ptr<ObjectHandler::FunctionCall>(
            new ObjectHandler::FunctionCall("qlEvolutionDescriptionFirstAliveRate"));

        ObjectHandler::validateRange(Trigger, "Trigger");

        // initialize the session ID (if enabled)

        SET_SESSION_ID

        // convert object IDs into library objects

        OH_GET_REFERENCE(ObjectIdLibObjPtr, ObjectId,
            QuantLibAddin::EvolutionDescription, QuantLib::EvolutionDescription)

        // invoke the member function

        std::vector<QuantLib::Size> returnValue = ObjectIdLibObjPtr->firstAliveRate();

        // convert and return the return value

        std::vector<long> returnValVec =
            QuantLibAddin::convertVector<QuantLib::Size, long>(returnValue);
        static OPER xRet;
        ObjectHandler::vectorToOper(returnValVec, xRet);
        return &xRet;

    } catch (const std::exception &e) {
        ObjectHandler::RepositoryXL::instance().logError(e.what(), functionCall);
        return 0;
    } catch (...) {
        ObjectHandler::RepositoryXL::instance().logError("unkown error type", functionCall);
        return 0;
    }

}
开发者ID:fder78,项目名称:MyQuantLib,代码行数:47,代码来源:evolutiondescription.cpp


示例15: OH_GET_REFERENCE

XLL_DEC char *qlSwaptionType(
        char *ObjectId,
        OPER *Trigger) {

    // declare a shared pointer to the Function Call object

    boost::shared_ptr<ObjectHandler::FunctionCall> functionCall;

    try {

        // instantiate the Function Call object

        functionCall = boost::shared_ptr<ObjectHandler::FunctionCall>(
            new ObjectHandler::FunctionCall("qlSwaptionType"));

        ObjectHandler::validateRange(Trigger, "Trigger");

        // initialize the session ID (if enabled)

        SET_SESSION_ID

        // convert object IDs into library objects

        OH_GET_REFERENCE(ObjectIdLibObjPtr, ObjectId,
            QuantLibAddin::Swaption, QuantLib::Swaption)

        // invoke the member function

        QuantLib::VanillaSwap::Type returnValue = ObjectIdLibObjPtr->type();

        // convert and return the return value

        std::ostringstream os;
        os << returnValue;
        static char ret[XL_MAX_STR_LEN];
        ObjectHandler::stringToChar(os.str(), ret);
        return ret;

    } catch (const std::exception &e) {
        ObjectHandler::RepositoryXL::instance().logError(e.what(), functionCall);
        return 0;
    } catch (...) {
        ObjectHandler::RepositoryXL::instance().logError("unkown error type", functionCall);
        return 0;
    }

}
开发者ID:fder78,项目名称:MyQuantLib,代码行数:47,代码来源:swaption.cpp


示例16: OH_GET_REFERENCE

XLL_DEC OPER *qlPiecewiseConstantVarianceVolatilities(
        char *ObjectId,
        OPER *Trigger) {

    // declare a shared pointer to the Function Call object

    boost::shared_ptr<ObjectHandler::FunctionCall> functionCall;

    try {

        // instantiate the Function Call object

        functionCall = boost::shared_ptr<ObjectHandler::FunctionCall>(
            new ObjectHandler::FunctionCall("qlPiecewiseConstantVarianceVolatilities"));

        ObjectHandler::validateRange(Trigger, "Trigger");

        // initialize the session ID (if enabled)

        SET_SESSION_ID

        // convert object IDs into library objects

        OH_GET_REFERENCE(ObjectIdLibObjPtr, ObjectId,
            QuantLibAddin::PiecewiseConstantVariance, QuantLib::PiecewiseConstantVariance)

        // invoke the member function

        std::vector<double> returnValue = ObjectIdLibObjPtr->volatilities();

        // convert and return the return value

        static OPER xRet;
        ObjectHandler::vectorToOper(returnValue, xRet);
        return &xRet;

    } catch (const std::exception &e) {
        ObjectHandler::RepositoryXL::instance().logError(e.what(), functionCall);
        return 0;
    } catch (...) {
        ObjectHandler::RepositoryXL::instance().logError("unkown error type", functionCall);
        return 0;
    }

}
开发者ID:fder78,项目名称:MyQuantLib,代码行数:45,代码来源:volatility.cpp


示例17: OH_GET_REFERENCE

XLL_DEC long *qlExerciseLastDate(
        char *ObjectId,
        OPER *Trigger) {

    // declare a shared pointer to the Function Call object

    boost::shared_ptr<ObjectHandler::FunctionCall> functionCall;

    try {

        // instantiate the Function Call object

        functionCall = boost::shared_ptr<ObjectHandler::FunctionCall>(
            new ObjectHandler::FunctionCall("qlExerciseLastDate"));

        ObjectHandler::validateRange(Trigger, "Trigger");

        // initialize the session ID (if enabled)

        SET_SESSION_ID

        // convert object IDs into library objects

        OH_GET_REFERENCE(ObjectIdLibObjPtr, ObjectId,
            QuantLibAddin::Exercise, QuantLib::Exercise)

        // invoke the member function

        QuantLib::Date returnValue = ObjectIdLibObjPtr->lastDate();

        // convert and return the return value

        static long returnValueXL;
        returnValueXL = static_cast<long>(QuantLibAddin::libraryToScalar(returnValue));
        return &returnValueXL;

    } catch (const std::exception &e) {
        ObjectHandler::RepositoryXL::instance().logError(e.what(), functionCall);
        return 0;
    } catch (...) {
        ObjectHandler::RepositoryXL::instance().logError("unkown error type", functionCall);
        return 0;
    }

}
开发者ID:fder78,项目名称:MyQuantLib,代码行数:45,代码来源:exercise.cpp


示例18: create_qlFwdPeriodAdapter

    boost::shared_ptr<ObjectHandler::Object> create_qlFwdPeriodAdapter(
        const boost::shared_ptr<ObjectHandler::ValueObject> &valueObject) {

        // convert input datatypes to C++ datatypes

        std::string LargeModel =
            ObjectHandler::convert2<std::string>(valueObject->getProperty("LargeModel"));

        long Period =
            ObjectHandler::convert2<long>(valueObject->getProperty("Period"));

        long Offset =
            ObjectHandler::convert2<long>(valueObject->getProperty("Offset"));

        std::vector<double> Displacements =
            ObjectHandler::vector::convert2<double>(valueObject->getProperty("Displacements"), "Displacements");

        bool Permanent =
            ObjectHandler::convert2<bool>(valueObject->getProperty("Permanent"));

        // convert object IDs into library objects

        OH_GET_REFERENCE(LargeModelLibObjPtr, LargeModel,
            QuantLibAddin::MarketModel, QuantLib::MarketModel)

        // update value object precedent IDs (if any)

        valueObject->processPrecedentID(LargeModel);

        // construct and return the object

        boost::shared_ptr<ObjectHandler::Object> object(
            new QuantLibAddin::FwdPeriodAdapter(
                valueObject,
                LargeModelLibObjPtr,
                Period,
                Offset,
                Displacements,
                Permanent));
        return object;
    }
开发者ID:fder78,项目名称:MyQuantLib,代码行数:41,代码来源:create_marketmodels.cpp


示例19: create_qlAccountingEngine

    boost::shared_ptr<ObjectHandler::Object> create_qlAccountingEngine(
        const boost::shared_ptr<ObjectHandler::ValueObject> &valueObject) {

        // convert input datatypes to C++ datatypes

        std::string MarketModelEvolver =
            ObjectHandler::convert2<std::string>(valueObject->getProperty("MarketModelEvolver"));

        std::string Product =
            ObjectHandler::convert2<std::string>(valueObject->getProperty("Product"));

        double InitialNumeraireValue =
            ObjectHandler::convert2<double>(valueObject->getProperty("InitialNumeraireValue"));

        bool Permanent =
            ObjectHandler::convert2<bool>(valueObject->getProperty("Permanent"));

        // convert object IDs into library objects

        OH_GET_REFERENCE(MarketModelEvolverLibObjPtr, MarketModelEvolver,
            QuantLibAddin::MarketModelEvolver, QuantLib::MarketModelEvolver)

        OH_GET_UNDERLYING(ProductLibObj, Product,
            QuantLibAddin::MarketModelMultiProduct, QuantLib::MarketModelMultiProduct)

        // update value object precedent IDs (if any)

        valueObject->processPrecedentID(MarketModelEvolver);
        valueObject->processPrecedentID(Product);

        // construct and return the object

        boost::shared_ptr<ObjectHandler::Object> object(
            new QuantLibAddin::AccountingEngine(
                valueObject,
                MarketModelEvolverLibObjPtr,
                ProductLibObj,
                InitialNumeraireValue,
                Permanent));
        return object;
    }
开发者ID:fder78,项目名称:MyQuantLib,代码行数:41,代码来源:create_accountingengines.cpp


示例20: xlSwapConvexity

        /* Fonction de calcul de l'accrued des instruments */
DLLEXPORT xloper * xlSwapConvexity (const char * instrumentId_,
                                    const char * curveId_,
                                    xloper * trigger_) {


         boost::shared_ptr<ObjectHandler::FunctionCall> functionCall(
            new ObjectHandler::FunctionCall("xlSwapConvexity")) ;

         try {

                QL_ENSURE(! functionCall->calledByFunctionWizard(), "") ;

                    // trigger pour provoquer le recalcul
                ObjectHandler::validateRange(trigger_, "trigger") ;
                QuantLib::Real returnValue ;

                OH_GET_REFERENCE(instrumentPtr, 
								 instrumentId_, 
								 QuantLibAddin::interestRateSwapObject, 
								 QuantLib::vanillaSwap2)

				//returnValue = instrumentPtr->dv01();
				returnValue = 0;

                static XLOPER returnOper ;
                ObjectHandler::scalarToOper(returnValue, returnOper) ;
                return & returnOper ;

        } catch (std::exception & e) {

                ObjectHandler::RepositoryXL::instance().logError(e.what(), functionCall) ;
                static XLOPER returnOper ;
                returnOper.xltype = xltypeErr ;
                returnOper.val.err = xlerrValue ;

                return & returnOper ;

        }

} ;
开发者ID:vermosen,项目名称:xlObjectTools,代码行数:41,代码来源:xlSwapConvexity.cpp



注:本文中的OH_GET_REFERENCE函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ OICCalloc函数代码示例发布时间:2022-05-30
下一篇:
C++ OH_FAIL函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap