32 #include "../common/WLogger.h"
33 #include "combiner/WApplyCombiner.h"
34 #include "exceptions/WPrototypeNotUnique.h"
35 #include "exceptions/WPrototypeUnknown.h"
37 #include "WModuleCombiner.h"
38 #include "WModuleFactory.h"
67 m_prototypeAccess.reset();
73 std::set< std::string > names;
80 if( names.count( ( *listIter )->getName() ) )
83 +
"\" is not unique. Modules have to have a unique name." ) );
85 names.insert( ( *listIter )->getName() );
100 return ( ticket->get().count( module ) != 0 );
105 wlog::debug(
"ModuleFactory" ) <<
"Creating new instance of prototype \"" << prototype->getName() <<
"\".";
113 throw WPrototypeUnknown( std::string(
"Could not clone module \"" + prototype->getName() +
"\" since it is no prototype." ) );
120 boost::shared_ptr< WModule > clone = boost::shared_ptr< WModule >( prototype->factory() );
121 clone->setLocalPath( prototype->getLocalPath() );
129 module->initialize();
149 boost::shared_ptr< WModule > ret = boost::shared_ptr< WModule >();
150 for( std::set< boost::shared_ptr< WModule > >::const_iterator listIter = l->get().begin(); listIter != l->get().end();
153 if( ( *listIter )->getName() == name )
168 if( ret == boost::shared_ptr< WModule >() )
170 throw WPrototypeUnknown( std::string(
"Could not find prototype \"" + name +
"\"." ) );
183 std::vector< WModule::ConstSPtr > ret;
189 for( std::set< boost::shared_ptr< WModule > >::const_iterator listIter = l->get().begin(); listIter != l->get().end();
192 if( ( *listIter )->getType() == type )
194 ret.push_back( *listIter );
208 WCombinerTypes::WCompatiblesList compatibles;
219 if( pcons.size() == 0 )
222 WCombinerTypes::WOneToOneCombiners lComp;
225 lComp.push_back( boost::shared_ptr< WApplyCombiner >(
new WApplyCombiner( module,
"", *listIter,
"" ) ) );
228 compatibles.push_back( WCombinerTypes::WCompatiblesGroup( ( *listIter ), lComp ) );
239 WCombinerTypes::WOneToOneCombiners lComp = WApplyCombiner::createCombinerList< WApplyCombiner >( module, ( *listIter ) );
242 if( lComp.size() != 0 )
244 compatibles.push_back( WCombinerTypes::WCompatiblesGroup( ( *listIter ), lComp ) );
253 std::sort( compatibles.begin(), compatibles.end(), WCombinerTypes::compatiblesSort );