Template class

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Template class

simone pilozzi
Hi all,
I am trying to add some functionality (like download from bloomberg) to the TimeSeries class of QL.
I created an abstract (and template class) class with a pure virtual method BlpDownload to create the timeseries <T> from blp.
The compiler always raises the error c2248:impossible d'accder private membre dclar(e) dans la class.
Here is part of the code (qDate is a typedef for QuantLib::Date)
 
the abstract class

template

<class T>

class timeseries{

timeseries(){}

inline

timeseries(const timeseries& original){

dates = original.getDates();

data = original.getData();

ts = original.getSeries();

}

inline vector<T>getData()const{return data;}

inline vector<qDate> getDates()const{return dates;}

virtual void blpDownload(string& assetname,vector<string> attributes,shared_ptr<Session> sessionptr)= 0;

protected

:

vector<qDate> dates;

vector<T> data;

TimeSeries<T>* ts;

};

 

the inherited class

class

financialtimeseries:public timeseries<vector<Real>>{

public:

financialtimeseries(){}

virtual void blpDownload(string& assetname,vector<string> attributes,

shared_ptr<Session> sessionptr);

};

void

financialtimeseries::blpDownload(string& assetname,

vector<string> attributes,shared_ptr<Session> sessionptr){.....blp download}

Any idea? Thanks in advance....

 

 

 


------------------------------------------------------------------------------
Special Offer-- Download ArcSight Logger for FREE (a $49 USD value)!
Finally, a world-class log management solution at an even better price-free!
Download using promo code Free_Logger_4_Dev2Dev. Offer expires
February 28th, so secure your free ArcSight Logger TODAY!
http://p.sf.net/sfu/arcsight-sfd2d
_______________________________________________
QuantLib-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-users
Reply | Threaded
Open this post in threaded view
|

Fwd: Template class

simone pilozzi

Found (thanks to Fabio), the abstract class misses the public keyword. I apologize for the stupid question 
---------- Forwarded message ----------
From: simone pilozzi <[hidden email]>
Date: 24 January 2011 14:52
Subject: Template class
To: [hidden email]


Hi all,
I am trying to add some functionality (like download from bloomberg) to the TimeSeries class of QL.
I created an abstract (and template class) class with a pure virtual method BlpDownload to create the timeseries <T> from blp.
The compiler always raises the error c2248:impossible d'accder private membre dclar(e) dans la class.
Here is part of the code (qDate is a typedef for QuantLib::Date)
 
the abstract class

template

<class T>

class timeseries{

timeseries(){}

inline

timeseries(const timeseries& original){

dates = original.getDates();

data = original.getData();

ts = original.getSeries();

}

inline vector<T>getData()const{return data;}

inline vector<qDate> getDates()const{return dates;}

virtual void blpDownload(string& assetname,vector<string> attributes,shared_ptr<Session> sessionptr)= 0;

protected

:

vector<qDate> dates;

vector<T> data;

TimeSeries<T>* ts;

};

 

the inherited class

class

financialtimeseries:public timeseries<vector<Real>>{

public:

financialtimeseries(){}

virtual void blpDownload(string& assetname,vector<string> attributes,

shared_ptr<Session> sessionptr);

};

void

financialtimeseries::blpDownload(string& assetname,

vector<string> attributes,shared_ptr<Session> sessionptr){.....blp download}

Any idea? Thanks in advance....

 

 

 



------------------------------------------------------------------------------
Special Offer-- Download ArcSight Logger for FREE (a $49 USD value)!
Finally, a world-class log management solution at an even better price-free!
Download using promo code Free_Logger_4_Dev2Dev. Offer expires
February 28th, so secure your free ArcSight Logger TODAY!
http://p.sf.net/sfu/arcsight-sfd2d
_______________________________________________
QuantLib-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-users