library of assembled shared sources

http://lass.cocamware.com

lass::util::CallbackR0< R > Class Template Reference
[Callback]

callback with 0 parameters but with returnvalue. More...

#include <callback_r_0.h>


Public Types

typedef CallbackR0< R > TSelf
typedef SharedPtr
< impl::DispatcherR0< R > > 
TDispatcherPtr

Public Member Functions

 CallbackR0 ()
 Default constructor, construct empty callback.
template<typename Function >
 CallbackR0 (Function iFunction)
 Construct function callback.
template<typename ObjectPtr , typename Method >
 CallbackR0 (ObjectPtr iObject, Method iMethod)
 Construct object/method callback.
 CallbackR0 (const TSelf &iOther)
 copy constructor
template<typename Other >
TSelfoperator= (const Other &iOther)
 assignment operator
operator() () const
 THE operator.
void reset ()
 Reset to empty callback.
bool isEmpty () const
 Returns true if no callback dispatcher is assigned to this object.
bool operator! () const
 return this->isEmpty()
 operator num::SafeBool () const
 return !this->isEmpty())
void swap (TSelf &iOther)
 Swaps the dispatcher of this callback with the dispatcher of another.

Static Private Member Functions

template<typename Function >
static TDispatcherPtr make (Function iFunction, meta::Wrap< meta::False >)
template<typename Dispatcher >
static TDispatcherPtr make (Dispatcher iDispatcher, meta::Wrap< meta::True >)

Private Attributes

TDispatcherPtr dispatcher_

Related Functions

(Note that these are not member functions.)

template<typename R >
bool operator!= (const CallbackR0< R > &iA, const CallbackR0< R > &iB)
 return true if two callbacks are different
template<typename R >
CallbackR0< R > makeCallback (R(*iFunction)())
 make a CallbackR0 from a function
template<typename R >
const CallbackR0< R > & makeCallback (const CallbackR0< R > &iCallback)
 make a CallbackR0 from a callback
template<typename ObjectPtr , typename Object , typename R >
CallbackR0< R > makeCallback (ObjectPtr iObject, R(Object::*iMethod)())
 make a CallbackR0 from a object and method


Detailed Description

template<typename R>
class lass::util::CallbackR0< R >

callback with 0 parameters but with returnvalue.

Date:
2002
Author:
Bram de Greve [Bramz] (contact: bramz@users.sourceforge.net)
It's a single object that can hold a reference to a free function or an object/(const) method pair. Once the callback is constructed, it works completely transparent. All it shows to the client is a function that takes 0 parameter(s) and gives a returnvalue.

Definition at line 89 of file callback_r_0.h.


Member Typedef Documentation

template<typename R >
typedef CallbackR0<R> lass::util::CallbackR0< R >::TSelf

Definition at line 93 of file callback_r_0.h.

template<typename R >
typedef SharedPtr< impl::DispatcherR0<R> > lass::util::CallbackR0< R >::TDispatcherPtr

Definition at line 94 of file callback_r_0.h.


Constructor & Destructor Documentation

template<typename R >
lass::util::CallbackR0< R >::CallbackR0 (  )  [inline]

Default constructor, construct empty callback.

Definition at line 100 of file callback_r_0.h.

template<typename R >
template<typename Function >
lass::util::CallbackR0< R >::CallbackR0 ( Function  iFunction  )  [inline]

Construct function callback.

Definition at line 107 of file callback_r_0.h.

template<typename R >
template<typename ObjectPtr , typename Method >
lass::util::CallbackR0< R >::CallbackR0 ( ObjectPtr  iObject,
Method  iMethod 
) [inline]

Construct object/method callback.

Definition at line 115 of file callback_r_0.h.

template<typename R >
lass::util::CallbackR0< R >::CallbackR0 ( const TSelf iOther  )  [inline]

copy constructor

Definition at line 122 of file callback_r_0.h.


Member Function Documentation

template<typename R >
template<typename Other >
TSelf& lass::util::CallbackR0< R >::operator= ( const Other &  iOther  )  [inline]

assignment operator

Definition at line 134 of file callback_r_0.h.

References lass::util::CallbackR0< R >::swap().

template<typename R >
R lass::util::CallbackR0< R >::operator() (  )  const [inline]

THE operator.

Executes the callback.

Definition at line 143 of file callback_r_0.h.

References lass::util::CallbackR0< R >::dispatcher_, lass::util::CallbackR0< R >::isEmpty(), and LASS_THROW_EX.

template<typename R >
void lass::util::CallbackR0< R >::reset (  )  [inline]

template<typename R >
bool lass::util::CallbackR0< R >::isEmpty (  )  const [inline]

Returns true if no callback dispatcher is assigned to this object.

Definition at line 164 of file callback_r_0.h.

References lass::util::CallbackR0< R >::dispatcher_, and lass::util::SharedPtr< T, StoragePolicy, CounterPolicy >::isEmpty().

Referenced by lass::util::CallbackR0< R >::operator()().

template<typename R >
bool lass::util::CallbackR0< R >::operator! (  )  const [inline]

template<typename R >
lass::util::CallbackR0< R >::operator num::SafeBool (  )  const [inline]

template<typename R >
void lass::util::CallbackR0< R >::swap ( TSelf iOther  )  [inline]

Swaps the dispatcher of this callback with the dispatcher of another.

Definition at line 185 of file callback_r_0.h.

References lass::util::CallbackR0< R >::dispatcher_.

Referenced by lass::util::CallbackR0< R >::operator=().

template<typename R >
template<typename Function >
static TDispatcherPtr lass::util::CallbackR0< R >::make ( Function  iFunction,
meta::Wrap< meta::False  
) [inline, static, private]

Definition at line 193 of file callback_r_0.h.

template<typename R >
template<typename Dispatcher >
static TDispatcherPtr lass::util::CallbackR0< R >::make ( Dispatcher  iDispatcher,
meta::Wrap< meta::True  
) [inline, static, private]

Definition at line 199 of file callback_r_0.h.


Friends And Related Function Documentation

template<typename R >
bool operator!= ( const CallbackR0< R > &  iA,
const CallbackR0< R > &  iB 
) [related]

return true if two callbacks are different

Definition at line 213 of file callback_r_0.h.

template<typename R >
CallbackR0< R > makeCallback ( R(*)()  iFunction  )  [related]

make a CallbackR0 from a function

Definition at line 224 of file callback_r_0.h.

template<typename R >
const CallbackR0< R > & makeCallback ( const CallbackR0< R > &  iCallback  )  [related]

make a CallbackR0 from a callback

Definition at line 235 of file callback_r_0.h.

template<typename ObjectPtr , typename Object , typename R >
CallbackR0< R > makeCallback ( ObjectPtr  iObject,
R(Object::*)()  iMethod 
) [related]

make a CallbackR0 from a object and method

make a CallbackR0 from a object and const method

Definition at line 246 of file callback_r_0.h.


Field Documentation

template<typename R >
TDispatcherPtr lass::util::CallbackR0< R >::dispatcher_ [private]


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

Generated on Mon Nov 10 14:22:16 2008 for Library of Assembled Shared Sources by doxygen 1.5.7.1
SourceForge.net Logo