- Main Page
- Classes
- Directories
- Related Pages

- Class List
- Class Hierarchy
- Class Members

# ModuleType Class Reference

Defines type of module, holds module instances of its type. More...

`#include <moduletype.h>`

Inheritance diagram for ModuleType:

List of all members.

## Public Member Functions

const char * | getType () const
| Return type of class.
virtual const string & | getName () const =0
| Returns name of module type (such as 'boom').
virtual Ptr< VarDef > * | getVariables () const =0
| Return array of variables which will module use.
virtual Ptr< Command > * | getCommands () const =0
| return module-specific commands
virtual IModule * | newModule () const =0
| Create new module instance.
void | registerModule (IModule *module, const string &instanceName)
| Register instance of module named instanceName into the system.
VarDef * | getVariable (const string &name)
| return definition of variable named name or NULL if no such variable definition exist
Command * | getCommand (const string &cmdName)
| return definition of command or NULL if no such command definition exist
Ptr< IModule > & | getModule (const string &instanceName)
| return module named instanceName
Ptr< IModule > & | operator[] (const string &instanceName)
| Same as function getModule().
void | sendToAll (TObject *mesg)
| Send message to all local instances.
bool | operator== (const string &s) const
| test on module name (text comparsion)
ModuleManager * | getManager ()
| return pointer to module manager

## Friends

class | ModuleManager

## Detailed Description

Defines type of module, holds module instances of its type.

## Member Function Documentation

Command * ModuleType::getCommand | ( | const string & | cmdName | ) |

| return definition of command or NULL if no such command definition exist

Parameters:

  | cmdName | name of command

Returns:
  variable definition

ModuleManager* ModuleType::getManager | ( |  | ) | `[inline]`

| return pointer to module manager

Returns:
  module manager

Ptr< IModule > & ModuleType::getModule | ( | const string & | instanceName | ) |

| return module named instanceName Search only in local module instances ie. instances with module type "this".

Parameters:

  | instanceName | name of module instance

Returns:
  instance of module

virtual const string& ModuleType::getName | ( |  | ) | const`[pure virtual]`

| Returns name of module type (such as 'boom'). Module type name must be unique.

Todo:
  Check unique names in module manager constructor.

Returns:
  name of module type

Implemented in TestAddLoader, and TestCompareLoader.

const char * ModuleType::getType | ( |  | ) | const`[virtual]`

| Return type of class.

Returns:
  type of class

Reimplemented from TObject.

VarDef * ModuleType::getVariable | ( | const string & | name | ) |

| return definition of variable named name or NULL if no such variable definition exist

Parameters:

  | name | name of variable

Returns:
  variable definition

virtual Ptr<VarDef>* ModuleType::getVariables | ( |  | ) | const`[pure virtual]`

| Return array of variables which will module use.

Returns:
  array of variables.

Implemented in TestAddLoader, and TestCompareLoader.

virtual IModule* ModuleType::newModule | ( |  | ) | const`[pure virtual]`

| Create new module instance. Typical body of this method is:
     {return new Boom();}

Returns:
  new module instance

Implemented in TestAddLoader, and TestCompareLoader.

bool ModuleType::operator== | ( | const string & | s | ) | const`[inline]`

| test on module name (text comparsion)

Parameters:

  | s | another module name

Returns:
  true on match

Ptr< IModule > & ModuleType::operator[] | ( | const string & | instanceName | ) |

| Same as function getModule().

Parameters:

  | instanceName | name of module instance

Returns:
  instance of module

void ModuleType::registerModule | ( | IModule * | module,
|  | const string & | instanceName
| ) |

| Register instance of module named instanceName into the system. Throws exception if instance of name "instanceName" already exist in the system.

Parameters:

  | module | module to enregister
  | instanceName | module instance name

void ModuleType::sendToAll | ( | TObject * | mesg | ) |

| Send message to all local instances.

Parameters:

  | mesg | object representing message

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

- H:/projs/dotNET/eda/src/modulemanager/moduletype.h
- H:/projs/dotNET/eda/src/modulemanager/moduletype.cpp