25 #ifndef WMODULEOUTPUTFORWARDDATA_H
26 #define WMODULEOUTPUTFORWARDDATA_H
30 #include <boost/shared_ptr.hpp>
32 #include "WModuleInputData.h"
33 #include "WModuleOutputData.h"
39 template<
typename T >
46 typedef boost::shared_ptr< WModuleOutputForwardData< T > >
SPtr;
51 typedef boost::shared_ptr< const WModuleOutputForwardData< T > >
ConstSPtr;
82 static PtrType create( boost::shared_ptr< WModule > module, std::string name =
"", std::string description =
"" );
94 static PtrType createAndAdd( boost::shared_ptr< WModule > module, std::string name =
"", std::string description =
"" );
126 virtual void forward( boost::shared_ptr< WModuleConnector > from )
128 m_in->connect( from );
136 virtual void unforward( boost::shared_ptr< WModuleConnector > from )
138 m_in->disconnect( from );
145 boost::shared_ptr< WModuleInputData< T > >
m_in;
160 template <
typename T >
162 std::string description )
166 return PTR(
new TYPE( module, name, description ) );
169 template <
typename T >
171 std::string description )
174 module->addConnector( c );
178 #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...
boost::shared_ptr< WModuleConnector > SPtr
Shared pointer to this class.
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.
boost::shared_ptr< WModuleOutputData< T > > PtrType
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.