class Entity

The base class for every simulation object

Public Fields

static map Entity *> _globMap
It contains pairs
static map Entity *> _index
It contains pairs
static int _IDcount
counter for assigning unique IDs to entities
int _ID
unique ID for the entity
string _name
unique name for the entity

Public Methods

void _init() throw(EntityExc)
Initialize the entity
Entity(const char *n = "") throw(EntityExc)
Base constructor
Entity(const string n) throw(EntityExc)
Base constructor
virtual ~Entity()
Destructor
static inline Entity* getPointer(int id)
Obtains the pointer to the object from the ID
inline int getID()
Get the entity ID
inline const string& getName(void)
Get the Entity name
static inline Entity* _find(const char *n)
Returns the pointer to the entity with the specified name or NULL if such entity does not exists
static Entity* _find(const string n)
Returns the pointer to the entity with the spoecified name or NULL if such entity does not exists
virtual void newRun(void)
Resets the entity status at the beginning of every run
virtual void endRun(void)
Reset the entity status at the end of every run
static void callNewRun()
Recursively calls newRun() on every entity in the system
static void callEndRun()
The same as callNewRun(), but it is called at the end of every run

Documentation

The base class for every simulation object. An entity has an internal status, an interface for modyfing the status, and can contain one or more events. An entity can be referred also by its name (a string of characters) using the static method find. A specific entity class should redefine the find function for doing type checking.
static map Entity *> _globMap
It contains pairs . It's used mainly to keep track of all the entities present in the system.

static map Entity *> _index
It contains pairs . It is used to refer entities by name. The string must be unique!!

static int _IDcount
counter for assigning unique IDs to entities

int _ID
unique ID for the entity

string _name
unique name for the entity

void _init() throw(EntityExc)
Initialize the entity. It is called by the different constructors, Entity(char *) and Entity(string)

Entity(const char *n = "") throw(EntityExc)
Base constructor.
Parameters:
n - A (possibly unique) name for the entity: by default the entity name is set equal to the typeid() + the entity ID.

Entity(const string n) throw(EntityExc)
Base constructor.
Parameters:
n - A (possibly unique) name for the entity: by default the entity name is set equal to the typeid() + the entity ID.

virtual ~Entity()
Destructor

static inline Entity* getPointer(int id)
Obtains the pointer to the object from the ID. Quite useful for debugging.
Returns:
s the pointer to the entity corresponding to that ID, or NULL if it doesn't exist an object with that ID.
Parameters:
id - the object ID.

inline int getID()
Get the entity ID

inline const string& getName(void)
Get the Entity name

static inline Entity* _find(const char *n)
Returns the pointer to the entity with the specified name or NULL if such entity does not exists.

static Entity* _find(const string n)
Returns the pointer to the entity with the spoecified name or NULL if such entity does not exists.

virtual void newRun(void)
Resets the entity status at the beginning of every run. This function is called automatically at the beginning of every run, and its job consists in initializing the entity status. Warning: in newRun() is not permitted to create/destroy new entity objects.

virtual void endRun(void)
Reset the entity status at the end of every run. This function is called automatically at the end of every run, and its job consists in resetting the entity status (for example closing files, etc.) Warning: in endRun() is not permitted to create/destroy new entity objects.

static void callNewRun()
Recursively calls newRun() on every entity in the system. It is automatically called at the beginning of every run by the Simulation class. Not to be called by the user!! In a future release will be hidden.
See Also:
callNewRun

static void callEndRun()
The same as callNewRun(), but it is called at the end of every run.
See Also:
callEndRun


This class has no child classes.
Author:
Giuseppe Lipari
Version:
1.0
See Also:
Event

alphabetic index hierarchy of classes


this page has been generated automatically by doc++

(c)opyright by Malte Zöckler, Roland Wunderling
contact: doc++@zib.de