#include <ctypes.h>
Inheritance diagram for cModuleType:
A cModuleType object exist for each module type (simple or compound). A cModuleType object 'knows' how to create a module of a given type, thus a module can be created without having to include the .h file with the C++ declaration of the module class ("class FddiMAC..."). A cModuleType object is created through a Define_Module macro. Thus, each module type must have a Define_Module() line, e.g:
Define_Module( MySimpleModule );
nedtool automatically generates Define_Module for compound modules, but the user is responsible for adding one for each simple module type.
Public Member Functions | |
Constructors, destructor, assignment | |
cModuleType (const char *classname, const char *interf_name, ModuleCreateFunc cf) | |
cModuleType (const cModuleType &mi) | |
virtual | ~cModuleType () |
cModuleType & | operator= (const cModuleType &mi) |
Redefined cObject member functions. | |
virtual cPolymorphic * | dup () const |
Module creation | |
virtual cModule * | create (const char *name, cModule *parentmod) |
virtual cModule * | create (const char *name, cModule *parentmod, int vectorsize, int index) |
virtual void | buildInside (cModule *mod) |
virtual cModule * | createScheduleInit (char *name, cModule *parentmod) |
virtual cModuleInterface * | moduleInterface () |
Friends | |
class | cModule |
|
Constructor.
|
|
Copy constructor.
|
|
Destructor.
|
|
DEPRECATED.
Use |
|
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. |
|
Creates a module which is not element of a module vector. In addition to creating an object of the correct type, this function inserts it into cSimulation's module vector and adds the parameters and gates specified in the interface description. |
|
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 starter messages are created (using mod->scheduleStart(simulation.simTime())), then initialize() is called (mod->callInitialize()). It is important that scheduleStart() be called before initialize(), because initialize() functions might contain scheduleAt() calls which could otherwise insert a message BEFORE the starter messages for module. This method works for simple and compound modules alike. Not applicable if the module:
|
|
Creates and returns an exact copy of this object. See cObject for more details. Reimplemented from cObject. |
|
Returns pointer to the module interface object corresponding to this module type.
|
|
Assignment operator. The name member doesn't get copied; see cObject's operator=() for more details. |