Dillo
|
The base class for signal emitters. More...
#include <signal.hh>
Public Member Functions | |
Emitter () | |
~Emitter () | |
void | intoStringBuffer (misc::StringBuffer *sb) |
Store a textual representation of the object in a misc::StringBuffer. More... | |
Public Member Functions inherited from lout::object::Object | |
virtual | ~Object () |
The destructor is defined as virtual (but not abstract), so that destruction of Object's works properly. More... | |
virtual bool | equals (Object *other) |
Returns, whether two objects are equal. More... | |
virtual int | hashValue () |
Return a hash value for the object. More... | |
virtual Object * | clone () |
Return an exact copy of the object. More... | |
const char * | toString () |
Use object::Object::intoStringBuffer to return a textual representation of the object. More... | |
virtual size_t | sizeOf () |
Return the number of bytes, this object totally uses. More... | |
Protected Member Functions | |
void | emitVoid (int signalNo, int argc, Object **argv) |
Emit a void signal. More... | |
bool | emitBool (int signalNo, int argc, Object **argv) |
Emit a boolean signal. More... | |
void | connect (Receiver *receiver) |
Connect a receiver to the emitter. More... | |
virtual bool | emitToReceiver (Receiver *receiver, int signalNo, int argc, Object **argv)=0 |
A sub class must implement this for a call to a single receiver. More... | |
Private Member Functions | |
void | unconnect (Receiver *receiver) |
Private Attributes | |
container::typed::List < Receiver > * | receivers |
Friends | |
class | Receiver |
The base class for signal emitters.
If defining a signal group, a sub class of this class must be defined, with
There are two representations of signals:
In the unfolded representation, the signal itself is represented by the method itself (in the emitter or the receiver), and the arguments are represented as normal C++ types.
lout::signal::Emitter::Emitter | ( | ) |
lout::signal::Emitter::~Emitter | ( | ) |
|
protected |
Connect a receiver to the emitter.
This is protected, a sub class should define a wrapper, with the respective receiver as an argument, to gain type safety.
References lout::signal::Receiver::connectTo().
Referenced by dw::core::ui::Resource::ActivateEmitter::connectActivate(), dw::core::ui::Resource::ClickedEmitter::connectClicked(), lout::signal::ObservedObject::DeletionEmitter::connectDeletion(), dw::core::Layout::Emitter::connectLayout(), and dw::core::Layout::LinkEmitter::connectLink().
|
protected |
Emit a boolean signal.
This method should be called by a wrapper, which folds the signal, delegates the emission to here, and returns the same boolean value.
References lout::container::typed::Iterator< T >::hasNext().
|
protectedpure virtual |
A sub class must implement this for a call to a single receiver.
This methods gets the signal in a folded representation, it has to unfold it, and pass it to a single receiver. For boolean signals, the return value of the receiver must be returned, for void signals, the return value is discarded.
Implemented in dw::core::ui::Resource::ClickedEmitter, dw::core::ui::Resource::ActivateEmitter, lout::signal::ObservedObject::DeletionEmitter, dw::core::Layout::Emitter, and dw::core::Layout::LinkEmitter.
|
protected |
Emit a void signal.
This method should be called by a wrapper (return value void), which folds the signal, and delegates the emission to here.
References lout::container::typed::Iterator< T >::hasNext().
|
virtual |
Store a textual representation of the object in a misc::StringBuffer.
This is used by object::Object::toString.
Reimplemented from lout::object::Object.
References lout::misc::StringBuffer::append().
|
private |
Referenced by lout::signal::Receiver::~Receiver().
|
friend |
|
private |