Dillo
Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes | Friends | List of all members
lout::signal::Emitter Class Referenceabstract

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 Objectclone ()
 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
 

Detailed Description

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:

See also
signal

Constructor & Destructor Documentation

lout::signal::Emitter::Emitter ( )
lout::signal::Emitter::~Emitter ( )

Member Function Documentation

void lout::signal::Emitter::connect ( Receiver receiver)
protected
bool lout::signal::Emitter::emitBool ( int  signalNo,
int  argc,
Object **  argv 
)
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().

virtual bool lout::signal::Emitter::emitToReceiver ( Receiver receiver,
int  signalNo,
int  argc,
Object **  argv 
)
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.

void lout::signal::Emitter::emitVoid ( int  signalNo,
int  argc,
Object **  argv 
)
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().

void lout::signal::Emitter::intoStringBuffer ( misc::StringBuffer sb)
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().

void lout::signal::Emitter::unconnect ( Receiver receiver)
private

Friends And Related Function Documentation

friend class Receiver
friend

Member Data Documentation

container::typed::List<Receiver>* lout::signal::Emitter::receivers
private

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