#include <ctypes.h>
Inheritance diagram for cModuleInterface::
Public Methods | |
Constructors, destructor, assignment | |
cModuleInterface (const char *name, sDescrItem *descr_table) | |
cModuleInterface (const cModuleInterface &mi) | |
virtual | ~cModuleInterface () |
cModuleInterface& | operator= (const cModuleInterface &mi) |
Redefined cObject member functions. | |
virtual cObject* | dup () const |
Applying the interface to modules. | |
void | addParametersGatesTo (cModule *module) |
void | checkParametersOf (cModule *module) |
cModuleInterfaces are the compiled form of NED declarations of simple modules. They are created in the following way:
1) starting point is the NED declarations of simple modules, e.g:
simple Generator
parameters: ia_rate;
gates: out: out;
endsimple
2) the nedc compiler translates the NED declaration into a ModuleInterface...End macro and places it into the _n.cc file.
ModuleInterface( Generator )
Parameter ( "ia_rate", AnyType )
Gate ( "out", Output )
End
The macro translates into a static cModuleInterface object declaration (define for macros in macros.h)
3) When the program starts up, cModuleInterface constructor runs and places the object on the modinterfaces list.
4) When a module is created, the appropriate cModuleInterface object is looked up from the list, and the module's gates and parameters are created according to the description in the cModuleInterface object.
|
Constructor. |
|
Copy constructor. |
|
Destructor. |
|
Adds parameters and gates specified by the interface to the given module. |
|
Checks that the types of the module's parameters comply to the interface, and calls convertToConst() on the parameters declared as const in the interface. |
|
Creates and returns an exact copy of this object. See cObject for more details. Reimplemented from cObject. |
|
Assignment operator. The name member doesn't get copied; see cObject's operator=() for more details. |