OMNeT++ Simulation Library
6.0.3
|
#include <cmodule.h>
This class represents modules in the simulation.
cModule can be used directly for compound modules. Simple module classes need to be subclassed from cSimpleModule, a class that adds more functionality to cModule.
For navigating the module tree, see: getParentModule(), getSubmodule(), cModule::SubmoduleIterator, cModule::getModuleByPath(), cSimulation::getModuleByPath().
Classes | |
class | ChannelIterator |
Walks along the channels inside a module, that is, the channels among the module and its submodules. More... | |
class | GateIterator |
Iterates through the gates of a module. More... | |
class | SubmoduleIterator |
Iterates through the submodules of a compound module. Iteration order corresponds to declaration order in NED files. More... | |
Public Member Functions | |
Constructors, destructor, assignment. | |
cModule () | |
virtual | ~cModule () |
Redefined cObject member functions. | |
virtual void | forEachChild (cVisitor *v) override |
virtual void | setName (const char *s) override |
virtual const char * | getFullName () const override |
virtual std::string | getFullPath () const override |
virtual std::string | str () const override |
Setting up the module. | |
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 () |
Information about the module itself. | |
virtual bool | isSimple () const |
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 |
Submodule access. | |
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 |
Gates. | |
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 void | arrived (cMessage *msg, cGate *ongate, const SendOptions &options, simtime_t t) |
Utilities. | |
virtual cPar & | getAncestorPar (const char *parname) |
virtual cCanvas * | getCanvas () const |
virtual cOsgCanvas * | getOsgCanvas () const |
virtual void | setBuiltinAnimationsAllowed (bool enabled) |
virtual bool | getBuiltinAnimationsAllowed () const |
Public methods for invoking initialize()/finish(), redefined from cComponent. | |
initialize(), numInitStages(), and finish() are themselves also declared in cComponent, and can be redefined in simple modules by the user to perform initialization and finalization (result recording, etc) tasks. | |
virtual void | callInitialize () override |
virtual bool | callInitialize (int stage) override |
virtual void | callFinish () override |
Dynamic module creation. | |
virtual void | scheduleStart (simtime_t t) |
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 |
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 () |
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) |
cModule | ( | ) |
Constructor. Note that module objects should not be created directly, only via their cModuleType objects. cModuleType::create() will do all housekeeping tasks associated with module creation (assigning an ID to the module, inserting it into the global simulation
object (see cSimulation), etc.).
|
virtual |
Destructor. Note: it is not allowed delete modules directly, only via the deleteModule() method.
|
overridevirtual |
Calls v->visit(this) for each contained object. See cObject for more details.
Reimplemented from cComponent.
Reimplemented in cSimpleModule.
|
overridevirtual |
Sets module's name. If the module is part of a submodule vector, the name change implies relocating the module into another submodule vector (which must already exist, and the same index position in it must be available and empty).
Reimplemented from cNamedObject.
|
overridevirtual |
|
overridevirtual |
Returns the full path name of the module. Example: "net.node[12].gen"
. The original getFullPath() was redefined in order to hide the global cSimulation instance from the path name.
Reimplemented from cObject.
|
overridevirtual |
|
virtual |
Sets the module's index. The module must be part of a submodule vector. The index change implies relocating the module into another slot in the same submodule vector; the destination index position must be available and empty.
|
virtual |
Sets the module's name and index. If index is not -1, the change implies relocating the module into another submodule vector and index position. The destination submodule vector must already exist, and its indexth slot must be available and empty.
|
virtual |
Adds a scalar gate of the given type to the module. If type is INOUT, two gate objects will be created, "gatename$i" and "gatename$o" (the specified gatename must not contain a "$i" or "$o" suffix itself).
Returns a pointer to the new gate if type is INPUT or OUTPUT, and nullptr if type is INOUT.
|
virtual |
Adds a gate vector of the given type and size to the module. If type is INOUT, two gate vectors will be created, "gatename$i[]" and "gatename$o[]" (the specified gatename must not contain a "$i" or "$o" suffix itself).
|
virtual |
Sets gate vector size. The specified gatename must not contain a "$i" or "$o" suffix: it is not possible to set different vector size for the "$i" or "$o" parts of an inout gate. Changing gate vector size is guaranteed NOT to change any gate IDs.
|
virtual |
Helper function for implementing NED's "gate++" syntax. Returns the next unconnected gate from an input or output gate vector, or input/output half of an inout vector. When gatename names an inout gate vector, the suffix parameter should be set to 'i' or 'o' to select "gatename$i" or "gatename$o"; otherwise suffix should be zero. The inside parameter selects whether to use isConnectedInside() or isConnectedOutside() to test if the gate is connected. The expand parameter tells whether the gate vector should be expanded if all its gates are used up.
|
virtual |
Helper function to implement NED's "gate++" syntax. This variant accepts inout gates only, and the result is returned in the gatein and gateout parameters. The meaning of the inside and expand parameters is the same as with getOrCreateFirstUnconnectedGate().
|
overridevirtual |
Redefined from cComponent. This method must be called as part of the module creation process, after moduleType->create() and before mod->buildInside(). It finalizes parameter values (e.g. reads the missing ones from omnetpp.ini), and adds gates and gate vectors (whose size may depend on parameter values) to the module.
So the sequence of setting up a module is:
The above sequence also explains why finalizeParameters() cannot by merged into either create() or buildInside().
Reimplemented from cComponent.
void buildInside | ( | ) |
In compound modules, this method should be called to create submodules and internal connections after module creation.
This method delegates to doBuildInside(), switching the context to this module for the duration of the call (see simulation.setContextModule()).
|
virtual |
Returns true if the C++ class of this module is a subclass of cSimpleModule, and false otherwise, i.e. it is equivalent to a dynamic_cast
.
In contrast, to check whether this module is a NED compound or simple module (i.e. whether it was declared with the "module" or with the "simple" keyword in NED), use cModuleType::isSimple()
: getModuleType()->isSimple()
.
Reimplemented in cSimpleModule.
|
inlineoverridevirtual |
Redefined from cComponent to return KIND_MODULE.
Implements cComponent.
|
inlinevirtual |
Returns true if this module is a placeholder module, i.e. represents a remote module in a parallel simulation run.
|
inlineoverridevirtual |
Returns the module containing this module. For the system module, it returns nullptr.
Implements cComponent.
|
inline |
Convenience method: casts the return value of getComponentType() to cModuleType.
|
overridevirtual |
Return the properties for this module. Properties cannot be changed at runtime. Redefined from cComponent.
Implements cComponent.
|
inline |
Returns true if this module is in a module vector.
int getIndex | ( | ) | const |
Returns the index of the module in a module vector. If the module is not member of a module vector, an exception is thrown.
int getVectorSize | ( | ) | const |
Returns the size of the module vector the module is in. If the module is not member of a module vector, an exception is thrown.
|
virtual |
Returns true if the module has submodules, and false otherwise. To enumerate the submodules use SubmoduleIterator.
|
virtual |
Returns true if the module has a submodule vector (not necessarily of nonzero size) of the given name, and false otherwise.
|
virtual |
Returns the names of the module's submodule vectors, including zero-size submodule vectors.
|
virtual |
Returns the size of the submodule vector of the given name. Throws an error if there is no such submodule vector.
|
virtual |
Adds a blank submodule vector with the given name and size. Throws an error if a submodule vector with the given name already exists.
Important: This operation does NOT actually create any submodules. The slots in the vector will be nullptr, i.e. getSubmodule(name,index) returns nullptr for all indices.
Modules can be added one by one by using cModuleType::create(name, parentModule, index). Deleting a module (via cModule::deleteModule()) which is part of a submodule vector will also remove it from the submodule vector and set its slot to nullptr.
|
virtual |
Deletes the submodule vector with the given name. All submodules in the given vector will be deleted. Throws an error if a submodule vector with the given name does not exist.
|
virtual |
Resizes the given submodule vector, filling new elements with nullptr. A submodule vector can be extended any time; it can be shrunk only if it contains no submodules in the index range which is going to be removed. Throws an error if there is no such submodule vector, or the removed range contains submodules. Modules can be removed from the submodule vector by calling their deleteModule() method.
|
virtual |
Creates and initializes a submodule. If index is present, then the submodule becomes an element in a submodule vector; the submodule vector of the given name must already exist, have a sufficient size (size>index), and the indexth position must be empty.
Note: This method just delegates to cModuleType::createScheduleInit(). If parameters need to be set or gates need to be connected before building the internal structure (in case type is a compound module) and initializing the module, use cModuleType::create() instead of this method.
|
virtual |
Returns true if a submodule with the given name (and index) exists, and false otherwise. Index must be specified exactly if the module is member of a module vector.
|
virtual |
Finds a direct submodule with the given name and index, and returns its module ID. If the submodule was not found, returns -1. Index must be specified exactly if the module is member of a module vector.
|
virtual |
Finds a direct submodule with the given name and index, and returns its pointer. If the submodule was not found, returns nullptr. Index must be specified exactly if the module is member of a module vector.
|
virtual |
Returns the names of the module's submodules and submodule vectors, including zero-size submodule vectors.
|
virtual |
Returns true of the given module has this module as an ancestor, and false otherwise.
|
virtual |
Returns true if the module has any gates, and false otherwise. If it does, getGateNames() or GateIterator be used to enumerate them.
|
virtual |
Looks up a gate by its name and index. Gate names with the "$i" or "$o" suffix are also accepted. Throws an error if the gate does not exist. The presence of the index parameter decides whether a vector or a scalar gate will be looked for.
|
inline |
Looks up a gate by its name and index. Gate names with the "$i" or "$o" suffix are also accepted. Throws an error if the gate does not exist. The presence of the index parameter decides whether a vector or a scalar gate will be looked for.
|
virtual |
Returns the "$i" or "$o" part of an inout gate, depending on the type parameter. That is, gateHalf("port", cGate::OUTPUT, 3) would return gate "port$o[3]". Throws an error if the gate does not exist. The presence of the index parameter decides whether a vector or a scalar gate will be looked for.
|
inline |
Returns the "$i" or "$o" part of an inout gate, depending on the type parameter. That is, gateHalf("port", cGate::OUTPUT, 3) would return gate "port$o[3]". Throws an error if the gate does not exist. The presence of the index parameter decides whether a vector or a scalar gate will be looked for.
|
virtual |
Checks if a gate exists. When invoked without index, it returns whether gate "gatename" or "gatename[]" exists (no matter if the gate vector size is currently zero). When invoked with an index, it returns whether the concrete "gatename[index]" gate exists (gatename being a vector gate). Gate names with the "$i" or "$o" suffix are also accepted.
|
virtual |
Returns the ID of the gate specified by name and index. Inout gates cannot be specified (since they are actually two gate objects, not one), only with a "$i" or "$o" suffix. Returns -1 if the gate does not exist. The presence of the index parameter decides whether a vector or a scalar gate will be looked for.
|
virtual |
Returns a gate by its ID. It throws an error for invalid (or stale) IDs.
Note: as of OMNeT++ 4.0, gate IDs are no longer small integers and are not suitable for enumerating all gates of a module. Use GateIterator for that purpose.
|
inline |
Returns a gate by its ID. It throws an error for invalid (or stale) IDs.
Note: as of OMNeT++ 4.0, gate IDs are no longer small integers and are not suitable for enumerating all gates of a module. Use GateIterator for that purpose.
References cModule::gate().
Referenced by cModule::gate().
|
virtual |
Deletes a gate, gate pair, or gate vector. Note: individual gates in a gate vector and one side of an inout gate (i.e. "foo$i") cannot be deleted. IDs of deleted gates will not be reused later.
|
virtual |
Returns the names of the module's gates. For gate vectors and inout gates, only the base name is returned (without gate index, "[]" or the "$i"/"$o" suffix). Zero-size gate vectors will also be included.
|
virtual |
Returns the type of the gate (or gate vector) with the given name. Gate names with the "$i" or "$o" suffix are also accepted. Throws an error if there is no such gate or gate vector.
|
virtual |
Returns true if there is a gate vector with the given name, and false otherwise. Names with the "$i" and "$o" suffix are also accepted. Zero-size gate vectors will also be included.
|
virtual |
Returns whether the given gate is a gate vector. Gate names with the "$i" or "$o" suffix are also accepted. Throws an error if there is no such gate or gate vector.
|
virtual |
Returns the size of the gate vector with the given name. Gate names with the "$i" or "$o" suffix are also accepted. Throws an error if there is no such gate, or it is not a gate vector.
|
virtual |
For vector gates, it returns the ID of gate 0 in the vector, even if the gate size is currently zero. All gates in the vector can be accessed by ID = gateBaseId + index. For scalar gates, it returns the ID of the gate. If there is no such gate or gate vector, an error gets thrown.
Note: Gate IDs are guaranteed to be stable, i.e. they do not change if the gate vector gets resized, or other gates get added/removed.
|
virtual |
For compound modules, it checks if all gates are connected inside the module (it returns true
if they are OK); for simple modules, it returns true
. This function is called during network setup.
|
virtual |
This method is invoked as part of a send() call in another module. It is called when the message arrives at a gates in this module which is not further connected, that is, the gate's getNextGate() method returns nullptr. The default, cModule implementation reports an error ("message arrived at a compound module"), and the cSimpleModule implementation inserts the message into the FES after some processing.
Reimplemented in cSimpleModule.
|
virtual |
Searches for the parameter in the parent modules, up to the system module. If the parameter is not found, throws cRuntimeError.
|
virtual |
Returns the default canvas for this module, creating it if it hasn't existed before.
|
virtual |
Returns the default 3D (OpenSceneGraph) canvas for this module, creating it if it hasn't existed before.
|
inlinevirtual |
Sets whether built-in animations are requested on this module's graphical inspector.
|
inlinevirtual |
Returns true if built-in animations are requested on this module's graphical inspector, and false otherwise.
|
overridevirtual |
Interface for calling initialize() from outside.
Implements cComponent.
|
overridevirtual |
Interface for calling initialize() from outside. It does a single stage of initialization, and returns true
if more stages are required.
Implements cComponent.
|
overridevirtual |
Interface for calling finish() from outside.
Implements cComponent.
|
virtual |
Creates a starting message for modules that need it (and recursively for its submodules).
Reimplemented in cSimpleModule.
|
virtual |
Deletes the module and recursively all its submodules.
A running module can also delete itself. When an activity()-based simple module deletes itself from within its activity(), the deleteModule() call will not return (it throws an exception which gets caught by the simulation kernel, and the simulation kernel will delete the module).
When a handleMessage()-based module deletes itself, the deleteModule() returns normally – then, of course, the code should not try to access data members or functions of the deleted module, and should return as soon as possible.
It is not allowed to delete the system module. Also, a module cannot be deleted while its initialization is in progress.
|
virtual |
Moves the module under a new parent module. This functionality may be useful for some (rare) mobility scenarios.
NOTE: THIS METHOD CHANGES THE MODULE ID. To maintain a time-independent moduleId-to-fullPath mapping, this method will cause this module, and all modules under it in the module hierarchy, to be assigned a new ID. This usually causes no problem in the simulation's operation, but if your model stores module IDs somewhere, you'll need to invalidate or update them manually.
This function could bypass several rules which are enforced when you build the model using NED, so you must observe the following: