MIRA
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Types | Public Member Functions | Protected Attributes | List of all members
ChannelSubscriber< T, ChannelRead > Class Template Reference

Implements AbstractChannelSubscriber for a concrete data type. More...

#include <fw/ChannelSubscriber.h>

Inheritance diagram for ChannelSubscriber< T, ChannelRead >:
Inheritance graph
[legend]

Public Types

typedef ConcreteChannel< T > ChannelType
 

Public Member Functions

 ChannelSubscriber (DispatcherThread *dispatcher, boost::function< void(ChannelRead)> invokeFn, DiagnosticsModulePtr diagnosticsModule=NULL)
 
AbstractChannelPtr getChannel ()
 Returns the channel this subscriber is attached to. More...
 
void attachChannel (ChannelType *channel)
 Attaches this subscriber to the specified channel. More...
 
virtual void detachChannel ()
 Detaches this subscriber from the channel. More...
 
virtual void run (DispatcherThread *dispatcher)
 Called from dispatcher thread this runnable is attached to, whenever the runnable should be executed. More...
 
virtual void signal ()
 Is called from the subscribed Channel whenever data changes. More...
 
virtual void unsignal ()
 
void enable (bool enabled)
 Enable or disable the subscriber. More...
 
bool isEnabled () const
 Returns if this subscriber is enabled. More...
 
DispatcherThreadgetDispatcher ()
 
void setDiagnosticsModule (DiagnosticsModulePtr module)
 
DiagnosticsModulePtr getDiagnosticsModule ()
 

Protected Attributes

DispatcherThreadmDispatcher
 
bool mEnabled
 Is the subscriber enabled. More...
 
DiagnosticsModulePtr mDiagnosticsModule
 

Detailed Description

template<typename T, typename ChannelRead>
class mira::ChannelSubscriber< T, ChannelRead >

Implements AbstractChannelSubscriber for a concrete data type.

For internals on the signaling process see Channel.

See Also
Channel

Member Typedef Documentation

Constructor & Destructor Documentation

ChannelSubscriber ( DispatcherThread dispatcher,
boost::function< void(ChannelRead)>  invokeFn,
DiagnosticsModulePtr  diagnosticsModule = NULL 
)
inline

Member Function Documentation

AbstractChannelPtr getChannel ( )
inlinevirtual

Returns the channel this subscriber is attached to.

Implements AbstractChannelSubscriber.

void attachChannel ( ChannelType channel)
inline

Attaches this subscriber to the specified channel.

This is called from Channel::addSubscriber.

virtual void detachChannel ( )
inlinevirtual

Detaches this subscriber from the channel.

Implements AbstractChannelSubscriber.

virtual void run ( DispatcherThread dispatcher)
inlinevirtual

Called from dispatcher thread this runnable is attached to, whenever the runnable should be executed.

Implements IRunnable.

virtual void signal ( )
virtualinherited

Is called from the subscribed Channel whenever data changes.

virtual void unsignal ( )
virtualinherited
void enable ( bool  enabled)
inlineinherited

Enable or disable the subscriber.

Disabled subscribers may not get informed upon changes in their subscribed channel.

bool isEnabled ( ) const
inlineinherited

Returns if this subscriber is enabled.

DispatcherThread* getDispatcher ( )
inlineinherited
void setDiagnosticsModule ( DiagnosticsModulePtr  module)
inlineinherited
DiagnosticsModulePtr getDiagnosticsModule ( )
inlineinherited

Member Data Documentation

DispatcherThread* mDispatcher
protectedinherited
bool mEnabled
protectedinherited

Is the subscriber enabled.

DiagnosticsModulePtr mDiagnosticsModule
protectedinherited

The documentation for this class was generated from the following file: