COVISE Core
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros
Public Slots | Signals | Public Member Functions | Properties | Private Slots | Private Member Functions | Private Attributes | List of all members
covise::WSMap Class Reference

#include <WSMap.h>

Inheritance diagram for covise::WSMap:
Inheritance graph
[legend]
Collaboration diagram for covise::WSMap:
Collaboration graph
[legend]

Public Slots

WSLinklink (const QString &fromModule, const QString &fromPort, const QString &toModule, const QString &toPort)
 
bool unlink (const QString &fromModule, const QString &fromPort, const QString &toModule, const QString &toPort)
 
bool unlink (WSLink *link)
 
bool unlink (const QString &linkID)
 
WSLinkgetLink (const QString &linkID) const
 
QList< WSLink * > getLinks () const
 
WSModulegetModule (const QString &name, const QString &instance, const QString &host) const
 
WSModulegetModule (const QString &moduleID) const
 
WSModulegetModuleByTitle (const QString &title) const
 
QList< WSModule * > getModules () const
 
void setMapName (const QString &name)
 
const QString & getMapName () const
 
static QString makeKeyName (const QString &name, const QString &instance, const QString &host)
 

Signals

void moduleAdded (WSModule *module)
 
void moduleRemoved (const QString &moduleID)
 

Public Member Functions

 WSMap ()
 
virtual ~WSMap ()
 
WSModuleaddModule (const WSModule *module, const QString &instance, const QString &host)
 
WSModuleaddModule (const WSModule *module)
 
WSModuleaddModule (const covise::covise__Module &module)
 
const QString & removeModule (const QString &moduleID)
 
WSModuletakeModule (const QString &moduleID)
 

Properties

QString mapname
 

Private Slots

void linkDestroyed (const QString &linkID)
 

Private Member Functions

void setRunningModules (const QMap< QString, WSModule * > &modules)
 
void printList (const QMap< QString, WSModule * > &map)
 

Private Attributes

QMap< QString, WSModule * > runningModules
 
QString mapName
 
QMap< QString, covise::WSLink * > links
 

Constructor & Destructor Documentation

covise::WSMap::WSMap ( )
covise::WSMap::~WSMap ( )
virtual

Member Function Documentation

covise::WSModule * covise::WSMap::addModule ( const WSModule module,
const QString &  instance,
const QString &  host 
)

Adds a module to the map of running modules. Takes its parameter as template and clones it. This method is intended to be used when instantiating non-instantiated modules

Parameters
modulethe module to be added
instancethe module instance id
hostthe host the module is running on
Returns
the module created
covise::WSModule * covise::WSMap::addModule ( const WSModule module)

Adds a module to the map of running modules. Takes its parameter as template and clones it. This method is intended to be used when adding already instantiated modules

Parameters
modulethe module to be added
Returns
the module created
covise::WSModule * covise::WSMap::addModule ( const covise::covise__Module &  module)

Adds a module to the map of running modules. Takes its parameter as template and clones it. This method is intended to be used when adding already instantiated modules

Parameters
modulethe module to be added
Returns
the module created
covise::WSLink * covise::WSMap::getLink ( const QString &  linkID) const
slot
QList< covise::WSLink * > covise::WSMap::getLinks ( ) const
slot
const QString& covise::WSMap::getMapName ( ) const
inlineslot

Get the name of the currently loaded map

Returns
the name of the currently loaded map
covise::WSModule * covise::WSMap::getModule ( const QString &  name,
const QString &  instance,
const QString &  host 
) const
slot
Returns
the module or 0 if no module with that name/instance/host combination exists
Parameters
nameThe name of the module
instanceThe number of the module
hostThe IP of the host the module is running on
covise::WSModule * covise::WSMap::getModule ( const QString &  moduleID) const
slot
Parameters
moduleIDThe id of the module
Returns
the module or 0 if no module with that moduleID exists
covise::WSModule * covise::WSMap::getModuleByTitle ( const QString &  title) const
slot

Gets a module by title. If no module has the given title, 0 is returned. If more than one module has that title, the result is undefined.

Parameters
titleThe title of the module
Returns
The module with the given title, 0 if no module has that title.
QList< covise::WSModule * > covise::WSMap::getModules ( ) const
slot

Get a list of all running modules

covise::WSLink * covise::WSMap::link ( const QString &  fromModule,
const QString &  fromPort,
const QString &  toModule,
const QString &  toPort 
)
slot

Add a link between an output port and an input port of a module

Parameters
fromModuleModule ID of the output port
fromPortPort name of the output port
toModuleModule ID of the input port
toPortPort name of the input port
Returns
the new link created or 0 on error
void covise::WSMap::linkDestroyed ( const QString &  linkID)
privateslot
QString covise::WSMap::makeKeyName ( const QString &  name,
const QString &  instance,
const QString &  host 
)
staticslot

Make unique name for module

Parameters
nameThe name of the running module
instanceThe instance of the running module
hostThe host the module is running on
void covise::WSMap::moduleAdded ( WSModule module)
signal
void covise::WSMap::moduleRemoved ( const QString &  moduleID)
signal
void covise::WSMap::printList ( const QMap< QString, WSModule * > &  map)
private

Print content of a map

Parameters
mapThe name of the QMap to be printed
const QString & covise::WSMap::removeModule ( const QString &  moduleID)

Remove a module from the map

Returns
the name of the the removed module
Parameters
moduleIDthe moduleID of the module to be removed
void covise::WSMap::setMapName ( const QString &  name)
slot

Set the name of the map

Parameters
namethe name of the map
void covise::WSMap::setRunningModules ( const QMap< QString, WSModule * > &  modules)
inlineprivate

Set the running Modules

Parameters
inModulesThe new value of runningModules
covise::WSModule * covise::WSMap::takeModule ( const QString &  moduleID)

Removes a module from the map without deleting it

Returns
the removed module or 0 if no module with moduleID found
Parameters
moduleIDthe moduleID of the module to be removed
bool covise::WSMap::unlink ( const QString &  fromModule,
const QString &  fromPort,
const QString &  toModule,
const QString &  toPort 
)
slot
bool covise::WSMap::unlink ( covise::WSLink link)
slot
bool covise::WSMap::unlink ( const QString &  linkID)
slot

Member Data Documentation

QMap<QString, covise::WSLink *> covise::WSMap::links
private
QString covise::WSMap::mapName
private
QMap<QString, WSModule *> covise::WSMap::runningModules
private

Property Documentation

QString covise::WSMap::mapname
readwrite

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