Xrb::SignalReceiverBase Class Reference

Base class for SignalReceiver*. More...

#include <xrb_signalhandler.hpp>

Inheritance diagram for Xrb::SignalReceiverBase:

Inheritance graph
[legend]

List of all members.

Public Member Functions

virtual ~SignalReceiverBase ()
 Boring destructor.
bool IsBlocking () const
 Callback blocking state accessor.
SignalHandlerOwner () const
 Accessor of the SignalHandler object which owns this SignalReceiver*. This object should be a member variable of its owner.
void SetIsBlocking (bool is_blocking)
 Signal blocking state modifier.
virtual void DetachAll () const =0
 Detaches all attached SignalSender*s.

Protected Member Functions

 SignalReceiverBase (SignalHandler *owner)
 Constructs a SignalReceiverBase object.


Detailed Description

Base class for SignalReceiver*.

Contains an interface method to detach all attachments, for use by SignalHandler.

Also provides the means to refer to differently template-typed subclasses via a common parent class (SignalHandler keeps a list of all of its added SignalReceiver*s).

A SignalReceiver subclass should be used as a member variable of the SignalHandler-derived class it is being used in. This is done to ensure that the life of the SignalReceiver coincides with the life of the SignalHandler (so that it is available to attach to during the entire life of the owning SignalHandler, and that it detaches all of its attachments precisely upon the destruction of its SignalHandler owner.

Note:
This should be used only by SignalHandler and SignalReceiver*.

Definition at line 482 of file xrb_signalhandler.hpp.


Constructor & Destructor Documentation

Xrb::SignalReceiverBase::SignalReceiverBase ( SignalHandler owner  )  [protected]

Constructs a SignalReceiverBase object.

Adds this SignalReceiver* object to the SignalHandler owner.

This constructor is protected so that SignalReceiverBase can only be used by subclassing it.

Parameters:
owner The SignalHandler that this SignalReceiverBase belongs to.

Definition at line 75 of file xrb_signalhandler.cpp.

References Xrb::SignalHandler::AddReceiver().


Member Function Documentation

bool Xrb::SignalReceiverBase::IsBlocking (  )  const [inline]

Callback blocking state accessor.

Returns:
True iff this SignalReceiver* is disallowing its callback to be called.

Definition at line 494 of file xrb_signalhandler.hpp.

SignalHandler* Xrb::SignalReceiverBase::Owner (  )  const [inline]

Accessor of the SignalHandler object which owns this SignalReceiver*. This object should be a member variable of its owner.

Returns:
The owning SignalHandler object.

Definition at line 503 of file xrb_signalhandler.hpp.

void Xrb::SignalReceiverBase::SetIsBlocking ( bool  is_blocking  )  [inline]

Signal blocking state modifier.

A SignalReceiver* can block callbacks on a per-SignalReceiver* basis. A SignalReceiver* that is blocked will not allow its callback method to be called.

Parameters:
is_blocking The callback blocking state to assign.

Definition at line 514 of file xrb_signalhandler.hpp.

virtual void Xrb::SignalReceiverBase::DetachAll (  )  const [pure virtual]

Detaches all attached SignalSender*s.

Causes the attached SignalSender*s to detach from this SignalReceiver.

Referenced by Xrb::SignalHandler::DetachAll().


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

Hosted by SourceForge.net Logo -- Generated on Fri Aug 21 21:46:39 2009 for XuqRijBuh by doxygen 1.5.8