OMNeT++ Simulation Library
5.6.1
|
#include <ccomponenttype.h>
Abstract class for creating a module of a specific type.
A cModuleType object exist for each module type (simple or compound).
Public Member Functions | |
Constructors, destructor, assignment | |
cModuleType (const char *qname=nullptr) | |
Misc | |
virtual bool | isNetwork () const =0 |
virtual bool | isSimple () const =0 |
Module creation | |
virtual cModule * | create (const char *name, cModule *parentmod) |
virtual cModule * | create (const char *name, cModule *parentmod, int vectorsize, int index) |
virtual cModule * | createScheduleInit (const char *name, cModule *parentmod) |
Public Member Functions inherited from cComponentType | |
virtual std::string | getNedSource () const =0 |
cComponentType (const char *qname=nullptr) | |
virtual | ~cComponentType () |
virtual const char * | getFullName () const override |
Public Member Functions inherited from cNoncopyableOwnedObject | |
cNoncopyableOwnedObject (const char *name=nullptr, bool namepooling=true) | |
virtual cNoncopyableOwnedObject * | dup () const override |
virtual void | parsimPack (cCommBuffer *buffer) const override |
virtual void | parsimUnpack (cCommBuffer *buffer) 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 |
virtual bool | isSoftOwner () const |
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 void | setName (const char *s) |
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) | |
virtual | ~cObject () |
virtual const char * | getClassName () const |
bool | isName (const char *s) const |
virtual std::string | getFullPath () const |
const cObject * | getThisPtr () const |
virtual std::string | str () const |
virtual _OPPDEPRECATED std::string | info () const |
virtual _OPPDEPRECATED std::string | detailedInfo () const |
virtual void | forEachChild (cVisitor *v) |
cObject * | findObject (const char *name, bool deep=true) |
void | copyNotSupported () const |
Static Public Member Functions | |
static cModuleType * | find (const char *qname) |
static cModuleType * | get (const char *qname) |
Static Public Member Functions inherited from cComponentType | |
static cComponentType * | find (const char *qname) |
static cComponentType * | get (const char *qname) |
Static Public Member Functions inherited from cOwnedObject | |
static long | getTotalObjectCount () |
static long | getLiveObjectCount () |
static void | resetObjectCounters () |
static cDefaultList * | getDefaultOwner () |
Protected Member Functions | |
virtual cModule * | createModuleObject ()=0 |
virtual void | addParametersAndGatesTo (cModule *mod)=0 |
virtual void | setupGateVectors (cModule *mod)=0 |
virtual void | buildInside (cModule *mod)=0 |
cModule * | instantiateModuleClass (const char *classname) |
Protected Member Functions inherited from cObject | |
virtual void | take (cOwnedObject *obj) |
virtual void | drop (cOwnedObject *obj) |
void | dropAndDelete (cOwnedObject *obj) |
cModuleType | ( | const char * | qname = nullptr | ) |
Constructor.
|
protectedpure virtual |
Creates the module object. To be defined in subclasses.
|
protectedpure virtual |
Adds parameters and gates to a newly created module object. Gate vectors will be created with zero size, and a further call to setupGateVectors() will be needed once parameter values have been finalized.
|
protectedpure virtual |
Sets gate vector sizes on the module. This must be called AFTER all parameters have been set (see finalizeParameters()) because gate vector sizes may depend on parameter values; and it it must be invoked before connecting the gates and calling mod->buildInside().
|
protectedpure virtual |
Creates and connects submodules of a newly created module object. To be defined in subclasses. addParametersAndGatesTo() and setupGateVectors() must have been already called at this point.
NOTE: If you have an old simulation model that attempts to call this method directly, it is using an API call which has been DEPRECATED since OMNeT++ 2.3b1 – please change the code to mod->buildInside()
.
|
protected |
Utility function: instantiates the given class, and tries to cast the result to cModule. Raises an error if class was not found or could not be cast.
|
pure virtual |
Returns true if the module type was declared with the "network" keyword.
|
pure virtual |
Returns true if this module type was declared as a simple module in the NED file, i.e. using the "simple" keyword.
Creates a module which is not element of a module vector. In addition to creating an object of the correct type, this function inserts the module into the simulation's data structure, and adds the parameters and gates specified in the NED declaration.
|
virtual |
Creates a module to be an element of a module vector. The last two arguments specify the vector size and the index of the new module within the vector.
This is a convenience function to get a module up and running in one step.
First, the module is created using create() and buildInside(), then a starter message is created (for activity() modules only), then initialize() is called (mod->callInitialize()).
This method works for simple and compound modules alike. Not applicable if the module:
|
static |
Finds a module type by fully qualified NED type name. Returns nullptr if not found.
|
static |
Finds a module type by fully qualified NED type name. Throws an error if not found.