OMNeT++ Simulation Library
6.0.3
|
#include <csimplemodule.h>
Base class for all simple module classes.
cSimpleModule, although packed with simulation-related functionality, does not do anything useful by itself: one has to subclass from it and redefine one or more virtual member functions to make it do useful work. These functions are:
initialize() is called after OMNeT++ created the module. Multi-stage initialization can be achieved by redefining the initialize(int stage) method instead, and also redefining the numInitStages() const method to return the required number of stages.
One has to redefine handleMessage() to contain the internal logic of the module. handleMessage() is called by the simulation kernel when the module receives a message. (An alternative to handleMessage() is activity(), but activity() is not recommended for serious model development because of scalability and debugging issues. activity() also tends to lead to messy module implementations.)
You can send() messages to other modules, or use scheduleAt()+cancelEvent() to implement delays, timers or timeouts. Messages sent or scheduled (but not cancelled) are delivered to modules via handleMessage(), or, when using activity(), via receive().
The finish() functions are called when the simulation terminates successfully. Typical use of finish() is recording statistics collected during simulation.
Public Member Functions | |
Constructors, destructor, assignment. | |
cSimpleModule (unsigned stacksize=0) | |
virtual | ~cSimpleModule () |
Redefined cObject member functions. | |
virtual std::string | str () const override |
virtual bool | isSimple () const override |
virtual void | forEachChild (cVisitor *v) override |
Redefined cModule functions. | |
virtual void | scheduleStart (simtime_t t) override |
virtual void | arrived (cMessage *msg, cGate *ongate, const SendOptions &options, simtime_t t) override |
Information about the module. | |
bool | usesActivity () const |
void | setTxUpdateSupport (bool b) |
bool | supportsTxUpdates () const |
bool | isTerminated () const |
Debugging aids. | |
virtual void | snapshot (cObject *obj=nullptr, const char *label=nullptr) |
Message sending. | |
virtual void | send (cMessage *msg, int gateid) |
virtual void | send (cMessage *msg, const char *gatename, int gateindex=-1) |
virtual void | send (cMessage *msg, cGate *outputgate) |
virtual void | send (cMessage *msg, const SendOptions &options, int gateid) |
virtual void | send (cMessage *msg, const SendOptions &options, const char *gatename, int gateindex=-1) |
virtual void | send (cMessage *msg, const SendOptions &options, cGate *outputgate) |
virtual void | sendDelayed (cMessage *msg, simtime_t delay, int gateid) |
virtual void | sendDelayed (cMessage *msg, simtime_t delay, const char *gatename, int gateindex=-1) |
virtual void | sendDelayed (cMessage *msg, simtime_t delay, cGate *outputgate) |
virtual void | sendDirect (cMessage *msg, cModule *mod, const char *inputGateName, int gateIndex=-1) |
virtual void | sendDirect (cMessage *msg, cModule *mod, int inputGateId) |
virtual void | sendDirect (cMessage *msg, cGate *inputGate) |
virtual void | sendDirect (cMessage *msg, const SendOptions &options, cModule *mod, const char *inputGateName, int gateIndex=-1) |
virtual void | sendDirect (cMessage *msg, const SendOptions &options, cModule *mod, int inputGateId) |
virtual void | sendDirect (cMessage *msg, const SendOptions &options, cGate *inputGate) |
virtual void | sendDirect (cMessage *msg, simtime_t propagationDelay, simtime_t duration, cModule *mod, const char *inputGateName, int gateIndex=-1) |
virtual void | sendDirect (cMessage *msg, simtime_t propagationDelay, simtime_t duration, cModule *mod, int inputGateId) |
virtual void | sendDirect (cMessage *msg, simtime_t propagationDelay, simtime_t duration, cGate *inputGate) |
Self-messages. | |
virtual void | scheduleAt (simtime_t t, cMessage *msg) |
virtual void | scheduleAfter (simtime_t delay, cMessage *msg) |
virtual void | rescheduleAt (simtime_t t, cMessage *msg) |
virtual void | rescheduleAfter (simtime_t delay, cMessage *msg) |
virtual cMessage * | cancelEvent (cMessage *msg) |
virtual void | cancelAndDelete (cMessage *msg) |
Receiving messages. | |
These methods may only be invoked from activity()-based simple modules. | |
virtual cMessage * | receive () |
virtual cMessage * | receive (simtime_t timeout) |
Waiting. | |
virtual void | wait (simtime_t time) |
virtual void | waitAndEnqueue (simtime_t time, cQueue *queue) |
Stopping the module or the simulation. | |
virtual void | endSimulation () |
virtual void | halt () |
virtual void | error (const char *format,...) const |
Coroutine stack info. Useful only if module uses activity(). | |
virtual bool | hasStackOverflow () const |
virtual unsigned | getStackSize () const |
virtual unsigned | getStackUsage () const |
Public Member Functions inherited from cModule | |
cModule () | |
virtual | ~cModule () |
virtual void | setName (const char *s) override |
virtual const char * | getFullName () const override |
virtual std::string | getFullPath () const override |
virtual void | setIndex (int index) |
virtual void | setNameAndIndex (const char *name, int index=-1) |
virtual cGate * | addGate (const char *gatename, cGate::Type type) |
virtual void | addGateVector (const char *gatename, cGate::Type type, int size) |
virtual void | setGateSize (const char *gatename, int size) |
virtual cGate * | getOrCreateFirstUnconnectedGate (const char *gatename, char suffix, bool inside, bool expand) |
virtual void | getOrCreateFirstUnconnectedGatePair (const char *gatename, bool inside, bool expand, cGate *&gatein, cGate *&gateout) |
virtual void | finalizeParameters () override |
void | buildInside () |
virtual ComponentKind | getComponentKind () const override |
virtual bool | isPlaceholder () const |
virtual cModule * | getParentModule () const override |
cModuleType * | getModuleType () const |
virtual cProperties * | getProperties () const override |
bool | isVector () const |
int | getIndex () const |
int | getVectorSize () const |
virtual bool | hasSubmodules () const |
virtual bool | hasSubmoduleVector (const char *name) const |
virtual std::vector< std::string > | getSubmoduleVectorNames () const |
virtual int | getSubmoduleVectorSize (const char *name) const |
virtual void | addSubmoduleVector (const char *name, int size) |
virtual void | deleteSubmoduleVector (const char *name) |
virtual void | setSubmoduleVectorSize (const char *name, int size) |
virtual cModule * | addSubmodule (cModuleType *type, const char *name, int index=-1) |
virtual bool | hasSubmodule (const char *name, int index=-1) const |
virtual int | findSubmodule (const char *name, int index=-1) const |
virtual cModule * | getSubmodule (const char *name, int index=-1) const |
virtual std::vector< std::string > | getSubmoduleNames () const |
virtual bool | containsModule (cModule *module) const |
virtual bool | hasGates () const |
virtual cGate * | gate (const char *gatename, int index=-1) |
const cGate * | gate (const char *gatename, int index=-1) const |
virtual cGate * | gateHalf (const char *gatename, cGate::Type type, int index=-1) |
const cGate * | gateHalf (const char *gatename, cGate::Type type, int index=-1) const |
virtual bool | hasGate (const char *gatename, int index=-1) const |
virtual int | findGate (const char *gatename, int index=-1) const |
virtual cGate * | gate (int id) |
const cGate * | gate (int id) const |
virtual void | deleteGate (const char *gatename) |
virtual std::vector< std::string > | getGateNames () const |
virtual cGate::Type | gateType (const char *gatename) const |
virtual bool | hasGateVector (const char *gatename) const |
virtual bool | isGateVector (const char *gatename) const |
virtual int | gateSize (const char *gatename) const |
virtual int | gateBaseId (const char *gatename) const |
virtual bool | checkInternalConnections () const |
virtual cPar & | getAncestorPar (const char *parname) |
virtual cCanvas * | getCanvas () const |
virtual cOsgCanvas * | getOsgCanvas () const |
virtual void | setBuiltinAnimationsAllowed (bool enabled) |
virtual bool | getBuiltinAnimationsAllowed () const |
virtual void | callInitialize () override |
virtual bool | callInitialize (int stage) override |
virtual void | callFinish () override |
virtual void | deleteModule () |
virtual void | changeParentTo (cModule *mod) |
Public Member Functions inherited from cComponent | |
cComponent (const char *name=nullptr) | |
virtual | ~cComponent () |
const cComponent * | getThisPtr () const |
virtual void | setDisplayName (const char *name) |
virtual const char * | getDisplayName () const |
virtual cComponentType * | getComponentType () const |
cSimulation * | getSimulation () const |
int | getId () const |
virtual const char * | getNedTypeName () const |
virtual std::string | getNedTypeAndFullName () const |
virtual std::string | getNedTypeAndFullPath () const |
bool | isModule () const |
bool | isChannel () const |
virtual cModule * | getSystemModule () const |
virtual cModule * | getModuleByPath (const char *path) const |
virtual cModule * | findModuleByPath (const char *path) const |
virtual int | getNumParams () const |
virtual cPar & | par (int k) |
const cPar & | par (int k) const |
virtual cPar & | par (const char *parname) |
const cPar & | par (const char *parname) const |
virtual int | findPar (const char *parname) const |
bool | hasPar (const char *s) const |
virtual cRNG * | getRNG (int k) const |
virtual uint32_t | intrand (uint32_t r, int rng=0) const |
virtual double | dblrand (int rng=0) const |
virtual double | uniform (double a, double b, int rng=0) const |
virtual SimTime | uniform (SimTime a, SimTime b, int rng=0) const |
virtual double | exponential (double mean, int rng=0) const |
virtual SimTime | exponential (SimTime mean, int rng=0) const |
virtual double | normal (double mean, double stddev, int rng=0) const |
virtual SimTime | normal (SimTime mean, SimTime stddev, int rng=0) const |
virtual double | truncnormal (double mean, double stddev, int rng=0) const |
virtual SimTime | truncnormal (SimTime mean, SimTime stddev, int rng=0) const |
virtual double | gamma_d (double alpha, double theta, int rng=0) const |
virtual double | beta (double alpha1, double alpha2, int rng=0) const |
virtual double | erlang_k (unsigned int k, double mean, int rng=0) const |
virtual double | chi_square (unsigned int k, int rng=0) const |
virtual double | student_t (unsigned int i, int rng=0) const |
virtual double | cauchy (double a, double b, int rng=0) const |
virtual double | triang (double a, double b, double c, int rng=0) const |
virtual double | lognormal (double m, double w, int rng=0) const |
virtual double | weibull (double a, double b, int rng=0) const |
virtual double | pareto_shifted (double a, double b, double c, int rng=0) const |
virtual int | intuniform (int a, int b, int rng=0) const |
virtual int | intuniformexcl (int a, int b, int rng=0) const |
virtual int | bernoulli (double p, int rng=0) const |
virtual int | binomial (int n, double p, int rng=0) const |
virtual int | geometric (double p, int rng=0) const |
virtual int | negbinomial (int n, double p, int rng=0) const |
virtual int | poisson (double lambda, int rng=0) const |
virtual void | subscribe (simsignal_t signalID, cIListener *listener) |
virtual void | subscribe (const char *signalName, cIListener *listener) |
virtual void | unsubscribe (simsignal_t signalID, cIListener *listener) |
virtual void | unsubscribe (const char *signalName, cIListener *listener) |
virtual bool | isSubscribed (simsignal_t signalID, cIListener *listener) const |
virtual bool | isSubscribed (const char *signalName, cIListener *listener) const |
virtual std::vector< simsignal_t > | getLocalListenedSignals () const |
virtual std::vector< cIListener * > | getLocalSignalListeners (simsignal_t signalID) const |
virtual bool | hasGUI () const |
virtual cDisplayString & | getDisplayString () const |
virtual void | setDisplayString (const char *dispstr) |
virtual void | bubble (const char *text) const |
virtual std::string | resolveResourcePath (const char *fileName) const |
virtual void | recordScalar (const char *name, double value, const char *unit=nullptr) |
virtual void | recordScalar (const char *name, SimTime value, const char *unit=nullptr) |
virtual void | recordStatistic (cStatistic *stats, const char *unit=nullptr) |
virtual void | recordStatistic (const char *name, cStatistic *stats, const char *unit=nullptr) |
virtual void | emit (simsignal_t signalID, bool b, cObject *details=nullptr) |
virtual void | emit (simsignal_t signalID, double d, cObject *details=nullptr) |
virtual void | emit (simsignal_t signalID, const SimTime &t, cObject *details=nullptr) |
virtual void | emit (simsignal_t signalID, const char *s, cObject *details=nullptr) |
virtual void | emit (simsignal_t signalID, cObject *obj, cObject *details=nullptr) |
virtual void | emit (simsignal_t signalID, const cObject *obj, cObject *details=nullptr) |
virtual void | emit (simsignal_t signalID, char c, cObject *details=nullptr) |
virtual void | emit (simsignal_t signalID, unsigned char c, cObject *details=nullptr) |
virtual void | emit (simsignal_t signalID, short i, cObject *details=nullptr) |
virtual void | emit (simsignal_t signalID, unsigned short i, cObject *details=nullptr) |
virtual void | emit (simsignal_t signalID, int i, cObject *details=nullptr) |
virtual void | emit (simsignal_t signalID, unsigned int i, cObject *details=nullptr) |
virtual void | emit (simsignal_t signalID, long i, cObject *details=nullptr) |
virtual void | emit (simsignal_t signalID, unsigned long i, cObject *details=nullptr) |
virtual void | emit (simsignal_t signalID, long long i, cObject *details=nullptr) |
virtual void | emit (simsignal_t signalID, unsigned long long i, cObject *details=nullptr) |
virtual void | emit (simsignal_t signalID, float f, cObject *details=nullptr) |
virtual void | emit (simsignal_t signalID, long double d, cObject *details=nullptr) |
bool | mayHaveListeners (simsignal_t signalID) const |
bool | hasListeners (simsignal_t signalID) const |
Public Member Functions inherited from cSoftOwner | |
cSoftOwner (const char *name=nullptr, bool namepooling=true) | |
virtual | ~cSoftOwner () |
virtual bool | isSoftOwner () const override |
int | getNumOwnedObjects () const |
cOwnedObject * | getOwnedObject (int k) |
Public Member Functions inherited from cNoncopyableOwnedObject | |
cNoncopyableOwnedObject (const char *name=nullptr, bool namepooling=true) | |
virtual cNoncopyableOwnedObject * | dup () const override |
Public Member Functions inherited from cOwnedObject | |
cOwnedObject () | |
cOwnedObject (const char *name, bool namepooling=true) | |
cOwnedObject (const cOwnedObject &obj) | |
virtual | ~cOwnedObject () |
cOwnedObject & | operator= (const cOwnedObject &o) |
virtual cObject * | getOwner () const override |
virtual bool | isOwnedObject () const override |
Public Member Functions inherited from cNamedObject | |
cNamedObject () | |
cNamedObject (const char *name, bool namepooling=true) | |
cNamedObject (const cNamedObject &obj) | |
virtual | ~cNamedObject () |
cNamedObject & | operator= (const cNamedObject &o) |
virtual const char * | getName () const override |
virtual void | setNamePooling (bool b) |
virtual bool | getNamePooling () |
Public Member Functions inherited from cObject | |
cObject () | |
cObject (const cObject &other)=default | |
virtual | ~cObject () |
virtual const char * | getClassName () const |
bool | isName (const char *s) const |
virtual std::string | getClassAndFullName () const |
virtual std::string | getClassAndFullPath () const |
const cObject * | getThisPtr () const |
virtual std::ostream & | printOn (std::ostream &os) const |
cObject * | findObject (const char *name, bool deep=true) |
virtual cClassDescriptor * | getDescriptor () const |
void | copyNotSupported () const |
Protected Member Functions | |
Hooks for defining module behavior. | |
Exactly one of activity() and handleMessage() must be redefined by the user to add functionality to the simple module. See the manual for detailed guidance on how use to these two methods. These methods are made protected because they shouldn't be called directly from outside. | |
virtual void | activity () |
virtual void | handleMessage (cMessage *msg) |
Protected Member Functions inherited from cComponent | |
virtual void | initialize (int stage) |
virtual int | numInitStages () const |
virtual void | initialize () |
virtual void | finish () |
virtual void | handleParameterChange (const char *parname) |
virtual void | refreshDisplay () const |
virtual void | preDelete (cComponent *root) |
Protected Member Functions inherited from cSoftOwner | |
virtual void | take (cOwnedObject *obj) override |
virtual void | drop (cOwnedObject *obj) override |
Protected Member Functions inherited from cObject | |
void | dropAndDelete (cOwnedObject *obj) |
Additional Inherited Members | |
Static Public Member Functions inherited from cComponent | |
static simsignal_t | registerSignal (const char *name) |
static const char * | getSignalName (simsignal_t signalID) |
Static Public Member Functions inherited from cOwnedObject | |
static long | getTotalObjectCount () |
static long | getLiveObjectCount () |
static void | resetObjectCounters () |
static cSoftOwner * | getOwningContext () |
cSimpleModule | ( | unsigned | stacksize = 0 | ) |
Constructor. Note that module objects should not be created directly, only via their cModuleType objects. See cModule constructor for more info. The stacksize parameter should only be used with simple modules using activity().
|
virtual |
Destructor. Note: it is not allowed delete modules directly, only via the deleteModule() method.
|
protectedvirtual |
Should be redefined to contain the module activity function. For several good reasons, you should prefer handleMessage() to activity(). This default implementation issues an error message (throws cRuntimeError).
|
protectedvirtual |
Should be redefined to contain the module's message handling function. This default implementation issues an error message (throws cRuntimeError).
|
overridevirtual |
|
overridevirtual |
Returns true.
Reimplemented from cModule.
|
overridevirtual |
|
overridevirtual |
Creates a starting message for the module.
Reimplemented from cModule.
|
overridevirtual |
|
inline |
Returns the event handling scheme: activity() or handleMessage().
|
inline |
Calling this method with the argument of true indicates that this module is prepared to receive transmission updates, and can handle them properly.
This method (and the underlying flag) exists to reduce the chance of unprepared modules receiving transmission updates and interpreting them as independent packets, leading to subtle errors in the simulation. If this flag is not set on a module, then sending a transmission update to it will result in a runtime error.
Modules that set the flag are supposed to check whether a received packet is a transmission update by calling cPacket::isUpdate(), and act accordingly.
|
inline |
Returns true if this module is prepared to receive transmission updates.
|
inline |
Returns true if the module has already terminated, by having called end() or returning from the activity() method.
|
virtual |
To be called from module functions. Outputs textual information about all objects of the simulation (including the objects created in module functions by the user!) into the snapshot file. The output is detailed enough to be used for debugging the simulation: by regularly calling snapshot(), one can trace how the values of variables, objects changed over the simulation. The arguments: label is a string that will appear in the output file; obj is the object whose inside is of interest. By default, the whole simulation (all modules etc) will be written out.
Qtenv also supports making snapshots interactively.
See also class cWatch and the WATCH() macro.
|
inlinevirtual |
Sends a message through the gate given with its ID.
References cSimpleModule::send().
Referenced by cSimpleModule::send().
|
inlinevirtual |
Sends a message through the gate given with its name and index. The index argument is only required if the gate is part of a gate vector.
References cSimpleModule::send().
Referenced by cSimpleModule::send().
Sends a message through the gate given with its pointer.
References cSimpleModule::send().
Referenced by cSimpleModule::send().
|
inlinevirtual |
Sends a message with the given options through the gate given with its ID.
References cSimpleModule::send().
Referenced by cSimpleModule::send().
|
inlinevirtual |
Sends a message with the given options through the gate given with its name and index. The index argument is only required if the gate is part of a gate vector.
References cSimpleModule::send().
Referenced by cSimpleModule::send().
|
virtual |
Sends a message with the given options through the gate given with its pointer.
Utility function, equivalent to send(msg, SendOptions().after(delay), gateid).
|
inlinevirtual |
Utility function, equivalent to send(msg, SendOptions().after(delay), gatename, gateindex).
Utility function, equivalent to send(msg, SendOptions().after(delay), outputgate).
|
inlinevirtual |
Sends a message directly to another module, with zero propagation delay and duration. See sendDirect(cMessage *, const SendOptions&, cGate *) for a more detailed description.
References cSimpleModule::sendDirect().
Referenced by cSimpleModule::sendDirect().
Sends a message directly to another module, with zero propagation delay and duration. See sendDirect(cMessage *, const SendOptions&, cGate *) for a more detailed description.
References cSimpleModule::sendDirect().
Referenced by cSimpleModule::sendDirect().
Sends a message directly to another module, with zero propagation delay and duration. See sendDirect(cMessage *, const SendOptions&, cGate *) for a more detailed description.
References cSimpleModule::sendDirect().
Referenced by cSimpleModule::sendDirect().
|
inlinevirtual |
Sends a message directly to another module, with the given options. See sendDirect(cMessage *, const SendOptions&, cGate *) for a more detailed description.
References cSimpleModule::sendDirect().
Referenced by cSimpleModule::sendDirect().
|
inlinevirtual |
Sends a message directly to another module, with the given options. See sendDirect(cMessage *, const SendOptions&, cGate *) for a more detailed description.
References cSimpleModule::sendDirect().
Referenced by cSimpleModule::sendDirect().
|
virtual |
Send a message directly to another module, with the given options.
If the target gate is further connected (i.e. getNextGate()!=nullptr), the message will follow the connection path that starts at that gate. Notably, when sending to an input gate of a compound module, the message will follow the connections inside the compound module.
It is permitted to send to an output gate, which will also cause the message to follow the connections starting at that gate. This can be useful, for example, when several submodules are sending to a single output gate of their parent module.
It is not permitted to send to a gate of a compound module which is not further connected (i.e. getNextGate()==nullptr), as this would cause the message to arrive at a compound module.
Also, it is not permitted to send to a gate which is otherwise connected i.e. where getPreviousGate()!=nullptr. This means that modules MUST have dedicated gates for receiving via sendDirect(). You cannot have a gate which receives messages via both connections and sendDirect().
|
inlinevirtual |
Utility function, roughly equivalent to sendDirect(msg, SendOptions().propagationDelay(delay).duration(duration), mod, inputGateName, gateIndex).
References cSimpleModule::sendDirect().
Referenced by cSimpleModule::sendDirect().
|
inlinevirtual |
Utility function, roughly equivalent to sendDirect(msg, SendOptions().propagationDelay(delay).duration(duration), mod, inputGateId).
References cSimpleModule::sendDirect().
Referenced by cSimpleModule::sendDirect().
|
inlinevirtual |
Utility function, roughly equivalent to sendDirect(msg, SendOptions().propagationDelay(delay).duration(duration), inputGate).
References cSimpleModule::sendDirect().
Referenced by cSimpleModule::sendDirect().
Schedules a self-message. It will be delivered back to the module via receive() or handleMessage() at simulation time t. This method is the way you can implement timers or timeouts. Timers can also be cancelled via cancelEvent() (See below.)
When the message is delivered at the module, you can call msg->isSelfMessage()
to tell it apart from messages arriving from other modules. msg->getKind()
can be used to further classify it, or of you need to manage an unbounded number of timers, you can set msg->getContextPointer()
before scheduling to point to the data structure the message belongs to – this way you can avoid having to search through lists or other data structures to find out where a just-arrived self-message belongs.
cancelEvent() can be used to cancel the self-message before it arrives. This is useful for implementing timeouts: if the event occurs "in time" (before timeout), the scheduled self-message can be cancelled.
Given a cMessage pointer, you can check whether it is currently scheduled by calling msg->isScheduled()
. If it is scheduled, you cannot schedule it again without calling cancelEvent() first. However, after the message was delivered to the module or cancelled, you can schedule it again – so you can reuse the same message object for timeouts over and over during the whole simulation.
Schedules a self-message for the given time delta after the current simulation time. This method is equivalent to scheduleAt(simTime()+delay, msg); See scheduleAt() for more information.
Equivalent to scheduleAt(simtime_t t, cMessage *msg), except that if the message is currently scheduled, the method cancels it before scheduling it again.
Equivalent to scheduleAfter(simtime_t t, cMessage *msg), except that if the message is currently scheduled, the method cancels it before scheduling it again.
Removes the given message from the future events. The message needs to have been sent using the scheduleAt() function. This function can be used to cancel a timer implemented with scheduleAt(). If the message is not currently scheduled, nothing happens.
|
virtual |
Invokes cancelEvent() on the message (in case it is scheduled), then deletes it. nullptr is also accepted, then the method does nothing. This method is especially useful in simple module destructors, to dispose of self-messages that the module has allocated.
|
virtual |
Remove the next message from the event queue and return a pointer to it.
Removes the next message from the event queue and returns a pointer to it. If there is no message in the event queue, the function waits with t timeout until a message will be available. If the timeout expires and there is still no message in the queue, the function returns nullptr.
|
virtual |
Waits for the given interval. (Some other simulators call this functionality hold()). It is intended for use only if you do not expect other messages to arrive at the module during the wait period. To assert this, it throws an exception if a message arrives during the wait.
If you expect to receive messages during the call, you should use waitAndEnqueue() instead.
This function can only be used with activity(), but not with handleMessage().
Waits for the given interval. The messages received during the wait period are inserted into the queue passed as argument.
This function can only be used with activity(), but not with handleMessage().
|
virtual |
Causes the whole simulation to stop. The implementation simply throws a cTerminationException.
|
virtual |
May only be invoked from activity()-based simple modules. Execution of the simple module stops in this call, and any further messages sent to module will cause a runtime error.
|
virtual |
Equivalent to throw cRuntimeError(same argument list)
.
|
virtual |
Returns true if there was a stack overflow during execution of the coroutine. (Not implemented for every coroutine package - see cCoroutine documentation for more info.) If the module uses handleMessage(), this method always returns false.
|
virtual |
Returns the stack size of the coroutine. If the module uses handleMessage(), this method always returns 0.
|
virtual |
Returns the amount of stack actually used by the coroutine. (Not implemented for every coroutine package - see cCoroutine documentation for more info.) If the module uses handleMessage(), this method always returns 0.