COVISE Core
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

◆ WSMap()

covise::WSMap::WSMap ( )

◆ ~WSMap()

covise::WSMap::~WSMap ( )
virtual

Member Function Documentation

◆ addModule() [1/3]

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

◆ addModule() [2/3]

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

◆ addModule() [3/3]

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

◆ getLink

covise::WSLink * covise::WSMap::getLink ( const QString &  linkID) const
slot

◆ getLinks

QList< covise::WSLink * > covise::WSMap::getLinks ( ) const
slot

◆ getMapName

const QString & covise::WSMap::getMapName ( ) const
inlineslot

Get the name of the currently loaded map

Returns
the name of the currently loaded map

◆ getModule [1/2]

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

◆ getModule [2/2]

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

◆ getModuleByTitle

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.

◆ getModules

QList< covise::WSModule * > covise::WSMap::getModules ( ) const
slot

Get a list of all running modules

◆ link

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

◆ linkDestroyed

void covise::WSMap::linkDestroyed ( const QString &  linkID)
privateslot

◆ makeKeyName

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

◆ moduleAdded

void covise::WSMap::moduleAdded ( WSModule module)
signal

◆ moduleRemoved

void covise::WSMap::moduleRemoved ( const QString &  moduleID)
signal

◆ printList()

void covise::WSMap::printList ( const QMap< QString, WSModule * > &  map)
private

Print content of a map

Parameters
mapThe name of the QMap to be printed

◆ removeModule()

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

◆ setMapName

void covise::WSMap::setMapName ( const QString &  name)
slot

Set the name of the map

Parameters
namethe name of the map

◆ setRunningModules()

void covise::WSMap::setRunningModules ( const QMap< QString, WSModule * > &  modules)
inlineprivate

Set the running Modules

Parameters
inModulesThe new value of runningModules

◆ takeModule()

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

◆ unlink [1/3]

bool covise::WSMap::unlink ( const QString &  fromModule,
const QString &  fromPort,
const QString &  toModule,
const QString &  toPort 
)
slot

◆ unlink [2/3]

bool covise::WSMap::unlink ( const QString &  linkID)
slot

◆ unlink [3/3]

bool covise::WSMap::unlink ( covise::WSLink link)
slot

Member Data Documentation

◆ links

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

◆ mapName

QString covise::WSMap::mapName
private

◆ runningModules

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

Property Documentation

◆ mapname

QString covise::WSMap::mapname
readwrite

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