Commit 3b86ca4f authored by Sebastian Eichelbaum's avatar Sebastian Eichelbaum

[CHANGE] - Connection Management - Basic implementation

parent ffae79b0
......@@ -37,22 +37,13 @@ WModule::~WModule()
// cleanup
}
WModule::WModule( const WModule& other )
void WModule::addConnector( boost::shared_ptr<WModuleInputConnector> con )
{
*this = other;
m_InputConnectors.insert( con );
}
const std::string WModule::getName() const
{
return "WModule";
}
const std::string WModule::getDescription() const
{
return "Plain module without functionality";
}
void WModule::threadMain()
void WModule::addConnector( boost::shared_ptr<WModuleOutputConnector> con )
{
m_OutputConnectors.insert( con );
}
......@@ -27,6 +27,9 @@
#include <string>
#include <boost/shared_ptr.hpp>
#include <boost/thread.hpp>
#include "../common/WThreadedRunner.h"
#include "WModuleInputConnector.h"
#include "WModuleOutputConnector.h"
......@@ -50,45 +53,52 @@ public:
*/
virtual ~WModule();
/**
* Copy constructor
* \param other Reference on object to copy.
*/
WModule( const WModule& other );
/**
* Gives back the name of this module.
* \return the module's name.
*/
virtual const std::string getName() const;
virtual const std::string getName() const = 0;
/**
* Gives back a description of this module.
* \return description to module.
*/
virtual const std::string getDescription() const;
virtual const std::string getDescription() const = 0;
protected:
/**
* Entry point after loading the module. Runs in separate thread.
*/
virtual void threadMain() = 0;
/**
* Adds the specified connector to the list of inputs.
*
* \param con the connector.
* Set of input connectors associated with this module.
*/
std::set<boost::shared_ptr<WModuleInputConnector> > m_InputConnectors;
/**
* Set of output connectors associated with this module.
*/
virtual void addInput( boost::shared_ptr<WModuleInputConnector> con );
std::set<boost::shared_ptr<WModuleOutputConnector> > m_OutputConnectors;
/**
* Adds the specified connector to the list of outputs.
* Adds the specified connector to the list of inputs. This function is NOT thread-safe which is not needed since modules
* should never add/remove connectors outside their constructor.
*
* \param con the connector.
*/
virtual void addOutput( boost::shared_ptr<WModuleOutputConnector> con );
protected:
void addConnector( boost::shared_ptr<WModuleInputConnector> con );
/**
* Entry point after loading the module. Runs in separate thread.
/**
* Adds the specified connector to the list of outputs. This function is NOT thread-safe which is not needed since modules
* should never add/remove connectors outside their constructor.
*
* \param con the connector.
*/
virtual void threadMain();
void addConnector( boost::shared_ptr<WModuleOutputConnector> con );
// XXX corresponding removeConnector methods should not be needed
private:
};
......
......@@ -47,12 +47,6 @@ WNavigationSliceModule::~WNavigationSliceModule()
// cleanup
}
WNavigationSliceModule::WNavigationSliceModule( const WNavigationSliceModule& other )
: WModule()
{
*this = other;
}
const std::string WNavigationSliceModule::getName() const
{
return "Navigation Slice Module";
......
......@@ -53,13 +53,6 @@ public:
*/
virtual ~WNavigationSliceModule();
/**
* \par Description
* Copy constructor
* \param other Reference on object to copy.
*/
WNavigationSliceModule( const WNavigationSliceModule& other );
/**
* \par Description
* Gives back the name of this module.
......
......@@ -43,12 +43,6 @@ WTestModule::~WTestModule()
// cleanup
}
WTestModule::WTestModule( const WTestModule& other )
: WModule()
{
*this = other;
}
const std::string WTestModule::getName() const
{
return "Test Module";
......
......@@ -47,12 +47,6 @@ public:
*/
virtual ~WTestModule();
/**
* Copy constructor
* \param other Reference on object to copy.
*/
WTestModule( const WTestModule& other );
/**
* Gives back the name of this module.
* \return the module's name.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment