Quantcast
Channel: Visual C forum
Viewing all articles
Browse latest Browse all 15302

What does econ_err_code = Econ->ScenSetInfoLoad(scen_file, hist_file); mean in my code?

$
0
0

I am trying to figure out what this statement means.  My C++ is a little rusty I think this involves objects, I don't use them that often.

Here is a code snippet from function = "startup"

class ECONOMY_API Economy
{
private:
    YieldCurveTreatmentType YCTreatmentType;
    MissingValType          MissValType;
    ValuationScenType       ValnScenType;
    DateTreatmentType       DTTreatmentType;
    ScenSetType             ScenSet;
    long                    ProjYr;
    long                    ProjMth;
    char                    errMessage[MAX_ERR_LEN+1];
    int                     XMLOpenRetryAttempts;
    void Economy::GetErrMessage();
    EconErrorCodeType Economy::GetErrMessage(EconErrorCodeType ok);
    RAScenario *RAScen;
    RAScenario *RAScenOuter;
    RAScenario *RAScenInner;
public:
    __stdcall Economy();
    ~Economy();
    virtual EconErrorCodeType __stdcall GetScenSet(ScenSetType &scensettype);
    virtual EconErrorCodeType __stdcall SelectScenSet(ScenSetType scensettype);
    virtual EconErrorCodeType __stdcall set_YCTreatmentType(YieldCurveTreatmentType ycTreatmentType);
    virtual EconErrorCodeType __stdcall set_MissValType(MissingValType missValType);
    virtual EconErrorCodeType __stdcall set_ValnScenType(ValuationScenType valnScenType);
    virtual EconErrorCodeType __stdcall set_DateTreatmentType(DateTreatmentType dttreattyp);
    virtual EconErrorCodeType __stdcall set_ProjDate(long projYr,long projMth);
    virtual EconErrorCodeType __stdcall set_ProjYear(long projYr);
    virtual EconErrorCodeType __stdcall set_ProjMonth(long projMth);
    virtual EconErrorCodeType __stdcall set_EconFilesRetryAttempts(int cnt);
    virtual EconErrorCodeType __stdcall get_ProjDate(long &projYr,long &projMth);
    virtual EconErrorCodeType __stdcall get_ProjYear(long &projYr);
    virtual EconErrorCodeType __stdcall get_ProjMonth(long &projMth);
    virtual EconErrorCodeType __stdcall get_DateTreatmentType(DateTreatmentType &dttreattyp);
    virtual EconErrorCodeType __stdcall get_YCTreatmentType(YieldCurveTreatmentType &ycTreatmentType);
    virtual EconErrorCodeType __stdcall get_MissValType(MissingValType &missValType);
    virtual EconErrorCodeType __stdcall get_ValnScenType(ValuationScenType &valnScenType);
    virtual EconErrorCodeType __stdcall get_ErrorMessage( char * errmessage);
    virtual EconErrorCodeType __stdcall ScenSetInfoLoad(char *pszProjFile, char *pszHistFile);
    virtual EconErrorCodeType __stdcall get_YieldCurveInfoSize(int &size);
    virtual EconErrorCodeType __stdcall get_MiscRateInfoSize(int &size);
    virtual EconErrorCodeType __stdcall get_EquityTypeInfoSize(int &size);
    virtual EconErrorCodeType __stdcall get_CurrencyInfoSize(int &size);
    virtual EconErrorCodeType __stdcall get_CountryInfoSize(int &size);
    virtual EconErrorCodeType __stdcall get_YieldCurveInfo(int listid,char * ID, char * Name, char * QualityScale, char * QualityLevel, char * ESMLType);
    virtual EconErrorCodeType __stdcall get_MiscRateInfo(int listid, char * ID, char * Name);
    virtual EconErrorCodeType __stdcall get_EquityTypeInfo(int listid, char * ID, char * Name);
    virtual EconErrorCodeType __stdcall get_CurrencyInfo(int listid,char * ID, char * Name, char * Quotation);
    virtual EconErrorCodeType __stdcall get_CountryInfo(int listid,char * CountryName);
    virtual EconErrorCodeType __stdcall get_YieldCurveID(int listid,char * ID);
    virtual EconErrorCodeType __stdcall get_MiscRateID(int listid, char * ID);
    virtual EconErrorCodeType __stdcall get_EquityID(int listid, char * ID);
    virtual EconErrorCodeType __stdcall get_CurrencyID(int listid,char * ID);
    virtual EconErrorCodeType __stdcall get_CountryID(int listid,char * ID);
    virtual EconErrorCodeType __stdcall ScenLoadProjRates(int scenID);
    virtual EconErrorCodeType __stdcall GetInterestRate(long date, char * country, char *rateQuality, YieldRateType yieldRateType, double rateTerm, RateReturnFreqType rateFreq, double &rate);
    virtual EconErrorCodeType __stdcall GetInterestRate(int Year, int Month, char * Country, char *rateQuality, YieldRateType yieldRateType, double rateTerm, RateReturnFreqType rateFreq, double &rate);
    virtual EconErrorCodeType __stdcall GetInterestRate(int duration, char * country, char *rateQuality, YieldRateType yieldRateType, double rateTerm, RateReturnFreqType rateFreq, double &rate);
    virtual EconErrorCodeType __stdcall GetInterestLocalVolatility(long date, char * country, char *rateQuality, YieldRateType yieldRateType, int volPeriod,  double rateTerm, RateReturnFreqType rateFreq, double &rate);
    virtual EconErrorCodeType __stdcall GetInterestLocalVolatility(int Year, int Month, char * Country, char *rateQuality, YieldRateType yieldRateType, int volPeriod, double rateTerm, RateReturnFreqType rateFreq, double &rate);
    virtual EconErrorCodeType __stdcall GetInterestLocalVolatility(int duration, char * country, char *rateQuality, YieldRateType yieldRateType, int volPeriod, double rateTerm, RateReturnFreqType rateFreq, double &rate);
    virtual EconErrorCodeType __stdcall GetInterestVolatility(long date, char * country, char *rateQuality,double moneyness, double tenor, RateReturnFreqType rateFreq, double &volrate);
    virtual EconErrorCodeType __stdcall GetInterestVolatility(int Year, int Month, char * Country, char *rateQuality,double moneyness, double tenor, RateReturnFreqType rateFreq, double &volrate);
    virtual EconErrorCodeType __stdcall GetInterestVolatility(int duration, char * country, char *rateQuality,double moneyness, double tenor, RateReturnFreqType rateFreq, double &volrate);
    virtual EconErrorCodeType __stdcall GetIndexVolatility(long date, char * country, char *equityID,   double moneyness, double tenor, RateReturnFreqType rateFreq, double &volrate);
    virtual EconErrorCodeType __stdcall GetIndexVolatility(int Year, int Month, char * country, char *equityID,   double moneyness, double tenor, RateReturnFreqType rateFreq, double &volrate);
    virtual EconErrorCodeType __stdcall GetIndexVolatility(int duration, char * country, char *equityID,   double moneyness, double tenor, RateReturnFreqType rateFreq, double &volrate);
    virtual EconErrorCodeType __stdcall GetEntireYieldCurve(int duration, char * country, char *rateQuality, YieldRateType yield_curve_type, RateReturnFreqType rate_frequency, int maxTerm, double * yc);
    virtual EconErrorCodeType __stdcall GetEntireYieldCurve(long date, char * country, char *rateQuality, YieldRateType yield_curve_type, RateReturnFreqType rate_frequency, int maxTerm, double * yc);
    virtual EconErrorCodeType __stdcall GetEntireYieldCurve(int Year, int Month, char * country, char *rateQuality, YieldRateType yield_curve_type, RateReturnFreqType rate_frequency, int maxTerm, double * yc);
    virtual EconErrorCodeType __stdcall GetIndexRate(long date, char * country, char *equityID, EquityRateType equityRateType, RateReturnFreqType rateFreq, double &rate);
    virtual EconErrorCodeType __stdcall GetIndexRate(int Year, int Month, char * country, char *equityID, EquityRateType equityRateType, RateReturnFreqType rateFreq, double &rate);
    virtual EconErrorCodeType __stdcall GetIndexRate(int duration, char * country, char *equityID, EquityRateType equityRateType, RateReturnFreqType rateFreq, double &rate);
    virtual EconErrorCodeType __stdcall GetIndexLocalVolatility(long date, char * country, char *equityID, EquityRateType equityRateType, double volPeriod, RateReturnFreqType rateFreq, double &rate);
    virtual EconErrorCodeType __stdcall GetIndexLocalVolatility(int Year, int Month,  char * country, char *equityID, EquityRateType equityRateType, double volPeriod, RateReturnFreqType rateFreq, double &rate);
    virtual EconErrorCodeType __stdcall GetIndexLocalVolatility(int duration, char * country, char *equityID, EquityRateType equityRateType, double volPeriod, RateReturnFreqType rateFreq, double &rate);
    virtual EconErrorCodeType __stdcall GetInflationRate(long date,     char * country,  char * id, RateReturnFreqType rateFreq, double &rate);
    virtual EconErrorCodeType __stdcall GetInflationRate(int Year, int Month, char * country,   char * id, RateReturnFreqType rateFreq, double &rate);
    virtual EconErrorCodeType __stdcall GetInflationRate(int duration, char * country,  char * id, RateReturnFreqType rateFreq, double &rate);
    virtual EconErrorCodeType __stdcall GetDefaultRate(long date, char * country, char *rateQuality, RateReturnFreqType rateFreq, double &rate);
    virtual EconErrorCodeType __stdcall GetDefaultRate(int Year, int Month, char * country, char *rateQuality, RateReturnFreqType rateFreq, double &rate);
    virtual EconErrorCodeType __stdcall GetDefaultRate(int duration, char * country, char *rateQuality, RateReturnFreqType rateFreq, double &rate);
    virtual EconErrorCodeType __stdcall GetMiscRate(long date, char * country, char *rateQuality, RateReturnFreqType rateFreq, double &rate);
    virtual EconErrorCodeType __stdcall GetMiscRate(int Year, int Month, char * country, char *rateQuality, RateReturnFreqType rateFreq, double &rate);
    virtual EconErrorCodeType __stdcall GetMiscRate(int duration, char * country, char *rateQuality, RateReturnFreqType rateFreq, double &rate);
    virtual EconErrorCodeType __stdcall GetExchangeRate(long date, char * domes_country, char * for_country, double monthsForward, CurrencyQuoteType currQuoteType, double &rate);
    virtual EconErrorCodeType __stdcall GetExchangeRate(int Year, int Month, char * domes_country, char * for_country, double monthsForward, CurrencyQuoteType currQuoteType, double &rate);
    virtual EconErrorCodeType __stdcall GetExchangeRate(int duration, char * domes_country, char * for_country, double monthsForward, CurrencyQuoteType currQuoteType, double &rate);
    virtual EconErrorCodeType __stdcall Generate(GenerationData *gendata, EconomyData *econdata,CalibrationData * caldata, int trace=0);
    static Economy * Economy::Create();
    static void Economy::Release(Economy * ecdat);
  };
