Main Page Modules Class Hierarchy Compound List File List Compound Members

# cModuleInterface Class Reference

`#include <ctypes.h>`

Inheritance diagram for cModuleInterface::

List of all members.

## 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)

## Detailed Description

Describes the interface (modules, gates,...) of a module type.

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 & Destructor Documentation

cModuleInterface::cModuleInterface ( | const char * name,
| sDescrItem * descr_table )

| Constructor.

cModuleInterface::cModuleInterface ( | const cModuleInterface & mi )

| Copy constructor.

cModuleInterface::~cModuleInterface ( | )`[virtual]`

| Destructor.

## Member Function Documentation

void cModuleInterface::addParametersGatesTo ( | cModule * module )

| Adds parameters and gates specified by the interface to the given module.

void cModuleInterface::checkParametersOf ( | cModule * 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.

cObject * cModuleInterface::dup ( | ) const`[inline, virtual]`

| Creates and returns an exact copy of this object. See cObject for more details. Reimplemented from cObject.

cModuleInterface & cModuleInterface::operator= ( | const cModuleInterface & mi )

| Assignment operator. The name member doesn't get copied; see cObject's operator=() for more details.

The documentation for this class was generated from the following file:

- ctypes.h