MIRA
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
AbstractChannelSubscriber Class Referenceabstract

#include <fw/AbstractChannelSubscriber.h>

Inheritance diagram for AbstractChannelSubscriber:
Inheritance graph
[legend]

Public Member Functions

 AbstractChannelSubscriber (DispatcherThread *dispatcher, DiagnosticsModulePtr diagnosticsModule)
 Constructs a subscriber and enables it by default. More...
 
virtual ~AbstractChannelSubscriber ()
 
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...
 
virtual AbstractChannelgetChannel ()=0
 Returns the channel we are subscribed on, or NULL otherwise. More...
 
virtual void detachChannel ()=0
 Is called by AbstractChannel::removeSubscriber() when the subscriber detaches from the channel it is subscribed on. More...
 
DispatcherThreadgetDispatcher ()
 
void setDiagnosticsModule (DiagnosticsModulePtr module)
 
DiagnosticsModulePtr getDiagnosticsModule ()
 

Protected Member Functions

virtual void run (DispatcherThread *dispatcher)=0
 Called from dispatcher thread this runnable is attached to, whenever the runnable should be executed. More...
 

Protected Attributes

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

Detailed Description

Abstract base class for all typed ChannelSubscriber. This base class is used by SubscriberHandler to store different ChannelSubscriber within the same queue.

Constructor & Destructor Documentation

◆ AbstractChannelSubscriber()

AbstractChannelSubscriber ( DispatcherThread dispatcher,
DiagnosticsModulePtr  diagnosticsModule 
)
inline

Constructs a subscriber and enables it by default.

◆ ~AbstractChannelSubscriber()

virtual ~AbstractChannelSubscriber ( )
inlinevirtual

Member Function Documentation

◆ signal()

virtual void signal ( )
virtual

Is called from the subscribed Channel whenever data changes.

◆ unsignal()

virtual void unsignal ( )
virtual

◆ enable()

void enable ( bool  enabled)
inline

Enable or disable the subscriber.

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

◆ isEnabled()

bool isEnabled ( ) const
inline

Returns if this subscriber is enabled.

◆ getChannel()

virtual AbstractChannel* getChannel ( )
pure virtual

Returns the channel we are subscribed on, or NULL otherwise.

Implemented in ChannelSubscriber< T, ChannelRead >.

◆ detachChannel()

virtual void detachChannel ( )
pure virtual

Is called by AbstractChannel::removeSubscriber() when the subscriber detaches from the channel it is subscribed on.

Implemented in ChannelSubscriber< T, ChannelRead >.

◆ getDispatcher()

DispatcherThread* getDispatcher ( )
inline

◆ setDiagnosticsModule()

void setDiagnosticsModule ( DiagnosticsModulePtr  module)
inlineinherited

◆ getDiagnosticsModule()

DiagnosticsModulePtr getDiagnosticsModule ( )
inlineinherited

◆ run()

virtual void run ( DispatcherThread dispatcher)
protectedpure virtualinherited

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

Implemented in DispatcherThread::Timer, FunctionRunnable< F >, ChannelSubscriber< T, ChannelRead >, ServiceInterfaceHandler, and RPCHandler::InvokerRunnable.

Member Data Documentation

◆ mDispatcher

DispatcherThread* mDispatcher
protected

◆ mEnabled

bool mEnabled
protected

Is the subscriber enabled.

◆ mDiagnosticsModule

DiagnosticsModulePtr mDiagnosticsModule
protectedinherited

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