END_HEADER
START_CLASS
Economy *Econ;
EconomyData *EconData;
GenerationData *GenData;
CalibrationData *CalibData;
EconErrorCodeType econ_err_code;
vector <xstring> country_list;
vector <xstring> currency_list;
vector <xstring> yld_curve_list;
vector <xstring> index_list;
vector <xstring> misc_list;
multimap <xstring, double> vol_surface_list;
multimap <xstring, double>::iterator iter;
pair<multimap<xstring, double>::iterator, multimap<xstring, double>::iterator> range_pair;
map <xstring, double> spot_rates;
map <xstring, double> spot_rates_shifted;
map <xstring, double> yld_rates;
map <xstring, double> yld_rates_shifted;
map <xstring, double> int_vols;
map <xstring, double> index_rates;
map <xstring, double> index_vols;
map <xstring, double> fx_rates;
map <xstring, double> dflt_rates;
map <xstring, double> infl_rates;
map <xstring, double> misc_rates;
END_CLASS

Then in another function it does this call

// Country List
econ_err_code = Econ->get_CountryInfoSize(size);

econ_err_code = Econ->ScenSetInfoLoad(scen_file, hist_file);

What does this mean?

I expect to see "ScenSetInfoLoad()" in the Econ class, but it is in the class "class ECONOMY_API Economy" - why is this?

Also what does "virtual EconErrorCodeType __stdcall" mean?

I'm just trying to get my head around what this logic is doing.

Thanks!


Viewing all articles
Browse latest Browse all 15302

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>