25 #ifndef WMODULEINPUTDATA_H
26 #define WMODULEINPUTDATA_H
31 #include <boost/shared_ptr.hpp>
32 #include <boost/thread/locks.hpp>
36 #include "WModuleOutputData.h"
37 #include "exceptions/WModuleConnectorUnconnected.h"
38 #include "../common/WTransferable.h"
39 #include "../common/WPrototyped.h"
41 #include "WModuleInputConnector.h"
42 #include "WModuleOutputConnector.h"
48 template <
typename T >
55 typedef boost::shared_ptr< WModuleInputData< T > >
PtrType;
81 static PtrType create( boost::shared_ptr< WModule > module, std::string name =
"", std::string description =
"" );
93 static PtrType createAndAdd( boost::shared_ptr< WModule > module, std::string name =
"", std::string description =
"" );
102 WModuleInputData( boost::shared_ptr< WModule > module, std::string name =
"", std::string description =
"" ):
121 virtual void disconnect( boost::shared_ptr<WModuleConnector> con,
bool removeFromOwnList =
true );
130 const boost::shared_ptr< T >
getData(
bool reset =
true )
133 boost::shared_lock<boost::shared_mutex> lock = boost::shared_lock<boost::shared_mutex>(
m_connectionListLock );
145 return boost::shared_ptr< T >();
149 boost::shared_ptr< T > dat = boost::shared_dynamic_cast< T >(
166 virtual bool connectable( boost::shared_ptr<WModuleConnector> con )
178 boost::shared_ptr< WPrototyped > tProto =
182 return dynamic_cast< T*
>( tProto.get() );
195 template <
typename T >
198 m_disconnecting =
true;
200 m_disconnecting =
false;
203 template <
typename T >
205 std::string description )
209 return PTR(
new TYPE( module, name, description ) );
212 template <
typename T >
214 std::string description )
217 module->addConnector( c );
221 #endif // WMODULEINPUTDATA_H