Boost logo

Boost :

From: SeskaPeel (seskapeel_at_[hidden])
Date: 2006-04-26 11:10:08


Hi list,

 

I'm looking for a "multi-class container", with access to sub-containers of
elements depending on their class. All elements are derived from the same
base class, and I want to have "views" of containers of final classes, or
even intermediate classes. This container would be associative, like a map.

As instance if I have

 

// Base class

class A {} ;

 

// Intermediate classes

class B : public A {} ;

 

// Final classes

class C : public B {} ;

class D : public B {} ;

class E : public A {} ;

 

I want a container that can hold any A-derived class, on which I could have
views of sub containers of class C, D or E, and even a sub container of
intermediate class B.

 

I looked at multi-index, but no such feature seems to be feasible. And I
have no need of multiple indices, as I access all theses elements by their
ID which is a member of A.

 

Any hint on how I could implement this?

 

Cheers,

 

            SeskaPeel.


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk