eosim::core::BEvent Class Reference
[Modeling Clases]

#include <eosim/core/bevent.hpp>

Collaboration diagram for eosim::core::BEvent:

Collaboration graph
[legend]
List of all members.

Detailed Description

B Events.

Author:
Sebastián Alaggia
Version:
1.0.1
Date:
2005

This is the parent class of all B events. A BEvent (bounded event) is an relevant point of time which is going to occur at a certain time to a certain group of entities.

BEvent is an abstract class which represents a bounded event that is relevant to a system. BEvents are stateless objects; they must not have any attribute that change over a simulation. They are just treated as a sample of code which is executed by the entities. Remember that BEvents are Model’s attributes.

Like in Model, to create a subclass of BEvent you must implement three methods:

Every BEvent has a name and belongs to a Model. BEvent::name is very important because it is the key used by Model to schedule an entity. Besides, BEvents have the attribute BEvent::owner to have access to its model. These parameters appear in BEvent constructor and it must be called at the constructor of any subclass. It could be a good idea to keep all names in a separate header file in order to make fewer mistakes scheduling entities. BEvents have to be registered using Model::registerBEvent, otherwise when scheduling an entity to a certain BEvent, it won't be found an error will be raised.

BEvent::eventRoutine is the main operation of this class. It defines every action taken in that particular point in time. BEvents acts over one specific entity and may change the state of the model. If one event creates or deletes an Entity, see the rules decripted in the documentation of that class.


Public Member Functions

 BEvent (std::string name, Model &owner)
 The constructor creates a BEvent with name name which belongs to the Model owner.
virtual ~BEvent ()
 The destructor of BEvent.
std::string getName ()
 This operation returns the event’s name.
virtual void eventRoutine (Entity *who)=0
 This abstract operation brings an uniform interface to BEvents routines.

Protected Attributes

Modelowner
 The Model to whom this event belongs. \ note This attribute give visibility to the model in order to modify its state.


Member Function Documentation

virtual void eosim::core::BEvent::eventRoutine ( Entity who  )  [pure virtual]

This abstract operation brings an uniform interface to BEvents routines.

Note:
In order to model an specific event, the programmer has to give an specific method to this operation. If the event needs to have access to its model, use the attribute owner.


Generated on Tue Aug 11 15:46:39 2009 for EOSimulator by  doxygen 1.5.2