30 #include <boost/shared_ptr.hpp>
32 #include "WModuleInputConnector.h"
33 #include "WModuleOutputConnector.h"
34 #include "WModuleInputData.h"
35 #include "WModuleOutputData.h"
36 #include "WModuleConnectorSignals.h"
37 #include "WModuleContainer.h"
38 #include "WModuleFactory.h"
39 #include "WModuleMetaInformation.h"
40 #include "exceptions/WModuleConnectorInitFailed.h"
41 #include "exceptions/WModuleConnectorNotFound.h"
42 #include "exceptions/WModuleUninitialized.h"
43 #include "exceptions/WModuleRequirementNotMet.h"
44 #include "../common/WException.h"
45 #include "../common/exceptions/WNameNotUnique.h"
46 #include "../common/exceptions/WSignalUnknown.h"
47 #include "../common/exceptions/WSignalSubscriptionFailed.h"
48 #include "../common/WLogger.h"
49 #include "../common/WCondition.h"
50 #include "../common/WConditionOneShot.h"
51 #include "../common/WConditionSet.h"
52 #include "../common/WPathHelper.h"
53 #include "../common/WProgressCombiner.h"
54 #include "../common/WPredicateHelper.h"
67 m_readyProgress( boost::shared_ptr<
WProgress >( new
WProgress(
"Initializing Module" ) ) ),
73 m_infoProperties = boost::shared_ptr< WProperties >(
new WProperties(
"Informational Properties",
"Module's information properties" ) );
74 m_infoProperties->setPurpose( PV_PURPOSE_INFORMATION );
76 m_runtimeName =
m_properties->addProperty(
"Name",
"The name of the module defined by the user. This is, by default, the module name but "
77 "can be changed by the user to provide some kind of simple identification upon many modules.",
78 std::string(
"" ),
false );
80 m_active =
m_properties->addProperty(
"active",
"Determines whether the module should be activated.",
true,
true );
89 m_container = boost::shared_ptr< WModuleContainer >();
117 throw WNameNotUnique( std::string(
"Could not add the connector " + con->getCanonicalName() +
" since names must be unique." ) );
136 throw WNameNotUnique( std::string(
"Could not add the connector " + con->getCanonicalName() +
" since names must be unique." ) );
148 ( *listIter )->disconnectAll();
153 ( *listIter )->disconnectAll();
159 WCombinerTypes::WDisconnectList discons;
165 WCombinerTypes::WDisconnectGroup g = WCombinerTypes::WDisconnectGroup( ( *listIter )->getName(),
166 ( *listIter )->getPossibleDisconnections() );
168 if( g.second.size() )
170 discons.push_back( g );
178 WCombinerTypes::WDisconnectGroup g = WCombinerTypes::WDisconnectGroup( ( *listIter )->getName(),
179 ( *listIter )->getPossibleDisconnections() );
181 if( g.second.size() )
183 discons.push_back( g );
236 std::string(
". Reason: already initialized." ) );
280 return MODULE_ARBITRARY;
300 if( ( name == ( *listIter )->getCanonicalName() ) || ( name == ( *listIter )->getName() ) )
302 return ( *listIter );
306 return boost::shared_ptr< WModuleInputConnector >();
316 std::string(
"\" does not exist in the module \"" ) +
getName() + std::string(
"\"." ) );
329 if( ( name == ( *listIter )->getCanonicalName() ) || ( name == ( *listIter )->getName() ) )
331 return ( *listIter );
335 return boost::shared_ptr< WModuleOutputConnector >();
345 std::string(
"\" does not exist in the module \"" ) +
getName() +
346 std::string(
"\"." ) );
367 boost::shared_ptr< WModuleConnector > p =
findConnector( name );
372 std::string(
"\" does not exist in the module \"" ) +
getName() +
373 std::string(
"\"." ) );
386 std::ostringstream s;
387 s <<
"Could not subscribe to unknown signal.";
400 std::ostringstream s;
401 s <<
"Could not subscribe to unknown signal.";
411 case CONNECTION_ESTABLISHED:
413 case CONNECTION_CLOSED:
418 std::ostringstream s;
419 s <<
"Could not subscribe to unknown signal. You need to implement this signal type explicitly in your module.";
457 boost::shared_ptr< WModuleConnector > )
463 boost::shared_ptr< WModuleConnector > )
469 boost::shared_ptr< WModuleConnector > )
492 static const char * o_xpm[] =
513 if( !( *i )->isComplied() )