25 #ifndef WMODULEOUTPUTFORWARDDATA_H
26 #define WMODULEOUTPUTFORWARDDATA_H
31 #include <boost/shared_ptr.hpp>
34 #include "WModuleInputData.h"
35 #include "WModuleOutputData.h"
41 template<
typename T >
48 typedef boost::shared_ptr< WModuleOutputForwardData< T > >
SPtr;
53 typedef boost::shared_ptr< const WModuleOutputForwardData< T > >
ConstSPtr;
84 static PtrType
create( boost::shared_ptr< WModule > module, std::string name =
"", std::string description =
"" );
96 static PtrType
createAndAdd( boost::shared_ptr< WModule > module, std::string name =
"", std::string description =
"" );
128 virtual void forward( boost::shared_ptr< WModuleConnector > from )
130 m_in->connect( from );
138 virtual void unforward( boost::shared_ptr< WModuleConnector > from )
140 m_in->disconnect( from );
147 boost::shared_ptr< WModuleInputData< T > >
m_in;
162 template <
typename T >
164 std::string description )
168 return PTR(
new TYPE( module, name, description ) );
171 template <
typename T >
173 std::string description )
176 module->addConnector( c );
180 #endif // WMODULEOUTPUTFORWARDDATA_H
T TransferType
Typedef to the contained transferable.
virtual void unforward(boost::shared_ptr< WModuleConnector > from)
Remove the specified connector from the forwarding list.
This is a simple class which forwards output data to output data connectors.
boost::shared_ptr< const WModuleOutputForwardData< T > > ConstSPtr
Pointer to this.
virtual void inputNotifyDataChange(boost::shared_ptr< WModuleConnector >, boost::shared_ptr< WModuleConnector >)
Gets called whenever a connected output updates its data.
static PtrType create(boost::shared_ptr< WModule > module, std::string name="", std::string description="")
Convenience method to create a new instance of this out data connector with proper type...
boost::shared_ptr< WModuleInputData< T > > m_in
The output connector which collects data and distributes it to all connectors connected using the for...
Class offering an instantiate-able data connection between modules.
virtual void forward(boost::shared_ptr< WModuleConnector > from)
Forward the output to the specified output.
static PtrType createAndAdd(boost::shared_ptr< WModule > module, std::string name="", std::string description="")
Convenience method to create a new instance of this out data connector with proper type and add it to...
WModuleOutputForwardData< T > Type
Type of the connector.
WModuleOutputForwardData(boost::shared_ptr< WModule > module, std::string name="", std::string description="")
Constructor.
boost::shared_ptr< WModuleOutputForwardData< T > > SPtr
Pointer to this.
WModuleOutputForwardData< T > & RefType
Reference to this type.
virtual void updateData(boost::shared_ptr< T > data)
Update the data associated.
virtual ~WModuleOutputForwardData()
Destructor.
SPtr PtrType
Pointer to this.