Microsimulation API
Public Member Functions | Private Attributes | Friends | List of all members
ssim::Event Class Reference

basic event in the simulation. More...

#include <ssim.h>

Inheritance diagram for ssim::Event:
Inheritance graph
[legend]

Public Member Functions

 Event ()
 
virtual ~Event ()
 
virtual std::string str () const
 

Private Attributes

unsigned refcount
 

Friends

class SimImpl
 
class Sim
 

Detailed Description

basic event in the simulation.

This base class represents a piece of information or a signal exchanged between two processes through the simulator. Every simulated event must inherit from this class. For example:

class TextMessage : public Event {
public:
char * message;
TextMessage(const char * m) {
message = strdup(m);
}
~TextMessage() {
free(message);
}
};
See also
Sim::signal_event(), Sim::self_signal_event(), Process::process_event(const Event*), TProcess::wait_for_event(Time).

Definition at line 111 of file ssim.h.

Constructor & Destructor Documentation

◆ Event()

ssim::Event::Event ( )
inline

Definition at line 113 of file ssim.h.

◆ ~Event()

virtual ssim::Event::~Event ( )
inlinevirtual

Definition at line 114 of file ssim.h.

Member Function Documentation

◆ str()

virtual std::string ssim::Event::str ( ) const
inlinevirtual

Reimplemented in ssim::cMessage.

Definition at line 115 of file ssim.h.

Friends And Related Function Documentation

◆ Sim

friend class Sim
friend

Definition at line 120 of file ssim.h.

◆ SimImpl

friend class SimImpl
friend

Definition at line 119 of file ssim.h.

Member Data Documentation

◆ refcount

unsigned ssim::Event::refcount
mutableprivate

Definition at line 115 of file ssim.h.


The documentation for this class was generated from the following file:
ssim::Event::Event
Event()
Definition: ssim.h:113