OpenWalnut  1.5.0dev
Public Member Functions | Protected Attributes | List of all members
WModuleOneToOneCombiner Class Referenceabstract

Base class for all combiners which apply one connection between two connectors of two modules. More...

#include <WModuleOneToOneCombiner.h>

+ Inheritance diagram for WModuleOneToOneCombiner:
+ Collaboration diagram for WModuleOneToOneCombiner:

Public Member Functions

 WModuleOneToOneCombiner (std::shared_ptr< WModuleContainer > target, std::shared_ptr< WModule > srcModule, std::string srcConnector, std::shared_ptr< WModule > targetModule, std::string targetConnector)
 Creates a combiner which sets up the specified modules and prototype combination. More...
 
 WModuleOneToOneCombiner (std::shared_ptr< WModule > srcModule, std::string srcConnector, std::shared_ptr< WModule > targetModule, std::string targetConnector)
 Creates a combiner which sets up the specified modules and prototype combination. More...
 
virtual ~WModuleOneToOneCombiner ()
 Destructor. More...
 
virtual void apply ()=0
 Apply the internal module structure to the target container. More...
 
std::shared_ptr< WModulegetSrcModule () const
 Gets the source module. More...
 
std::string getSrcConnector () const
 The output connector of m_srcModule to connect with m_targetConnector. More...
 
std::shared_ptr< WModulegetTargetModule () const
 The module/prototype to connect with m_srcModule. More...
 
std::string getTargetConnector () const
 The input connector the target module to connect with m_srcConnector. More...
 
- Public Member Functions inherited from WModuleCombiner
 WModuleCombiner (std::shared_ptr< WModuleContainer > target)
 Creates an empty combiner. More...
 
 WModuleCombiner ()
 Creates an empty combiner. More...
 
virtual ~WModuleCombiner ()
 Destructor. More...
 
virtual void run ()
 Run thread and call apply(). More...
 
- Public Member Functions inherited from WThreadedRunner
 WThreadedRunner ()
 Default constructor. More...
 
virtual ~WThreadedRunner ()
 Destructor. More...
 
void run (THREADFUNCTION f)
 Run thread. More...
 
void wait (bool requestFinish=false)
 Wait for the thread to be finished. More...
 
virtual void requestStop ()
 This method's purpose is to request a stop without waiting for it. More...
 
virtual boost::signals2::connection subscribeSignal (THREAD_SIGNAL signal, t_ThreadErrorSignalHandlerType notifier)
 Connects a specified notify function with a signal this thread instance is offering. More...
 
const WBoolFlagisCrashed () const
 Checks whether this thread has been crashed. More...
 
const std::string & getCrashMessage () const
 Get the message of the exception finally causing the crash. More...
 
void setThreadName (std::string name)
 Set the name of the thread. More...
 
std::string getThreadName () const
 Returns the current thread name. More...
 

Protected Attributes

std::shared_ptr< WModulem_srcModule
 The source module to connect with the target. More...
 
std::string m_srcConnector
 The output connector of m_srcModule to connect with m_targetConnector. More...
 
std::shared_ptr< WModulem_targetModule
 The module/prototype to connect with m_srcMdodule. More...
 
std::string m_targetConnector
 The input connector the target module to connect with m_srcConnector. More...
 
- Protected Attributes inherited from WModuleCombiner
std::shared_ptr< WModuleContainerm_container
 The module container to use for the modules. More...
 
- Protected Attributes inherited from WThreadedRunner
boost::thread m_thread
 Thread instance. More...
 
WBoolFlag m_shutdownFlag
 Condition getting fired whenever the thread should quit. More...
 
WBoolFlag m_isCrashed
 True whenever an exception is thrown during threadMain. More...
 
std::string m_crashMessage
 The crash message. More...
 

Additional Inherited Members

- Public Types inherited from WThreadedRunner
typedef std::shared_ptr< WThreadedRunnerSPtr
 Abbreviation to a shared_ptr to this type. More...
 
typedef std::shared_ptr< const WThreadedRunnerConstSPtr
 Abbreviation to a const shared_ptr to this type. More...
 
typedef boost::function< void(void) > THREADFUNCTION
 Type used for simple thread functions. More...
 
- Static Public Member Functions inherited from WThreadedRunner
static void setThisThreadName (std::string name)
 Static function to set the name of the calling thread. More...
 
- Protected Member Functions inherited from WModuleCombiner
virtual void threadMain ()
 Function that has to be overwritten for execution. More...
 
- Protected Member Functions inherited from WThreadedRunner
virtual void notifyStop ()
 Gets called when the thread should be stopped. More...
 
void yield () const
 Give remaining execution timeslice to another thread. More...
 
void sleep (const int32_t t) const
 Sets thread asleep. More...
 
void msleep (const int32_t t) const
 Sets thread asleep. More...
 
void waitForStop ()
 Let the thread sleep until a stop request was given. More...
 
virtual void onThreadException (const WException &e)
 This method is called if an exception was caught, which came from the custom thread code. More...
 
void handleDeadlyException (const WException &e, std::string sender="WThreadedRunner")
 Handle the specified exception which was not caught in the thread, which basically means the thread has crashed. More...
 

