OpenWalnut  1.2.5
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
Public Member Functions | Static Public Member Functions | List of all members
WApplyCombiner Class Reference

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

#include <WApplyCombiner.h>

+ Inheritance diagram for WApplyCombiner:

Public Member Functions

 WApplyCombiner (boost::shared_ptr< WModuleContainer > target, boost::shared_ptr< WModule > srcModule, std::string srcConnector, boost::shared_ptr< WModule > targetModule, std::string targetConnector)
 Creates a combiner which sets up the specified modules and prototype combination.
 WApplyCombiner (boost::shared_ptr< WModule > srcModule, std::string srcConnector, boost::shared_ptr< WModule > targetModule, std::string targetConnector)
 Creates a combiner which sets up the specified modules and prototype combination.
virtual ~WApplyCombiner ()
 Destructor.
virtual void apply ()
 Apply the internal module structure to the target container.
- Public Member Functions inherited from WModuleOneToOneCombiner
 WModuleOneToOneCombiner (boost::shared_ptr< WModuleContainer > target, boost::shared_ptr< WModule > srcModule, std::string srcConnector, boost::shared_ptr< WModule > targetModule, std::string targetConnector)
 Creates a combiner which sets up the specified modules and prototype combination.
 WModuleOneToOneCombiner (boost::shared_ptr< WModule > srcModule, std::string srcConnector, boost::shared_ptr< WModule > targetModule, std::string targetConnector)
 Creates a combiner which sets up the specified modules and prototype combination.
virtual ~WModuleOneToOneCombiner ()
 Destructor.
boost::shared_ptr< WModulegetSrcModule () const
 Gets the source module.
std::string getSrcConnector () const
 The output connector of m_srcModule to connect with m_targetConnector.
boost::shared_ptr< WModulegetTargetModule () const
 The module/prototype to connect with m_srcModule.
std::string getTargetConnector () const
 The input connector the target module to connect with m_srcConnector.
- Public Member Functions inherited from WModuleCombiner
 WModuleCombiner (boost::shared_ptr< WModuleContainer > target)
 Creates an empty combiner.
 WModuleCombiner ()
 Creates an empty combiner.
virtual ~WModuleCombiner ()
 Destructor.
virtual void run ()
 Run thread and call apply().
- Public Member Functions inherited from WThreadedRunner
 WThreadedRunner ()
 Default constructor.
virtual ~WThreadedRunner ()
 Destructor.
void run (THREADFUNCTION f)
 Run thread.
void wait (bool requestFinish=false)
 Wait for the thread to be finished.
virtual void requestStop ()
 This method's purpose is to request a stop without waiting for it.

Static Public Member Functions

template<typename T >
static
WCombinerTypes::WOneToOneCombiners 
createCombinerList (boost::shared_ptr< WModule > module1, boost::shared_ptr< WModule > module2)
 This method creates a list of possible combiners for connections between the specified modules.

Additional Inherited Members

- Public Types inherited from WThreadedRunner
typedef boost::function< void(void) > THREADFUNCTION
 Type used for simple thread functions.
- Protected Member Functions inherited from WModuleCombiner
virtual void threadMain ()
 Function that has to be overwritten for execution.
- Protected Attributes inherited from WModuleOneToOneCombiner
boost::shared_ptr< WModulem_srcModule
 The source module to connect with the target.
std::string m_srcConnector
 The output connector of m_srcModule to connect with m_targetConnector.
boost::shared_ptr< WModulem_targetModule
 The module/prototype to connect with m_srcMdodule.
std::string m_targetConnector
 The input connector the target module to connect with m_srcConnector.

Detailed Description

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

Definition at line 46 of file WApplyCombiner.h.

Constructor & Destructor Documentation

WApplyCombiner::WApplyCombiner ( boost::shared_ptr< WModuleContainer target,
boost::shared_ptr< WModule srcModule,
std::string  srcConnector,
boost::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 31 of file WApplyCombiner.cpp.

WApplyCombiner::WApplyCombiner ( boost::shared_ptr< WModule srcModule,
std::string  srcConnector,
boost::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 38 of file WApplyCombiner.cpp.

WApplyCombiner::~WApplyCombiner ( )
virtual

Destructor.

Definition at line 44 of file WApplyCombiner.cpp.

Member Function Documentation

void WApplyCombiner::apply ( )
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 WMData modules, might take some time. It applies the loaded project file.

Implements WModuleOneToOneCombiner.

Definition at line 49 of file WApplyCombiner.cpp.

References wlog::error(), WModuleFactory::getModuleFactory(), WModuleFactory::isPrototype(), WModuleCombiner::m_container, WModuleOneToOneCombiner::m_srcConnector, WModuleOneToOneCombiner::m_srcModule, WModuleOneToOneCombiner::m_targetConnector, and WModuleOneToOneCombiner::m_targetModule.

template<typename T >
static WCombinerTypes::WOneToOneCombiners WApplyCombiner::createCombinerList ( boost::shared_ptr< WModule module1,
boost::shared_ptr< WModule module2 
)
inlinestatic

This method creates a list of possible combiners for connections between the specified modules.

Both modules can be prototypes.

Parameters
module1the first module
module2the second module
Returns
the list of combiner for one-to-one connections

Definition at line 100 of file WApplyCombiner.h.


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