callbacks.hpp   callbacks.hpp 
skipping to change at line 24 skipping to change at line 24
// 2) Sprinkled the code with typename keywords for gcc. // 2) Sprinkled the code with typename keywords for gcc.
// 3) Renamed unused unused_arg. // 3) Renamed unused unused_arg.
// 4) Method ctors no longer require raw pointers. // 4) Method ctors no longer require raw pointers.
// 21 Nov 2000 collapsed callback0, callback1, callback2 into one class // 21 Nov 2000 collapsed callback0, callback1, callback2 into one class
// (this was inspired by Doug Gregor's callback classes) // (this was inspired by Doug Gregor's callback classes)
// 18 Nov 2000 Initial version // 18 Nov 2000 Initial version
#ifndef _CALLBACKS_HPP_ #ifndef _CALLBACKS_HPP_
#define _CALLBACKS_HPP_ #define _CALLBACKS_HPP_
#include <cassert> #include <QtGlobal>
#include "callback_helpers.hpp" #include "callback_helpers.hpp"
namespace boost { namespace boost {
// ======================================================================== ======= // ======================================================================== =======
// class callback // class callback
// ======================================================================== ======= // ======================================================================== =======
template <typename RETURN_TYPE, typename ARG1 = details::unused_arg, typena me ARG2 = details::unused_arg> template <typename RETURN_TYPE, typename ARG1 = details::unused_arg, typena me ARG2 = details::unused_arg>
class callback { class callback {
skipping to change at line 74 skipping to change at line 74
} }
callback(const callback& rhs) {if (rhs.mF unctor != 0) rhs.mFunctor->AddReference(); mFunctor = rhs.mFunctor;} callback(const callback& rhs) {if (rhs.mF unctor != 0) rhs.mFunctor->AddReference(); mFunctor = rhs.mFunctor;}
callback& operator=(const callback& rhs) {if (mFunct or != rhs.mFunctor) {if (rhs.mFunctor != 0) rhs.mFunctor->AddReference(); i f (mFunctor != 0) mFunctor->RemoveReference(); mFunctor = rhs.mFunctor;} re turn *this;} callback& operator=(const callback& rhs) {if (mFunct or != rhs.mFunctor) {if (rhs.mFunctor != 0) rhs.mFunctor->AddReference(); i f (mFunctor != 0) mFunctor->RemoveReference(); mFunctor = rhs.mFunctor;} re turn *this;}
//----------------------------------- //-----------------------------------
// API // API
// //
public: public:
RETURN_TYPE operator()() const {assert(mFu RETURN_TYPE operator()() const {Q_ASSERT(m
nctor != 0); return mFunctor->Call();} Functor != 0); return mFunctor->Call();}
RETURN_TYPE operator()(ARG1 arg1) const {assert(mFu RETURN_TYPE operator()(ARG1 arg1) const {Q_ASSERT(m
nctor != 0); return mFunctor->Call(arg1);} Functor != 0); return mFunctor->Call(arg1);}
RETURN_TYPE operator()(ARG1 arg1, ARG2 arg2) const {assert(mFu RETURN_TYPE operator()(ARG1 arg1, ARG2 arg2) const {Q_ASSERT(m
nctor != 0); return mFunctor->Call(arg1, arg2);} Functor != 0); return mFunctor->Call(arg1, arg2);}
// $$$ use boost::call_traits for the args? // $$$ use boost::call_traits for the args?
bool empty() const {return mFu nctor == 0;} bool empty() const {return mFu nctor == 0;}
//----------------------------------- //-----------------------------------
// Member Data // Member Data
// //
private: private:
Functor* mFunctor; Functor* mFunctor;
}; };
 End of changes. 2 change blocks. 
7 lines changed or deleted 7 lines changed or added

This html diff was produced by rfcdiff 1.41. The latest version is available from http://tools.ietf.org/tools/rfcdiff/