25 #ifndef WMODULEOUTPUTFORWARDDATA_H
26 #define WMODULEOUTPUTFORWARDDATA_H
32 #include "WModuleInputData.h"
33 #include "WModuleOutputData.h"
39 template<
typename T >
46 typedef std::shared_ptr< WModuleOutputForwardData< T > >
SPtr;
51 typedef std::shared_ptr< const WModuleOutputForwardData< T > >
ConstSPtr;
82 static PtrType create( std::shared_ptr< WModule > module, std::string name =
"", std::string description =
"" );
94 static PtrType createAndAdd( std::shared_ptr< WModule > module, std::string name =
"", std::string description =
"" );
112 boost::placeholders::_1,
113 boost::placeholders::_2 ) );
116 boost::placeholders::_1,
117 boost::placeholders::_2 ) );
132 virtual void forward( std::shared_ptr< WModuleConnector > from )
134 m_in->connect( from );
142 virtual void unforward( std::shared_ptr< WModuleConnector > from )
144 m_in->disconnect( from );
151 std::shared_ptr< WModuleInputData< T > >
m_in;
166 template <
typename T >
168 std::string description )
172 return PTR(
new TYPE( module, name, description ) );
175 template <
typename T >
177 std::string description )
180 module->addConnector( c );
std::shared_ptr< WModuleConnector > SPtr
Shared pointer to this class.
Class offering an instantiate-able data connection between modules.
virtual void updateData(std::shared_ptr< T > data)
Update the data associated.
std::shared_ptr< WModuleOutputData< T > > PtrType
Pointer to this.
This is a simple class which forwards output data to output data connectors.
virtual ~WModuleOutputForwardData()
Destructor.
std::shared_ptr< const WModuleOutputForwardData< T > > ConstSPtr
Pointer to this.
SPtr PtrType
Pointer to this.
std::shared_ptr< WModuleOutputForwardData< T > > SPtr
Pointer to this.
virtual void inputNotifyDataChange(std::shared_ptr< WModuleConnector >, std::shared_ptr< WModuleConnector >)
Gets called whenever a connected output updates its data.
virtual void unforward(std::shared_ptr< WModuleConnector > from)
Remove the specified connector from the forwarding list.
virtual void forward(std::shared_ptr< WModuleConnector > from)
Forward the output to the specified output.
WModuleOutputForwardData< T > Type
Type of the connector.
WModuleOutputForwardData< T > & RefType
Reference to this type.
WModuleOutputForwardData(std::shared_ptr< WModule > module, std::string name="", std::string description="")
Constructor.
static PtrType create(std::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.
T TransferType
Typedef to the contained transferable.
static PtrType createAndAdd(std::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...
std::shared_ptr< WModuleInputData< T > > m_in
The output connector which collects data and distributes it to all connectors connected using the for...