MIRA
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

◆ ChannelType

Constructor & Destructor Documentation

◆ ChannelSubscriber()

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

Member Function Documentation

◆ getChannel()

AbstractChannelPtr getChannel ( )
inlinevirtual

Returns the channel this subscriber is attached to.

Implements AbstractChannelSubscriber.

◆ attachChannel()

void attachChannel ( ChannelType channel)
inline

Attaches this subscriber to the specified channel.

This is called from Channel::addSubscriber.

◆ detachChannel()

virtual void detachChannel ( )
inlinevirtual

Detaches this subscriber from the channel.

Implements AbstractChannelSubscriber.

◆ run()

virtual void run ( DispatcherThread dispatcher)
inlinevirtual

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

Implements IRunnable.

◆ signal()

virtual void signal ( )
virtualinherited

Is called from the subscribed Channel whenever data changes.

◆ unsignal()

virtual void unsignal ( )
virtualinherited

◆ enable()

void enable ( bool  enabled)
inlineinherited

Enable or disable the subscriber.

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

◆ isEnabled()

bool isEnabled ( ) const
inlineinherited

Returns if this subscriber is enabled.

◆ getDispatcher()

DispatcherThread* getDispatcher ( )
inlineinherited

◆ setDiagnosticsModule()

void setDiagnosticsModule ( DiagnosticsModulePtr  module)
inlineinherited

◆ getDiagnosticsModule()

DiagnosticsModulePtr getDiagnosticsModule ( )
inlineinherited

Member Data Documentation

◆ mDispatcher

DispatcherThread* mDispatcher
protectedinherited

◆ mEnabled

bool mEnabled
protectedinherited

Is the subscriber enabled.

◆ mDiagnosticsModule

DiagnosticsModulePtr mDiagnosticsModule
protectedinherited

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