eosim::utils::EntityQueueLifo                  EoSimulator Programmer's Manual

 

NAME

      EntityQueueLifo: Lifo Queue of Entities

 

SYNOPSIS

      #include <eosim/utils/entityqueuelifo.hpp>

 

namespace eosim {

namespace utils {

     

class EntityQueueLifo: public EntityQueue {

public:

EntityQueueLifo ();

~EntityQueueLifo ();

void push(core::Entity* ent_);

core::Entity* pop();

void remove(unsigned int i_);

bool empty();

core::Entity* operator[] (unsigned int i_);

unsigned int size();

};

     

}

}

 

DESCRIPTION

This is a lifo queue of entities.

 

CLASS OPERATIONS

EntityQueueLifo ():

The constructor creates an empty EntityQueueLifo.

     

~EntityQueueLifo ():

      The destructor of EntityQueueLifo. It assumed that all entities in a simulation are created dynamically, so when an EntityQueueLifo is destroyed it deletes every entity stored.

     

void push(core::Entity* ent_):

            This operation adds ent_ at the begining of queue.

           

core::Entity* pop():

This operation returns and remove the first entity in the queue. If the queue is empty, the simulation aborts immediately displaying an error message.

 

void remove(unsigned int i_):

            This operation removes the entity whose position is i_. If i_ is outside the queue, the simulation aborts immediately displaying an error message.

 

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_. If i_ is outside the queue, the simulation aborts immediately displaying an error message.

     

unsigned int size():

This operation returns the size of the queue.

 

 

SEE ALSO

eosim::core::Entity

eosim::utils::EntityQueue