1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

wrapper for a vector

Discussion in 'C' started by mikeCoolBoy, Sep 24, 2008.

  1. mikeCoolBoy

    mikeCoolBoy New Member

    Sep 24, 2008
    Likes Received:
    Trophy Points:
    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.

Share This Page