library of assembled shared sources

http://lass.cocamware.com

lass::util::Callback0 Class Reference
[Callback]

callback with 0 parameter(s) and without returnvalue. More...

#include <callback_0.h>


Public Types

typedef Callback0 TSelf
typedef SharedPtr
< impl::Dispatcher0
TDispatcherPtr

Public Member Functions

 Callback0 ()
 Default constructor, construct empty callback.
template<typename Function >
 Callback0 (Function iFunction)
 callback to function or other callable entity.
template<typename ObjectPtr , typename Method >
 Callback0 (ObjectPtr iObject, Method iMethod)
 callback to method of object
 Callback0 (const Callback0 &iOther)
 copy constructor
template<typename Other >
TSelfoperator= (const Other &iOther)
 assignment operator (also usable for conversion)
void 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.
bool operator== (const TSelf &iOther) const
 return true if two callbacks call the same function/method, NEEDS RTTI!

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.)

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


Detailed Description

callback with 0 parameter(s) and without 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 one parameter but gives no returnvalue.

Definition at line 83 of file callback_0.h.


Member Typedef Documentation

Definition at line 87 of file callback_0.h.

Definition at line 88 of file callback_0.h.


Constructor & Destructor Documentation

lass::util::Callback0::Callback0 (  )  [inline]

Default constructor, construct empty callback.

Definition at line 94 of file callback_0.h.

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

callback to function or other callable entity.

Definition at line 101 of file callback_0.h.

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

callback to method of object

Definition at line 109 of file callback_0.h.

lass::util::Callback0::Callback0 ( const Callback0 iOther  )  [inline]

copy constructor

Definition at line 116 of file callback_0.h.


Member Function Documentation

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

assignment operator (also usable for conversion)

Definition at line 128 of file callback_0.h.

References swap().

void lass::util::Callback0::operator() (  )  const [inline]

THE operator.

Executes the callback.

Definition at line 139 of file callback_0.h.

References dispatcher_, and isEmpty().

void lass::util::Callback0::reset (  )  [inline]

Reset to empty callback.

Definition at line 152 of file callback_0.h.

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

bool lass::util::Callback0::isEmpty (  )  const [inline]

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

Definition at line 159 of file callback_0.h.

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

Referenced by operator()().

bool lass::util::Callback0::operator! (  )  const [inline]

lass::util::Callback0::operator num::SafeBool (  )  const [inline]

void lass::util::Callback0::swap ( TSelf iOther  )  [inline]

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

Definition at line 180 of file callback_0.h.

References dispatcher_.

Referenced by operator=().

bool lass::util::Callback0::operator== ( const TSelf iOther  )  const [inline]

return true if two callbacks call the same function/method, NEEDS RTTI!

Definition at line 188 of file callback_0.h.

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

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

Definition at line 196 of file callback_0.h.

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

Definition at line 202 of file callback_0.h.


Friends And Related Function Documentation

bool operator!= ( const Callback0 iA,
const Callback0 iB 
) [related]

return true if two callbacks are different

Definition at line 215 of file callback_0.h.

Callback0 makeCallback ( void(*)()  iFunction  )  [related]

make a Callback0 from a function

Definition at line 225 of file callback_0.h.

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

make a Callback0 from a object and method

make a Callback0 from a object and const method

Definition at line 244 of file callback_0.h.


Field Documentation


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