#include <eosim/utils/entityqueueordered.hpp>
Inheritance diagram for eosim::utils::EntityQueueOrdered:
Public Member Functions | |
EntityQueueOrdered (core::EntityComp *comp) | |
The constructor creates an empty EntityQueueOrdered. | |
~EntityQueueOrdered () | |
The destructor of EntityQueueOrdered. | |
void | push (core::Entity *ent) |
This operation adds ent according to the comparator given in the constructor. | |
core::Entity * | pop () |
This operation returns and remove the first entity in the queue. | |
void | remove (unsigned int i) |
This operation removes the entity whose position is i. | |
bool | empty () |
This operation returns 1 if the queue is empty. | |
core::Entity * | operator[] (unsigned int i) |
This operation returns the entity whose position is i. | |
unsigned int | size () |
This operation returns the size of the queue. |
EntityQueueOrdered::EntityQueueOrdered | ( | core::EntityComp * | comp | ) |
void EntityQueueOrdered::push | ( | core::Entity * | ent | ) | [virtual] |
This operation adds ent according to the comparator given in the constructor.
We use binary search to find were to insert, but the insertion is the bottle neck of this operation.
Implements eosim::utils::EntityQueue.
Entity * EntityQueueOrdered::pop | ( | ) | [virtual] |
This operation returns and remove the first entity in the queue.
Implements eosim::utils::EntityQueue.
void EntityQueueOrdered::remove | ( | unsigned int | i | ) | [virtual] |
This operation removes the entity whose position is i.
Implements eosim::utils::EntityQueue.
Entity * EntityQueueOrdered::operator[] | ( | unsigned int | i | ) | [virtual] |
This operation returns the entity whose position is i.
Implements eosim::utils::EntityQueue.