Detailed Description

Base class for all combiners which apply one connection between two connectors of two modules.

Definition at line 41 of file WModuleOneToOneCombiner.h.

Constructor & Destructor Documentation

◆ WModuleOneToOneCombiner() [1/2]

WModuleOneToOneCombiner::WModuleOneToOneCombiner ( std::shared_ptr< WModuleContainer target,
std::shared_ptr< WModule srcModule,
std::string  srcConnector,
std::shared_ptr< WModule targetModule,
std::string  targetConnector 
)

Creates a combiner which sets up the specified modules and prototype combination.

Specifying a NULL pointer to the srcModule parameter causes the combiner to only add the target module without any connections. This is especially useful for modules which do not provide any input which must be connected. It is possible to specify prototypes here. The will get created upon apply.

Parameters
targetthe target container
srcModulethe module whose output should be connected with the prototypes input
srcConnectorthe output connector of the module
targetModulethe module/prototype to use for connecting the module with
targetConnectorthe input connector of the prototype to connect with srcConnector.

Definition at line 30 of file WModuleOneToOneCombiner.cpp.

◆ WModuleOneToOneCombiner() [2/2]

WModuleOneToOneCombiner::WModuleOneToOneCombiner ( std::shared_ptr< WModule srcModule,
std::string  srcConnector,
std::shared_ptr< WModule targetModule,
std::string  targetConnector 
)

Creates a combiner which sets up the specified modules and prototype combination.

This constructor automatically uses the kernel's root container as target container. Specifying a NULL pointer to the srcModule parameter causes the combiner to only add the target module without any connections. This is especially useful for modules which do not provide any input which must be connected. It is possible to specify prototypes here. The will get created upon apply.

Parameters
srcModulethe module whose output should be connected with the prototypes input
srcConnectorthe output connector of the module
targetModulethe module/prototype to use for connecting the module with
targetConnectorthe input connector of the prototype to connect with srcConnector.

Definition at line 41 of file WModuleOneToOneCombiner.cpp.

◆ ~WModuleOneToOneCombiner()

WModuleOneToOneCombiner::~WModuleOneToOneCombiner ( )
virtual

Destructor.

Definition at line 51 of file WModuleOneToOneCombiner.cpp.

Member Function Documentation

◆ apply()

virtual void WModuleOneToOneCombiner::apply ( )
pure virtual

Apply the internal module structure to the target container.

Be aware, that this operation might take some time, as modules can be connected only if they are "ready", which, at least with WDataModule modules, might take some time. It applies the loaded project file.

Implements WModuleCombiner.

Implemented in WDisconnectCombiner, and WApplyCombiner.

◆ getSrcConnector()

std::string WModuleOneToOneCombiner::getSrcConnector ( ) const

The output connector of m_srcModule to connect with m_targetConnector.

Returns
the source module's output connector.

Definition at line 61 of file WModuleOneToOneCombiner.cpp.

References m_srcConnector.

◆ getSrcModule()

std::shared_ptr< WModule > WModuleOneToOneCombiner::getSrcModule ( ) const

Gets the source module.

This module's output connector is connected with the target.

Returns
the source module.

Definition at line 56 of file WModuleOneToOneCombiner.cpp.

References m_srcModule.

◆ getTargetConnector()

std::string WModuleOneToOneCombiner::getTargetConnector ( ) const

The input connector the target module to connect with m_srcConnector.

Returns
the target module's input connector.

Definition at line 71 of file WModuleOneToOneCombiner.cpp.

References m_targetConnector.

◆ getTargetModule()

std::shared_ptr< WModule > WModuleOneToOneCombiner::getTargetModule ( ) const

The module/prototype to connect with m_srcModule.

Returns
the target module prototype.

Definition at line 66 of file WModuleOneToOneCombiner.cpp.

References m_targetModule.

Member Data Documentation

◆ m_srcConnector

std::string WModuleOneToOneCombiner::m_srcConnector
protected

The output connector of m_srcModule to connect with m_targetConnector.

Definition at line 122 of file WModuleOneToOneCombiner.h.

Referenced by WApplyCombiner::apply(), WDisconnectCombiner::apply(), and getSrcConnector().

◆ m_srcModule

std::shared_ptr< WModule > WModuleOneToOneCombiner::m_srcModule
protected

The source module to connect with the target.

Definition at line 117 of file WModuleOneToOneCombiner.h.

Referenced by WApplyCombiner::apply(), WDisconnectCombiner::apply(), and getSrcModule().

◆ m_targetConnector

std::string WModuleOneToOneCombiner::m_targetConnector
protected

The input connector the target module to connect with m_srcConnector.

Definition at line 132 of file WModuleOneToOneCombiner.h.

Referenced by WApplyCombiner::apply(), WDisconnectCombiner::apply(), and getTargetConnector().

◆ m_targetModule

std::shared_ptr< WModule > WModuleOneToOneCombiner::m_targetModule
protected

The module/prototype to connect with m_srcMdodule.

Definition at line 127 of file WModuleOneToOneCombiner.h.

Referenced by WApplyCombiner::apply(), WDisconnectCombiner::apply(), and getTargetModule().


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