Webmaster  |  Imprint 
Platinum
Platinum C++ Framework
Main  |  License  |  Documentation  |  Download  |  Support 

Delegate Class Template Reference

Connects to one slot and handle return value. More...

#include <Pt/Delegate.h>

Inheritance diagram for Delegate:

Connectable

List of all members.

Public Member Functions

 Delegate ()
 Default Constructor.
 Delegate (const Delegate &rhs)
 Deeply copies the other Delegate.
Connection connect (const BasicSlot< R, ARGUMENTS > &slot)
 Connects this object to the given slot and returns that Connection.
call (ARGUMENTS) const
 Calls the slot connected to the Delegate.
void invoke (ARGUMENTS) const
 Invoke the slot connected to the Delegate.
operator() (ARGUMENTS) const
 Same as Delegatecall().


Detailed Description

template<typename R, ARGUMENTS>
class Pt::Delegate< R, >

Delegates can only be connected to one slot, but have the advantage that they return the return value of the connected slot when called. There are partial specializations of this class template for up to ten arguments.

Member Function Documentation

R call ( ARGUMENTS   )  const

Passes on all arguments to the connected slot and returns the return value of that slot. If no slot is connect then an exception is thrown.

void invoke ( ARGUMENTS   )  const

Passes on all arguments to the connected slot and ignores the return value. If No slot is connected, the call is silently ignored.

Copyright © 2003-2007 The Pt Development Team
Pt 1.0