wrapper for a vector

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

  1. mikeCoolBoy

    mikeCoolBoy New Member

    Joined:
    Sep 24, 2008
    Messages:
    1
    Likes Received:
    0
    Trophy Points:
    0
    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

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice