Jive reference manual
List of all members | Public Member Functions | Protected Member Functions
jem::util::AbstractDelegate Class Referenceabstract

Provides a superclass for all delegate types. More...

#include <jem/util/event/AbstractDelegate.h>

Inheritance diagram for jem::util::AbstractDelegate:
Inheritance graph

Public Member Functions

virtual bool isConnected () const =0
 Tests whether the delegate represented by this instance still exists. More...
 
virtual bool equals (AbstractDelegate *rhs) const =0
 Tests whether this delegate is equal to another delegate. More...
 

Protected Member Functions

virtual ~AbstractDelegate ()
 Protected destructor. More...
 

Detailed Description

The AbstractDelegate class is the superclass of all delegate types. This class exists for implementation purposes only; you will never have to deal with this class directly. You only have to deal with this class indirectly when you implement your own delegate type.

See also
Delegate, Event.

Constructor & Destructor Documentation

virtual jem::util::AbstractDelegate::~AbstractDelegate ( )
protectedvirtual

The destructor of the AbstractDelegate class is declared protected because only an Event should be able to delete an instance of the AbstractDelegate class. This is to avoid situations in which an AbstractDelegate is deleted more than once.

Classes derived from the AbstractDelegate class should also declare their destructor protected.

Member Function Documentation

virtual bool jem::util::AbstractDelegate::isConnected ( ) const
pure virtual

Tests whether the delegate represented by this AbstractDelegate instance still exists.

Returns
true if the delegate still exists, and false otherwise.

Implemented in jem::util::Delegate< Args >.

virtual bool jem::util::AbstractDelegate::equals ( AbstractDelegate rhs) const
pure virtual

Tests whether the delegate represented by this AbstractDelegate instance is equal to the delegate represented by the AbstractDelegate instance rhs.

This function is primarily used to disconnect delegates from events.

Parameters
rhs- an AbstractDelegate instance.
Returns
true if this delegate equals the delegate rhs, and false otherwise.