#include <CNCL/Event.h>
CN_EVENT
CNDLObject
None
CNEventHandler, CNEventScheduler, CNSimTime
CNEvent
is a data type for events used in the simulation. Control
is passed between different event handlers by sending events to each
other. Events have a unique ID field, a priority, a user defined type,
an issued and scheduled simulation time, an addressed event handler, a
sending event handler, and a pointer to an arbitrary CNCL object.
CNEvent
s can only be allocated on the heap via new
.
Constructors:
CNEvent();
CNEvent(CNParam *param);
CNEvent(int new_type);
CNEvent(int new_type, const CNSimTime t, int prio=0);
CNEvent(int new_type, CNEventHandler *new_to, const CNSimTime t, CNObject *new_object=NIL,
int new_prio=0);
CNEvent(int new_type, CNEventHandler *new_from, CNEventHandler *new_to, const CNSimTime t,
CNObject *new_object=NIL, int new_prio=0);
CNEvent(int new_type, CNEventHandler *new_to, CNObject *new_object=NIL, int new_prio=0);
Destructors:
~CNEvent();
CNEvent
itself or the friend class CNEventScheduler
. The
destructor does NOT delete the referenced object.
In addition to the member functions required by CNCL, CNEvent
provides:
static void set_max_events(unsigned long n);
static unsigned long get_max_events();
max-event
is 100. If set_max_events()
changes this value,
it MUST be called before ANY event is created.
If more than max-event
events are allocated, a warning
message is printed and the simulation continues with max-event
multiplied by 10.
int priority() const;
void priority(int prio);
int get_priority() const;
void set_priority(int prio);
int type() const;
void type(int new_type);
int get_type() const;
void set_type(int new_type);
CNSimTime scheduled() const;
void scheduled(const CNSimTime new_scheduled);
CNSimTime get_scheduled() const;
void set_scheduled(const CNSimTime new_scheduled);
CNSimTime issued() const;
CNSimTime get_issued() const;
CNEventHandler *to() const;
void to(CNEventHandler *new_to);
CNEventHandler *get_to() const;
void set_to(CNEventHandler *new_to);
CNEventHandler *from() const;
void from(CNEventHandler *new_from);
CNEventHandler *get_from() const;
void set_from(CNEventHandler *new_from);
CNObject *object() const;
void object(CNObject *obj);
CNObject *get_object() const;
void set_object(CNObject *obj);
typedef unsigned long CNEventID;
CNEventID id() const;
CNEventID get_id() const;
static void *operator new(size_t s);
new
operator. It is allocating an event out of a pool
static void operator delete(void *p);
delete
operator.
bool after(CNEvent* e2);
TRUE
if *this
Event is scheduled after Event
e2
. If both Events are scheduled at the same time, the priority
is checked; after that the Event ID. This method is used by the class
CNEventHeapSched
.
Go to the first, previous, next, last section, table of contents.