SuperQueue ?

Everything related to the code /
Tout ce qui touche au code
Post Reply
milipili
Posts: 545
Joined: Thu Nov 02, 2006 8:52 am
Location: Paris (France)
Contact:

SuperQueue ?

Post by milipili » Sat Jun 07, 2008 2:58 pm

What is the real meaning of the class SuperQueue ? What is the difference between SuperQueue and a std::stack ?

PS : Sorry for all my questions :)
Damien Gerard
Ta3d & Yuni Developer

User avatar
zuzuf
Administrateur - Site Admin
Posts: 3281
Joined: Mon Oct 30, 2006 8:49 pm
Location: Toulouse, France
Contact:

Post by zuzuf » Sat Jun 07, 2008 3:38 pm

a SuperQueue is a kind of cyclic stack. You don't need to allocate memory when you add something unless the queue is full, in that case it'll use a list to allow the game to work without losing packets but it'll be slower. Adding an element or getting the first element is always done in O(1) but when it's not full you don't do useless memory management.
=>;-D Penguin Powered

Post Reply

Who is online

Users browsing this forum: No registered users and 37 guests