Library of Assembled Shared Sources
lass::util::CallbackR0< R > Class Template Reference

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

#include <callback_r_0.h>

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
 
 CallbackR0 (TSelf &&iOther) noexcept
 move constructor
 
TSelfoperator= (const TSelf &iOther)
 assignment operator
 
TSelfoperator= (TSelf &&iOther) noexcept
 move 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 bool () 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!
 

Related Symbols

(Note that these are not member symbols.)

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
 
template<typename ObjectPtr, typename Object, typename R>
CallbackR0< R > makeCallback (ObjectPtr iObject, R(Object::*iMethod)() const)
 make a CallbackR0 from a object and const 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: bram@.nosp@m.coca.nosp@m.mware.nosp@m..com)

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 90 of file callback_r_0.h.

Member Function Documentation

◆ operator()()

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

THE operator.

Executes the callback.

Definition at line 157 of file callback_r_0.h.

References isEmpty().


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