OMNeT++ Simulation Library  5.6.1
Signals

Description

Simulation signals (or just signals) provide a way of publish-subscribe communication for models. Signals are represented by the type simsignal_t, are emitted on a module or channel using cComponent::emit(), and propagate up in the module tree. At any level, one may add listeners (cIListener) with cComponent::subscribe().

The simulation kernel also utilizes signals for proving notifications about model changes such as creation and deletion of modules. The corresponding signals are PRE_MODEL_CHANGE and POST_MODEL_CHANGE, and details are provided via subclasses of cModelChangeNotification (various cPre/cPost..Notification classes).

Classes

class  cIListener
 Interface for listeners in a simulation model. More...
 
class  cListener
 A do-nothing implementation of cIListener, suitable as a base class for other listeners. More...
 
class  cModelChangeNotification
 Common base class for data objects that accompany PRE_MODEL_CHANGE and POST_MODEL_CHANGE signals. More...
 
class  cPreModuleAddNotification
 Model change notification fired just before a module is created. More...
 
class  cPostModuleAddNotification
 Model change notification fired after a module is created. More...
 
class  cPreModuleDeleteNotification
 Model change notification fired just before a module is deleted. More...
 
class  cPostModuleDeleteNotification
 Model change notification fired after a module has been deleted. More...
 
class  cPreModuleReparentNotification
 Model change notification fired just before a module is reparented. More...
 
class  cPostModuleReparentNotification
 Model change notification fired after a module has been reparented. More...
 
class  cPreGateAddNotification
 Model change notification fired just before a gate or gate vector is added to the module. More...
 
class  cPostGateAddNotification
 Model change notification fired after a gate or gate vector has been added to the module. More...
 
class  cPreGateDeleteNotification
 Model change notification fired just before a gate is deleted. More...
 
class  cPostGateDeleteNotification
 Model change notification fired after a gate has been deleted. More...
 
class  cPreGateVectorResizeNotification
 Model change notification fired just before a gate vector is resized. More...
 
class  cPostGateVectorResizeNotification
 Model change notification fired after a gate vector has been resized. More...
 
class  cPreGateConnectNotification
 Model change notification fired just before a gate is connected. More...
 
class  cPreGateDisconnectNotification
 Model change notification fired just before a gate has been disconnected. More...
 
class  cPostGateDisconnectNotification
 Model change notification fired after a gate is disconnected. More...
 
class  cPathChangeNotification
 Base class for path change notifications. More...
 
class  cPrePathCreateNotification
 Model change notification fired just before a connection path is created. More...
 
class  cPostPathCreateNotification
 Model change notification fired after a connection path has been created. More...
 
class  cPrePathCutNotification
 Model change notification fired just before a connection path is cut. More...
 
class  cPostPathCutNotification
 Model change notification fired after a connection path has been cut. More...
 
class  cPreParameterChangeNotification
 Model change notification fired just before a parameter change. More...
 
class  cPostParameterChangeNotification
 Model change notification fired after a parameter change. More...
 
class  cPreDisplayStringChangeNotification
 Model change notification fired just before a display string change. More...
 
class  cPostDisplayStringChangeNotification
 Model change notification fired after a dispay string change. More...
 
class  cITimestampedValue
 Interface for emitting timestamped values as signals, primarily for result recording. More...
 
class  cTimestampedValue
 A straightforward implementation of cITimestampedValue. More...
 

Typedefs

typedef int simsignal_t
 Signal handle. More...
 

Enumerations

enum  SimsignalType
 Signal data types. More...
 

Variables

SIM_API simsignal_t PRE_MODEL_CHANGE
 A signal which is fired before simulation model changes such as module creation or connection creation. More...
 
SIM_API simsignal_t POST_MODEL_CHANGE
 A signal which is fired after simulation model changes such as module creation or connection creation. More...
 

Typedef Documentation

◆ simsignal_t

Enumeration Type Documentation

◆ SimsignalType

Signal data types.

See also
simsignal_t, cIListener

Variable Documentation

◆ PRE_MODEL_CHANGE

SIM_API simsignal_t PRE_MODEL_CHANGE

A signal which is fired before simulation model changes such as module creation or connection creation.

The signals carry data objects that describe the type and details the change. The data objects are subclassed from cModelChangeNotification, and begin with the prefix "cPre".

These classes include:

In the listener, use dynamic_cast<> to figure out what notification arrived.

This signal is fired on the module or channel affected by the change, and NOT on the module which executes the code that causes the change. For example, preModuleDeleted is fired on the module about to be removed, and not on the module that contains the deleteModule() call.

See also: cComponent::emit(), cComponent::subscribe()

◆ POST_MODEL_CHANGE

SIM_API simsignal_t POST_MODEL_CHANGE

A signal which is fired after simulation model changes such as module creation or connection creation.

The signals carry data objects that describe the type and details the change. The data objects are subclassed from cModelChangeNotification, and begin with the prefix "cPost".

These classes include:

In the listener, use dynamic_cast<> to figure out what notification arrived.

This signal is fired on the module or channel affected by the change, and NOT on the module which executes the code that causes the change. For example, postModuleDeleted is fired on the deleted module's parent module (because the original module no longer exists), and not on the module that contained the deleteModule() call.

See also: cComponent::emit(), cComponent::subscribe()