text: 
  /*  
   Copyright (C) 2009 Ferdinando Ametrano
   
   This file is part of QuantLib, a free-software/open-source library
   for financial quantitative analysts and developers - http://quantlib.org/
  
   QuantLib is free software: you can redistribute it and/or modify it
   under the terms of the QuantLib license.  You should have received a
   copy of the license along with this program; if not, please email
   <quantlib-dev@lists.sf.net>. The license is also available online at
   <http://quantlib.org/license.shtml>.
  
   This program is distributed in the hope that it will be useful, but WITHOUT
   ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
   FOR A PARTICULAR PURPOSE.  See the license for more details.
  */
  
  // This file was generated automatically by gensrc.py.  If you edit this file
  // manually then your changes will be lost the next time gensrc runs.
  
  // This source code file was generated from the following stub:
  //      gensrc/gensrc/stubs/stub.calc.includes
  
  #include <oh/utilities.hpp>
  #include <oh/ohdefines.hpp>
  #include <qlo/qladdindefines.hpp>
  #include <qlo/enumerations/factories/all.hpp>
  #include <qlo/conversions/all.hpp>
  #include <oh/enumerations/typefactory.hpp>
  #include <qlo/enumerations/factories/calendarfactory.hpp>
  #include <qlo/handleimpl.hpp>
  #include <qlo/conversions/coercetermstructure.hpp>
  #include <qlo/valueobjects/vo_defaulttermstructures.hpp>
  #include <qlo/loop/loop_defaulttermstructures.hpp>
  #include <loop.hpp>
  //#include <Addins/Calc/qladdin.hpp>
  //#include <Addins/Calc/calcutils.hpp>
  //#include <Addins/Calc/conversions.hpp>
  #include <calcaddins.hpp>
  #include <calcutils.hpp>
  #include <conversions.hpp>
  
  STRING SAL_CALL CalcAddins_impl::qlFlatHazardRate(
          const STRING &ObjectId,
          const ANY &NDays,
          const ANY &Calendar,
          const STRING &Rate,
          const ANY &DayCounter,
          const ANY &Permanent,
          const ANY &Trigger,
          sal_Int32 Overwrite) throw(RuntimeException) {
      try {
  
          // convert input datatypes to C++ datatypes
  
          std::string ObjectIdCpp = ouStringToStlString(ObjectId);
  
          long NDaysCpp;
          calcToScalar(NDaysCpp, NDays);
  
          std::string CalendarCpp;
          calcToScalar(CalendarCpp, Calendar);
  
          std::string RateCpp = ouStringToStlString(Rate);
  
          std::string DayCounterCpp;
          calcToScalar(DayCounterCpp, DayCounter);
  
          bool PermanentCpp;
          calcToScalar(PermanentCpp, Permanent);
  
          // convert object IDs into library objects
  
          OH_GET_OBJECT(RateCoerce, RateCpp, ObjectHandler::Object)
          QuantLib::Handle<QuantLib::Quote> RateLibObj =
              QuantLibAddin::CoerceHandle<
                  QuantLibAddin::Quote,
                  QuantLib::Quote>()(
                      RateCoerce);
  
          // convert input datatypes to QuantLib enumerated datatypes
  
          QuantLib::Calendar CalendarEnum =
              ObjectHandler::Create<QuantLib::Calendar>()(CalendarCpp);
  
          QuantLib::DayCounter DayCounterEnum =
              ObjectHandler::Create<QuantLib::DayCounter>()(DayCounterCpp);
  
          // Construct the Value Object
  
          boost::shared_ptr<ObjectHandler::ValueObject> valueObject(
              new QuantLibAddin::ValueObjects::qlFlatHazardRate(
                  ObjectIdCpp,
                  NDaysCpp,
                  CalendarCpp,
                  RateCpp,
                  DayCounterCpp,
                  PermanentCpp));
  
          // Construct the Object
          
          boost::shared_ptr<ObjectHandler::Object> object(
              new QuantLibAddin::FlatHazardRate(
                  valueObject,
                  NDaysCpp,
                  CalendarEnum,
                  RateLibObj,
                  DayCounterEnum,
                  PermanentCpp));
  
          // Store the Object in the Repository
  
          std::string returnValue =
              ObjectHandler::Repository::instance().storeObject(ObjectIdCpp, object, Overwrite);
  
          // Convert and return the return value
  
  
  
          STRING returnValueCalc;
          scalarToCalc(returnValueCalc, returnValue);
          return returnValueCalc;
  
      } catch (const std::exception &e) {
          OH_LOG_MESSAGE("ERROR: qlFlatHazardRate: " << e.what());
          THROW_RTE;
      }
  }
  
  
  