25 #ifndef WMODULEOUTPUTDATA_H
26 #define WMODULEOUTPUTDATA_H
30 #include <boost/shared_ptr.hpp>
32 #include "../common/WLogger.h"
36 #include "WModuleInputData.h"
37 #include "../common/WPrototyped.h"
38 #include "../common/WTransferable.h"
40 #include "WModuleOutputConnector.h"
46 template <
typename T >
53 typedef boost::shared_ptr< WModuleOutputData< T > >
PtrType;
58 typedef boost::shared_ptr< WModuleOutputData< T > >
SPtr;
63 typedef boost::shared_ptr< const WModuleOutputData< T > >
ConstSPtr;
89 static PtrType
create( boost::shared_ptr< WModule > module, std::string name =
"", std::string description =
"" );
101 static PtrType
createAndAdd( boost::shared_ptr< WModule > module, std::string name =
"", std::string description =
"" );
110 WModuleOutputData( boost::shared_ptr< WModule > module, std::string name =
"", std::string description =
"" )
113 m_data = boost::shared_ptr< T >();
158 virtual const boost::shared_ptr< WTransferable >
getRawData()
const
180 virtual bool connectable( boost::shared_ptr<WModuleConnector> con )
194 return (
m_data == boost::shared_ptr< T >() ) ? T::getPrototype() : boost::static_pointer_cast<
WPrototyped >(
m_data );
202 boost::shared_ptr< T >
m_data;
205 template <
typename T >
207 std::string description )
211 return PTR(
new TYPE( module, name, description ) );
214 template <
typename T >
216 std::string description )
219 module->addConnector( c );
223 #endif // WMODULEOUTPUTDATA_H
virtual boost::shared_ptr< WPrototyped > getTransferPrototype()
Returns the prototype of the Type T used in this connector.
WModuleOutputData(boost::shared_ptr< WModule > module, std::string name="", std::string description="")
Constructor.
virtual bool connectable(boost::shared_ptr< WModuleConnector > con)
Checks whether the specified connector is an input connector and compatible with T.
boost::shared_ptr< const WModuleOutputData< T > > ConstSPtr
Pointer to this.
virtual const boost::shared_ptr< WTransferable > getRawData() const
Gives back the currently set data as WTransferable.
WModuleOutputData< T > Type
Type of the connector.
const boost::shared_ptr< T > getData() const
Gives back the currently set data.
Class offering an instantiate-able data connection between modules.
virtual void propagateDataChange()
Propagates the signal "DATA_CHANGED" to all connected items.
Interface class for the concept "Prototype".
boost::shared_ptr< WModuleOutputData< T > > SPtr
Pointer to this.
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...
T TransferType
Typedef to the contained transferable.
virtual ~WModuleOutputData()
Destructor.
Class implementing output connection functionality between modules.
virtual bool connectable(boost::shared_ptr< WModuleConnector > con)
Checks whether the specified connector is an input connector.
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< WModuleOutputData< T > > PtrType
Pointer to this.
virtual void triggerUpdate()
This method simply propagates an update but does not actually change the data.
boost::shared_ptr< T > m_data
The data associated with this connector.
WModuleOutputData< T > & RefType
Reference to this type.
virtual void updateData(boost::shared_ptr< T > data)
Update the data associated.
virtual void reset()
Resets the data on this output.