Go4Expert (http://www.go4expert.com/)
-   C (http://www.go4expert.com/forums/c/)
-   -   wrapper for a vector (http://www.go4expert.com/forums/wrapper-vector-t14170/)

mikeCoolBoy 24Sep2008 13:57

wrapper for a vector
Hello everybody

I have the next problem. In one class A I have an attribute which is a vector of type Device with the following declaration

vector <Device *>* pDeviceCollection

In another class B which extends A and is a template class with DeviceType parameter. I would like to create a new attribute in this class like a vector

vector <DeviceType *>* pDeviceConcreteCollection

letting me access directly to the DeviceType but without cloning the previous vector something like

wrapperVector <DeviceType*> * pDeviceConcreteCollection = new wrapperVector <DeviceType*> (Device);

and every time you access to the vector it does the cast for you between DeviceType and Device.

Is there a class which does that for you?

Thanks in advance, David.

All times are GMT +5.5. The time now is 21:11.