#include <ctypes.h>
Inheritance diagram for cModuleType::
Public Methods | |
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 cObject* | dup () const |
Module creation | |
cModule* | create (const char *name, cModule *parentmod, bool local=true) |
void | buildInside (cModule *mod) |
cModule* | createScheduleInit (char *name, cModule *parentmod) |
cModuleInterface* | moduleInterface () |
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 );
nedc automatically generates Define_Module for compound modules, but the user is responsible for writing it for each simple module type.
|
Constructor. |
|
Copy constructor. |
|
Destructor. |
|
DEPRECATED. Use |
|
Creates a module. 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. |