#include <xrb_signalhandler.hpp>
Public Member Functions | |
virtual | ~SignalReceiverBase () |
Boring destructor. | |
bool | IsBlocking () const |
Callback blocking state accessor. | |
SignalHandler * | Owner () 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. |
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.
Definition at line 482 of file xrb_signalhandler.hpp.
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.
owner | The SignalHandler that this SignalReceiverBase belongs to. |
Definition at line 75 of file xrb_signalhandler.cpp.
References Xrb::SignalHandler::AddReceiver().
bool Xrb::SignalReceiverBase::IsBlocking | ( | ) | const [inline] |
Callback blocking state accessor.
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.
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.
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().