25 #ifndef WMODULEOUTPUTDATA_H
26 #define WMODULEOUTPUTDATA_H
31 #include <boost/shared_ptr.hpp>
34 #include "../common/WLogger.h"
38 #include "WModuleInputData.h"
39 #include "../common/WPrototyped.h"
40 #include "../common/WTransferable.h"
42 #include "WModuleOutputConnector.h"
48 template <
typename T >
55 typedef boost::shared_ptr< WModuleOutputData< T > >
PtrType;
60 typedef boost::shared_ptr< WModuleOutputData< T > >
SPtr;
65 typedef boost::shared_ptr< const WModuleOutputData< T > >
ConstSPtr;
91 static PtrType
create( boost::shared_ptr< WModule > module, std::string name =
"", std::string description =
"" );
103 static PtrType
createAndAdd( boost::shared_ptr< WModule > module, std::string name =
"", std::string description =
"" );
112 WModuleOutputData( boost::shared_ptr< WModule > module, std::string name =
"", std::string description =
"" )
115 m_data = boost::shared_ptr< T >();
160 virtual const boost::shared_ptr< WTransferable >
getRawData()
const
182 virtual bool connectable( boost::shared_ptr<WModuleConnector> con )
196 return (
m_data == boost::shared_ptr< T >() ) ? T::getPrototype() : boost::static_pointer_cast<
WPrototyped >(
m_data );
204 boost::shared_ptr< T >
m_data;
207 template <
typename T >
209 std::string description )
213 return PTR(
new TYPE( module, name, description ) );
216 template <
typename T >
218 std::string description )
221 module->addConnector( c );
225 #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.