Typically this is done by your template inheriting from an interface class, IE:
template <class T> class Dendrite : public IDendrite
{
public:
Dendrite()
{
}
virtual ~Dendrite()
{
}
void Get(std::vector<T> &o) = 0;
protected:
std::vector<T> _data;
};
and then you're IDendrite class could be stored as pointers:
std::vector<IDendrite*> m_dendriteVec;
However, in your situation, you are taking the template parameter as part of your interface. You may also need to wrap this also.
class IVectorParam
{
}
template <class T>
class CVectorParam
{
std::vector<T> m_vect;
}
giving you
class IDendrite
{
...
public:
virtual ~IDendrite()
virtual void Get(IVectorParam*) = 0;
}
template <class T> class Dendrite : public IDendrite
{
...
// my get has to downcast to o CVectorParam<T>
virtual void Get(IVectorParam*);
};
Doug T.
2009-09-30 11:30:42