diff --git a/src/gui/qt4/WMainWindow.cpp b/src/gui/qt4/WMainWindow.cpp index c0970200d93143e73aafa5e0c91b6a8e584a882f..62373a99ba39f120c07d6f791294b93d0e7913d8 100644 --- a/src/gui/qt4/WMainWindow.cpp +++ b/src/gui/qt4/WMainWindow.cpp @@ -52,7 +52,7 @@ #include "../../common/WColor.h" #include "../../common/WPreferences.h" #include "../../kernel/WKernel.h" -#include "../../kernel/WModuleProjectFileCombiner.h" +#include "../../kernel/combiner/WModuleProjectFileCombiner.h" #include "../../modules/data/WMData.h" #include "../../modules/navSlices/WMNavSlices.h" @@ -447,11 +447,6 @@ boost::signals2::signal1< void, std::vector< std::string > >* WMainWindow::getLo return &m_loaderSignal; } -boost::signals2::signal2< void, boost::shared_ptr< WModule >, boost::shared_ptr< WModule > >* WMainWindow::getModuleButtonSignal() -{ - return &m_moduleButtonSignal; -} - WIconManager* WMainWindow::getIconManager() { return &m_iconManager; @@ -594,12 +589,6 @@ void WMainWindow::closeCustomDockWidget( std::string title ) //m_customDockWidgetsLock.unlock(); } -void WMainWindow::slotActivateModule( QString module ) -{ - // TODO(schurade): do we really need the signal? Why can't we use the kernel directly? - m_moduleButtonSignal( getDatasetBrowser()->getSelectedModule(), WModuleFactory::getModuleFactory()->getPrototypeByName( module.toStdString() ) ); -} - void WMainWindow::newRoi() { // do nothing if we can not get diff --git a/src/gui/qt4/WMainWindow.h b/src/gui/qt4/WMainWindow.h index 0732e2cbdcd8aa1ba76d23f5fe182b6979132742..c79d06be55156bb00e9e1b9735a39b73a5ad0fe3 100644 --- a/src/gui/qt4/WMainWindow.h +++ b/src/gui/qt4/WMainWindow.h @@ -101,13 +101,6 @@ public: */ boost::signals2::signal1< void, std::vector< std::string > >* getLoaderSignal(); - /** - * Returns the signal emitted by those module buttons in the compatibility tab. - * - * \return the signal. - */ - boost::signals2::signal2< void, boost::shared_ptr< WModule >, boost::shared_ptr< WModule > >* getModuleButtonSignal(); - /** * Searches for a custom dock widget with a given name and returns it, if * found. @@ -170,12 +163,6 @@ public slots: */ void openAboutDialog(); - /** - * get called when a module button - * \param module name of teh module - */ - void slotActivateModule( QString module ); - /** * gets called when the button new roi is pressed */ @@ -227,11 +214,6 @@ private: boost::signals2::signal1< void, std::vector< std::string > > m_loaderSignal; //!< boost signal for open file dialog - /** - * boost signal object - */ - boost::signals2::signal2< void, boost::shared_ptr< WModule >, boost::shared_ptr< WModule > > m_moduleButtonSignal; - /** * Combine a module with a prototype only if the module is available. Else, nothing happens. * diff --git a/src/gui/qt4/WQt4Gui.cpp b/src/gui/qt4/WQt4Gui.cpp index b22d09ff9469632170b8d9584c623c65af8a3575..bcae381305a26aa8b831482a86314333490c75cc 100644 --- a/src/gui/qt4/WQt4Gui.cpp +++ b/src/gui/qt4/WQt4Gui.cpp @@ -38,7 +38,7 @@ #include "../../common/WIOTools.h" #include "../../graphicsEngine/WGraphicsEngine.h" #include "../../kernel/WKernel.h" -#include "../../kernel/WModuleProjectFileCombiner.h" +#include "../../kernel/combiner/WModuleProjectFileCombiner.h" #include "../../dataHandler/WDataHandler.h" #include "../../dataHandler/WSubject.h" #include "WOpenCustomDockWidgetEvent.h" @@ -142,8 +142,6 @@ int WQt4Gui::run() getLoadButtonSignal()->connect( boost::bind( &WKernel::loadDataSets, m_kernel, _1 ) ); #endif - m_mainWindow->getModuleButtonSignal()->connect( boost::bind( &WKernel::applyModule, m_kernel, _1, _2 ) ); - WCondition::t_ConditionNotifierType newDatasetSignal = boost::bind( &WQt4Gui::slotUpdateTextureSorter, this ); WDataHandler::getDefaultSubject()->getListChangeCondition()->subscribeSignal( newDatasetSignal ); diff --git a/src/gui/qt4/datasetbrowser/WQtDatasetBrowser.cpp b/src/gui/qt4/datasetbrowser/WQtDatasetBrowser.cpp index 7805d3bbd6d4b7ddc9ea651e1e9fca533d773501..b5bda40fff1c43c2cfdc90d6f9e0e25beede517d 100644 --- a/src/gui/qt4/datasetbrowser/WQtDatasetBrowser.cpp +++ b/src/gui/qt4/datasetbrowser/WQtDatasetBrowser.cpp @@ -453,12 +453,13 @@ void WQtDatasetBrowser::buildPropTab( boost::shared_ptr< WProperties > props ) void WQtDatasetBrowser::createCompatibleButtons( boost::shared_ptr< WModule >module ) { // every module may have compatibles: create ribbon menu entry - std::set< boost::shared_ptr< WModule > > comps = WModuleFactory::getModuleFactory()->getCompatiblePrototypes( module ); - for ( std::set< boost::shared_ptr< WModule > >::iterator iter = comps.begin(); iter != comps.end(); ++iter ) + std::set< boost::shared_ptr< WApplyPrototypeCombiner > > comps = WModuleFactory::getModuleFactory()->getCompatiblePrototypes( module ); + + for ( std::set< boost::shared_ptr< WApplyPrototypeCombiner > >::iterator iter = comps.begin(); iter != comps.end(); ++iter ) { if( !m_moduleWhiteList.empty() ) { - const std::string tmpName = ( *iter )->getName(); + const std::string tmpName = ( *iter )->getTargetPrototype()->getName(); if( std::find( m_moduleWhiteList.begin(), m_moduleWhiteList.end(), tmpName ) == m_moduleWhiteList.end() ) { continue; //do nothing for modules that are not in white list @@ -468,13 +469,13 @@ void WQtDatasetBrowser::createCompatibleButtons( boost::shared_ptr< WModule >mod QString buttonText = ""; if( m_showToolBarText ) { - buttonText = ( *iter )->getName().c_str(); + buttonText = ( *iter )->getTargetPrototype()->getName().c_str(); } - WQtPushButton* button = m_mainWindow->getCompatiblesToolBar()->addPushButton( QString( ( *iter )->getName().c_str() ), - m_mainWindow->getIconManager()->getIcon( ( *iter )->getName().c_str() ), buttonText ); - button->setToolTip( ( *iter )->getName().c_str() ); - connect( button, SIGNAL( pushButtonPressed( QString ) ), m_mainWindow, SLOT( slotActivateModule( QString ) ) ); + WQtPushButton* button = m_mainWindow->getCompatiblesToolBar()->addPushButton( QString( ( *iter )->getTargetPrototype()->getName().c_str() ), + m_mainWindow->getIconManager()->getIcon( ( *iter )->getTargetPrototype()->getName().c_str() ), buttonText ); + button->setToolTip( ( *iter )->getTargetPrototype()->getName().c_str() ); + //connect( button, SIGNAL( pushButtonPressed( QString ) ), m_mainWindow, SLOT( slotActivateModule( QString ) ) ); } } diff --git a/src/gui/qt4/guiElements/WQtPushButton.cpp b/src/gui/qt4/guiElements/WQtPushButton.cpp index a10fdd0362890b049294768d680f14cc9dc419b9..08fa7f3d58172f7e98693873352cd3487e71be7d 100644 --- a/src/gui/qt4/guiElements/WQtPushButton.cpp +++ b/src/gui/qt4/guiElements/WQtPushButton.cpp @@ -52,9 +52,5 @@ QString WQtPushButton::getName() void WQtPushButton::emitPressed() { emit pushButtonPressed( m_name ); - - // Strangely we need the inverted isChecked here. - // I think this is the case as the change of the checked flag happens after the call of this function. - emit pushButtonToggled( m_name, !this->isChecked() ); } diff --git a/src/gui/qt4/guiElements/WQtPushButton.h b/src/gui/qt4/guiElements/WQtPushButton.h index 7f1537f8f5a7f71307af85fc1fec0c16857070ee..83583ad1ac5cede63cfe5d9a4f0ba51d10d9d50d 100644 --- a/src/gui/qt4/guiElements/WQtPushButton.h +++ b/src/gui/qt4/guiElements/WQtPushButton.h @@ -84,14 +84,6 @@ signals: * \param name the name of the button. */ void pushButtonPressed( QString name ); - - /** - * Signals whenever the button got toggled. - * - * \param name the name of the button. - * \param value true if toggled. - */ - void pushButtonToggled( QString name, bool value ); }; #endif // WQTPUSHBUTTON_H diff --git a/src/kernel/CMakeLists.txt b/src/kernel/CMakeLists.txt index cd42cfb38ce063af5bdc598b44ced1e4dc7a51aa..24660936f072db198b882ece2d414094209f1877 100644 --- a/src/kernel/CMakeLists.txt +++ b/src/kernel/CMakeLists.txt @@ -2,10 +2,10 @@ FILE( GLOB KERNEL_SRC "*.cpp" "*.h" ) FILE( GLOB_RECURSE MODULES_SRC "../modules/*.cpp" "../modules/*.h" ) -ADD_SUBDIRECTORY( exceptions ) FILE( GLOB KERNEL_EXCEPTIONS_SRC "exceptions/*.cpp" "exceptions/*.h" ) +FILE( GLOB KERNEL_COMBINER_SRC "combiner/*.cpp" "combiner/*.h" ) -ADD_LIBRARY( kernel ${KERNEL_SRC} ${MODULES_SRC} ${KERNEL_EXCEPTIONS_SRC} ) +ADD_LIBRARY( kernel ${KERNEL_SRC} ${MODULES_SRC} ${KERNEL_EXCEPTIONS_SRC} ${KERNEL_COMBINER_SRC} ) TARGET_LINK_LIBRARIES( kernel common dataHandler ge ${OPENSCENEGRAPH_LIBRARIES} ) diff --git a/src/kernel/WKernel.cpp b/src/kernel/WKernel.cpp index c7cdbbe94af010c226b83eeaf4bcbc5e7292245b..53b8cb255111ed7dbd91bb0f6306ea204314172d 100644 --- a/src/kernel/WKernel.cpp +++ b/src/kernel/WKernel.cpp @@ -46,7 +46,6 @@ #include "WKernel.h" #include "WModule.h" #include "WModuleFactory.h" -#include "WModuleProjectFileCombiner.h" /** * Used for program wide access to the kernel. diff --git a/src/kernel/WModule.cpp b/src/kernel/WModule.cpp index f3bffb532c7c457fc1516cd66cb04a2a3acff254..ceba016c73e8b3184393fe7ceefca1d2e0f5c703 100644 --- a/src/kernel/WModule.cpp +++ b/src/kernel/WModule.cpp @@ -271,11 +271,6 @@ const t_GenericSignalHandlerType WModule::getSignalHandler( MODULE_CONNECTOR_SIG } } -std::set< boost::shared_ptr< WModule > > WModule::getCompatibles() -{ - return WModuleFactory::getModuleFactory()->getCompatiblePrototypes( shared_from_this() ); -} - const WBoolFlag& WModule::isInitialized() const { return m_initialized; diff --git a/src/kernel/WModule.h b/src/kernel/WModule.h index f80c4ae0ed889df79be60b6a54a95db2ad0e9ef8..abb9fa89b34ac196b953f6de6678b314a4445a3c 100644 --- a/src/kernel/WModule.h +++ b/src/kernel/WModule.h @@ -205,13 +205,6 @@ public: */ virtual boost::signals2::connection subscribeSignal( MODULE_SIGNAL signal, t_ModuleErrorSignalHandlerType notifier ); - /** - * Returns a set of prototypes compatible with this module's connectors. - * - * \return set of prototypes. - */ - virtual std::set< boost::shared_ptr< WModule > > getCompatibles(); - /** * Gets the modules base progress. This is actually a progress combiner, which bundles all progresses. * diff --git a/src/kernel/WModuleFactory.cpp b/src/kernel/WModuleFactory.cpp index 3932e4dc1a27ad77d73a90a12cc21e447056aba1..07074758a2433256d40facaf314c830069f61e2a 100644 --- a/src/kernel/WModuleFactory.cpp +++ b/src/kernel/WModuleFactory.cpp @@ -57,6 +57,7 @@ #include "WModuleFactory.h" #include "exceptions/WPrototypeNotUnique.h" #include "exceptions/WPrototypeUnknown.h" +#include "combiner/WApplyPrototypeCombiner.h" // factory instance as singleton boost::shared_ptr< WModuleFactory > WModuleFactory::m_instance = boost::shared_ptr< WModuleFactory >(); @@ -211,9 +212,9 @@ const boost::shared_ptr< WModule > WModuleFactory::getPrototypeByInstance( boost return getPrototypeByName( instance->getName() ); } -std::set< boost::shared_ptr< WModule > > WModuleFactory::getCompatiblePrototypes( boost::shared_ptr< WModule > module ) +std::set< boost::shared_ptr< WApplyPrototypeCombiner > > WModuleFactory::getCompatiblePrototypes( boost::shared_ptr< WModule > module ) { - std::set< boost::shared_ptr < WModule > > compatibles; + std::set< boost::shared_ptr < WApplyPrototypeCombiner > > compatibles; // for this a read lock is sufficient boost::shared_lock< boost::shared_mutex > slock = boost::shared_lock< boost::shared_mutex >( m_prototypesLock ); @@ -221,14 +222,14 @@ std::set< boost::shared_ptr< WModule > > WModuleFactory::getCompatiblePrototypes // get offered outputs std::set > cons = module->getOutputConnectors(); - // First add all modules with no input connector. + // First, add all modules with no input connector. for( std::set< boost::shared_ptr< WModule > >::iterator listIter = m_prototypes.begin(); listIter != m_prototypes.end(); ++listIter ) { // get connectors of this prototype std::set > pcons = ( *listIter )->getInputConnectors(); if( pcons.size() == 0 ) { - compatibles.insert( *listIter ); + compatibles.insert( boost::shared_ptr< WApplyPrototypeCombiner >( new WApplyPrototypeCombiner( module, "", *listIter, "" ) ) ); } } @@ -239,8 +240,6 @@ std::set< boost::shared_ptr< WModule > > WModuleFactory::getCompatiblePrototypes return compatibles; } - - // TODO(ebaum): see ticket #178 for this if ( cons.size() > 1 ) { wlog::warn( "ModuleFactory" ) << "Can not find compatibles for " << module->getName() << " module (more than 1 output connector). Using " @@ -270,7 +269,10 @@ std::set< boost::shared_ptr< WModule > > WModuleFactory::getCompatiblePrototypes if( ( *cons.begin() )->connectable( *pcons.begin() ) && ( *pcons.begin() )->connectable( *cons.begin() ) ) { // it is compatible -> add to list - compatibles.insert( *listIter ); + + compatibles.insert( boost::shared_ptr< WApplyPrototypeCombiner >( + new WApplyPrototypeCombiner( module, ( *cons.begin() )->getName(), *listIter, ( *pcons.begin() )->getName() ) ) + ); } } diff --git a/src/kernel/WModuleFactory.h b/src/kernel/WModuleFactory.h index 928899d12d7fd6b3d8d29247dfd9fdedb2bb7d65..4722864461c0bb7c00e34d6fd5a53521d5f1a152 100644 --- a/src/kernel/WModuleFactory.h +++ b/src/kernel/WModuleFactory.h @@ -32,6 +32,7 @@ #include #include "../modules/data/WMData.h" // this is the ONLY module with a special meaning. Every one knowing the factory also knows this +#include "combiner/WApplyPrototypeCombiner.h" #include "WModule.h" /** @@ -114,13 +115,13 @@ public: static bool isA( boost::shared_ptr< WModule > module ); /** - * Returns a set of modules compatible with the specified one. + * Returns a set of module combiners with module combinations compatible with the specified one. * - * \param module the module to find prototype for. + * \param module the module to find the compatibles for. * - * \return set of compatible prototypes. + * \return set of compatible combiners. */ - std::set< boost::shared_ptr< WModule > > getCompatiblePrototypes( boost::shared_ptr< WModule > module ); + std::set< boost::shared_ptr< WApplyPrototypeCombiner > > getCompatiblePrototypes( boost::shared_ptr< WModule > module ); /** * This method uses a newly created instance of WModule and initializes it properly. After using this method, the module is diff --git a/src/kernel/combiner/WApplyPrototypeCombiner.cpp b/src/kernel/combiner/WApplyPrototypeCombiner.cpp new file mode 100644 index 0000000000000000000000000000000000000000..5b23c61d7569e65b1a0c050a5418dbc856c5da2b --- /dev/null +++ b/src/kernel/combiner/WApplyPrototypeCombiner.cpp @@ -0,0 +1,127 @@ +//--------------------------------------------------------------------------- +// +// Project: OpenWalnut ( http://www.openwalnut.org ) +// +// Copyright 2009 OpenWalnut Community, BSV@Uni-Leipzig and CNCF@MPI-CBS +// For more information see http://www.openwalnut.org/copying +// +// This file is part of OpenWalnut. +// +// OpenWalnut is free software: you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// OpenWalnut is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public License +// along with OpenWalnut. If not, see . +// +//--------------------------------------------------------------------------- + +#include +#include +#include +#include +#include + +#include +#include + +#include "../WKernel.h" +#include "../WModuleCombiner.h" +#include "../WModuleFactory.h" +#include "../WModuleConnector.h" +#include "../WModule.h" +#include "../WModuleInputConnector.h" +#include "../WModuleOutputConnector.h" +#include "../exceptions/WModuleConnectorNotFound.h" + +#include "../../common/WLogger.h" + +#include "WApplyPrototypeCombiner.h" + +WApplyPrototypeCombiner::WApplyPrototypeCombiner( boost::shared_ptr< WModuleContainer > target, + boost::shared_ptr< WModule > srcModule, std::string srcConnector, + boost::shared_ptr< WModule > prototype, std::string targetConnector ): + WModuleCombiner( target ), + m_srcModule( srcModule ), + m_srcConnector( srcConnector ), + m_targetPrototype( prototype ), + m_targetConnector( targetConnector ) +{ +} + +WApplyPrototypeCombiner::WApplyPrototypeCombiner( boost::shared_ptr< WModule > srcModule, std::string srcConnector, + boost::shared_ptr< WModule > prototype, std::string targetConnector ): + WModuleCombiner( WKernel::getRunningKernel()->getRootContainer() ), + m_srcModule( srcModule ), + m_srcConnector( srcConnector ), + m_targetPrototype( prototype ), + m_targetConnector( targetConnector ) +{ +} + +WApplyPrototypeCombiner::~WApplyPrototypeCombiner() +{ + // cleanup +} + +boost::shared_ptr< WModule > WApplyPrototypeCombiner::getSrcModule() const +{ + return m_srcModule; +} + +std::string WApplyPrototypeCombiner::getSrcConnector() const +{ + return m_srcConnector; +} + +boost::shared_ptr< WModule > WApplyPrototypeCombiner::getTargetPrototype() const +{ + return m_targetPrototype; +} + +std::string WApplyPrototypeCombiner::getTargetConnector() const +{ + return m_targetConnector; +} + +void WApplyPrototypeCombiner::apply() +{ + // create module instance + boost::shared_ptr< WModule > targetModule = WModuleFactory::getModuleFactory()->create( m_targetPrototype ); + + // add the target module to the container + m_container->add( targetModule ); + // NOTE: here, we assume the src module already to be in the container. If not, connect will fail with an exception -> so no need for a + // separate exception here + + // wait + m_srcModule->isReadyOrCrashed().wait(); + if ( m_srcModule->isCrashed()() ) + { + wlog::error( "Prototype Combiner" ) << "The source module \"" << m_srcModule->getName() << "\" has crashed. Abort."; + return; + } + + targetModule->isReadyOrCrashed().wait(); + if ( targetModule->isCrashed()() ) + { + wlog::error( "Prototype Combiner" ) << "The target module \"" << targetModule->getName() << "\" has crashed. Abort."; + return; + } + + // if the target connector is an empty string -> do not connect, just add + if ( m_targetConnector.empty() ) + { + return; + } + + // and connect them finally: + targetModule->getInputConnector( m_targetConnector )->connect( m_srcModule->getOutputConnector( m_srcConnector ) ); +} + diff --git a/src/kernel/combiner/WApplyPrototypeCombiner.h b/src/kernel/combiner/WApplyPrototypeCombiner.h new file mode 100644 index 0000000000000000000000000000000000000000..6fdd432d0948eb4799ca738ed69c2e9f90c1d9e5 --- /dev/null +++ b/src/kernel/combiner/WApplyPrototypeCombiner.h @@ -0,0 +1,135 @@ +//--------------------------------------------------------------------------- +// +// Project: OpenWalnut ( http://www.openwalnut.org ) +// +// Copyright 2009 OpenWalnut Community, BSV@Uni-Leipzig and CNCF@MPI-CBS +// For more information see http://www.openwalnut.org/copying +// +// This file is part of OpenWalnut. +// +// OpenWalnut is free software: you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// OpenWalnut is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public License +// along with OpenWalnut. If not, see . +// +//--------------------------------------------------------------------------- + +#ifndef WAPPLYPROTOTYPECOMBINER_H +#define WAPPLYPROTOTYPECOMBINER_H + +#include +#include +#include +#include + +#include + +#include "../WModule.h" +#include "../WModuleCombiner.h" + +/** + * This class combines an existing module with an specified prototype. The connections to use must be explicitly known. + */ +class WApplyPrototypeCombiner: public WModuleCombiner +{ +public: + + /** + * Creates a combiner which sets up the specified modules and prototype combination. + * + * \param target the target container + * \param srcModule the module whose output should be connected with the prototypes input + * \param srcConnector the output connector of the module + * \param prototype the prototype to use for connecting the module with + * \param targetConnector the input connector of the prototype to connect with srcConnector. + */ + WApplyPrototypeCombiner( boost::shared_ptr< WModuleContainer > target, + boost::shared_ptr< WModule > srcModule, std::string srcConnector, + boost::shared_ptr< WModule > prototype, 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. + * + * \param srcModule the module whose output should be connected with the prototypes input + * \param srcConnector the output connector of the module + * \param prototype the prototype to use for connecting the module with + * \param targetConnector the input connector of the prototype to connect with srcConnector. + */ + WApplyPrototypeCombiner( boost::shared_ptr< WModule > srcModule, std::string srcConnector, + boost::shared_ptr< WModule > prototype, std::string targetConnector ); + + /** + * Destructor. + */ + virtual ~WApplyPrototypeCombiner(); + + /** + * 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. + */ + virtual void apply(); + + /** + * Gets the source module. This module's output connector is connected with the target. + * + * \return the source module. + */ + boost::shared_ptr< WModule > getSrcModule() const; + + /** + * The output connector of m_srcModule to connect with m_targetConnector. + * + * \return the source module's output connector. + */ + std::string getSrcConnector() const; + + /** + * The module prototype to connect with m_srcMdodule. + * + * \return the target module prototype. + */ + boost::shared_ptr< WModule > getTargetPrototype() const; + + /** + * The input connector the target module to connect with m_srcConnector. + * + * \return the target module's input connector. + */ + std::string getTargetConnector() const; + +protected: + + /** + * The source module to connect with the target + */ + boost::shared_ptr< WModule > m_srcModule; + + /** + * The output connector of m_srcModule to connect with m_targetConnector. + */ + std::string m_srcConnector; + + /** + * The module prototype to connect with m_srcMdodule. + */ + boost::shared_ptr< WModule > m_targetPrototype; + + /** + * The input connector the target module to connect with m_srcConnector. + */ + std::string m_targetConnector; + +private: +}; + +#endif // WAPPLYPROTOTYPECOMBINER_H + diff --git a/src/kernel/WModuleProjectFileCombiner.cpp b/src/kernel/combiner/WModuleProjectFileCombiner.cpp similarity index 97% rename from src/kernel/WModuleProjectFileCombiner.cpp rename to src/kernel/combiner/WModuleProjectFileCombiner.cpp index e09bd0bee5907c5a7bd575bc0234d5af4c1f06fa..3ed03d376709d0b102f498d523cf17c4fa27b835 100644 --- a/src/kernel/WModuleProjectFileCombiner.cpp +++ b/src/kernel/combiner/WModuleProjectFileCombiner.cpp @@ -31,17 +31,17 @@ #include #include -#include "WKernel.h" -#include "WModuleCombiner.h" -#include "WModuleFactory.h" -#include "WModuleConnector.h" -#include "WModule.h" -#include "WModuleInputConnector.h" -#include "WModuleOutputConnector.h" -#include "exceptions/WModuleConnectorNotFound.h" - -#include "../common/exceptions/WFileNotFound.h" -#include "../common/WLogger.h" +#include "../WKernel.h" +#include "../WModuleCombiner.h" +#include "../WModuleFactory.h" +#include "../WModuleConnector.h" +#include "../WModule.h" +#include "../WModuleInputConnector.h" +#include "../WModuleOutputConnector.h" +#include "../exceptions/WModuleConnectorNotFound.h" + +#include "../../common/exceptions/WFileNotFound.h" +#include "../../common/WLogger.h" #include "WModuleProjectFileCombiner.h" diff --git a/src/kernel/WModuleProjectFileCombiner.h b/src/kernel/combiner/WModuleProjectFileCombiner.h similarity index 99% rename from src/kernel/WModuleProjectFileCombiner.h rename to src/kernel/combiner/WModuleProjectFileCombiner.h index dc5709807bee7a9f31d0ded0ecb0746e44c97c1a..9174647739f971e3703b6be2c82916e609ce0a94 100644 --- a/src/kernel/WModuleProjectFileCombiner.h +++ b/src/kernel/combiner/WModuleProjectFileCombiner.h @@ -33,7 +33,7 @@ #include #include -#include "WModuleCombiner.h" +#include "../WModuleCombiner.h" /** * This is a base class for all module combination classes. The basic idea is to hide the actual combination work from others. These classes may