Class design

Hi,

I am building a Carousel, which has a child property vector of pointers of CarouselSections. Only one CarouselSection can be active at one time.

My first question is how should the currently active member be stored, as a boolean on the active CarouselSection, or as a separate property activeSection property on the containing Carousel object?

If I do this the second way, how can a CarouselSection ask if it's active? It would need access to the object which owns it? And also, how would I store which one is active - an integer pointing to the correct item in the vector?

I would like to get this right now, because my CarouselSections each need to have their own sub-items, implemented in the same way...

Many thanks :)
Can anyone help with this?

How can I access some member data of the object that owns me?
Topic archived. No new replies allowed.