|
-
June 10th, 2003, 09:43 AM
#1
List or vectors
Hi, I Need ur advice about that :
- Pb :
I have 2 main objects, class A and class B; There are some other classes which inherit from those 2 : class A1, A2,A3 and B1,B2,B3 ; each type of class should "know" at least one of the other type class(ex : A1 should know B1 (+B2 or B3), B1 should know A2 (+ A1 or A3),......
- Use:
1- I need to have 2 "list" of objects : one should be a list of objects which can be an instance of A1,A2,A3 and another one which should be a list of objects which can be an instance of B1,B2,B3
2-I need to go though all those 2 "lists" (looking for all the objects each time) and do so operations.
3-Insert or delete some objects when I am doing this.
-QUestions :
1- What should I use : List or Vector (of pointers to each type of class (ex : List/Vector of pointers to A1,A2,A3 et List/Vector of pointers to B1, B2,B3).(what is good for memory, time consumming pbs?).
2- Can I use just one list of class A1,A2,A3 and another one for objects instance of B1,B2,B3 (instead of pointers to those objects) ?
3- Can I use pointer as a class's member to allow one class to know the others (pointer (member of class A1) point to class B1(+B2),.....and pointer (member of class B2) point to class A1,....?.
Thanks for your reply,
PKT
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|