eosim::core::Entity EoSimulator Programmer's Manual
NAME
Entity
SYNOPSIS
#include <eosim/core/entity.hpp>
namespace eosim {
namespace core {
class Entity {
public:
Entity ();
virtual ~Entity ();
void setBEvent (BEvent* bEv_);
void setClock (double clock_);
double getClock ();
void processEvent ();
};
}
}
DESCRIPTION
This is the parent class of all entities. Entities are objects whose activities are modeled. EoSimulator provides the user with a primitive entity, but if a system needs a more specialized entity, implement a subclass of Entity. In EoSimulator, all entities must be created dynamically, even global entities.
CLASS OPERATIONS
Entity ():
The constructor creates an Entity. Remember, all entities must be created dynamically, even global entities.
~Entity ():
The destructor of Entity.
void setBEvent (BEvent* bEv_):
This operation sets the entity’s next BEvent to bEv_. Entities have to know to which event they are scheduled. The BCalendar only schedule the entity to a certain time, not to a certain event. If setBEvent is invoked with null, the simulation aborts immediately displaying an error message. The programmer should not use this operation, it is invoked directly by EoSimulator.
void setClock (double clock_):
This operation sets the time when the next BEvent is going to occur. The programmer should not use this operation, it is invoked directly by EoSimulator.
double getClock ():
Returns the time of the last entity’s B event.
void processEvent ():
This operation process the routine of the entity’s actual BEvent. The programmer should not use this operation, it is invoked directly by EoSimulator.
SEE ALSO