T
toton
Hi,
I need to store some suicidal class to a container like deque. ( I am
not using boost container library for pointers at this moment, using
stl containers).
The container stores some session class (not pointer, the class
itself). But when the session terminates, I want the classes to commit
suicide (using a drop /dispose method). And as soon as it commits
suicide (i.e the session is closed by the user, and it calls suicide),
I want it to get removed from the deque. How to do it automatically ,
i.e. session class drop will remove itself from the container & delete
itself, rather than externally removing it from the container.
Is it better to store the pointer of the session in the deque? Any
case the session is only exists in the session deque, nowhare else,
thus no shared_ptr kind of thing is there. also all of the session
should exit as soon as the session deque exists (i.e the program
termination, the deque is attached to the application class itself).
There is no other owner of the session's rather than the deque.
abir
I need to store some suicidal class to a container like deque. ( I am
not using boost container library for pointers at this moment, using
stl containers).
The container stores some session class (not pointer, the class
itself). But when the session terminates, I want the classes to commit
suicide (using a drop /dispose method). And as soon as it commits
suicide (i.e the session is closed by the user, and it calls suicide),
I want it to get removed from the deque. How to do it automatically ,
i.e. session class drop will remove itself from the container & delete
itself, rather than externally removing it from the container.
Is it better to store the pointer of the session in the deque? Any
case the session is only exists in the session deque, nowhare else,
thus no shared_ptr kind of thing is there. also all of the session
should exit as soon as the session deque exists (i.e the program
termination, the deque is attached to the application class itself).
There is no other owner of the session's rather than the deque.
abir