A
alan.f22
HI
First off, thanks for taking the time to read this.
I have an class inheritance hierachy say:
base class "E" and a bunch of derived classes (from "E") "A",
"P", and "S"
I have an STL vector (might change to a list) std::vector<E> which is
populated by
A's, P's, and S's
Certain sequences of A's, P's and S's can be grouped to form other
classes (composite):
class M consists of one P and one S
class C consists of one A and any number of M's
What I am looking for is a way to extend/modify the STL container/
iterator to:
Allow me to iterate though the single vector using different types of
iterators:
i.e. vector<E*>::iterator, vector<M*>::iterator, vector<C*>::iterator,
vector<A*>::iterator
Basicly I'm looking to be able to iterate a single vector/list in a
number of different ways so I don't have to maintain multiple vectors/
lists for each of the composite types and specific operations I have
to perform.
Thanks for any advice and input
- A
First off, thanks for taking the time to read this.
I have an class inheritance hierachy say:
base class "E" and a bunch of derived classes (from "E") "A",
"P", and "S"
I have an STL vector (might change to a list) std::vector<E> which is
populated by
A's, P's, and S's
Certain sequences of A's, P's and S's can be grouped to form other
classes (composite):
class M consists of one P and one S
class C consists of one A and any number of M's
What I am looking for is a way to extend/modify the STL container/
iterator to:
Allow me to iterate though the single vector using different types of
iterators:
i.e. vector<E*>::iterator, vector<M*>::iterator, vector<C*>::iterator,
vector<A*>::iterator
Basicly I'm looking to be able to iterate a single vector/list in a
number of different ways so I don't have to maintain multiple vectors/
lists for each of the composite types and specific operations I have
to perform.
Thanks for any advice and input
- A