66#ifndef LASS_GUARDIAN_OF_INCLUSION_UTIL_CALLBACK_2_H
67#define LASS_GUARDIAN_OF_INCLUSION_UTIL_CALLBACK_2_H
94 typename P1,
typename P2
101 typedef SharedPtr< impl::Dispatcher2<P1, P2> > TDispatcherPtr;
113 template <
typename FunctionType>
115 dispatcher_(new impl::Dispatcher2Function<P1, P2, FunctionType>(iFunction))
121 template <
typename ObjectPtr,
typename Method>
123 dispatcher_(new impl::Dispatcher2Method<P1, P2, ObjectPtr, Method>(iObject, iMethod))
130 dispatcher_(iOther.dispatcher_)
137 dispatcher_(std::move(iOther.dispatcher_))
157 dispatcher_ = std::move(iOther.dispatcher_);
163 void operator()(
typename util::CallTraits<P1>::TParam iP1,
typename util::CallTraits<P2>::TParam iP2)
const
167 dispatcher_->call(iP1, iP2);
185 return dispatcher_.isEmpty();
192 return dispatcher_.isEmpty();
197 explicit operator bool()
const
199 return !dispatcher_.isEmpty() ;
206 dispatcher_.swap(iOther.dispatcher_);
214 if (dispatcher_ == iOther.dispatcher_)
218 return dispatcher_ && dispatcher_->isEquivalent(iOther.dispatcher_.get());
221 const TDispatcherPtr& dispatcher()
const
228 TDispatcherPtr dispatcher_;
236template<
typename P1,
typename P2>
247template <
typename P1,
typename P2>
inline
258template <
typename P1,
typename P2>
inline
269template <
typename ObjectPtr,
typename Object,
typename P1,
typename P2>
inline
280template <
typename ObjectPtr,
typename Object,
typename P1,
typename P2>
inline
292#define LASS_PRIM_HAVE_PY_EXPORT_TRAITS_CALLBACK_2
293#ifdef LASS_GUARDIAN_OF_INCLUSION_UTIL_CALLBACK_PYTHON_H
Callback2< P1, P2 > makeCallback(void(*iFunction)(P1, P2))
make a Callback2 from a function
Callback2(const TSelf &iOther)
copy constructor
const Callback2< P1, P2 > & makeCallback(const Callback2< P1, P2 > &iCallback)
make a Callback2 from a callback
Callback2(ObjectPtr iObject, Method iMethod)
Construct object/method callback.
TSelf & operator=(const TSelf &iOther)
assignment operator
bool operator==(const TSelf &iOther) const
return true if two callbacks call the same function/method, NEEDS RTTI!
bool operator!=(const Callback2< P1, P2 > &iA, const Callback2< P1, P2 > &iB)
return true if two callbacks are different
TSelf & operator=(TSelf &&iOther) noexcept
move assignment operator
bool operator!() const
return this->isEmpty()
Callback2(TSelf &&iOther) noexcept
move constructor
Callback2< P1, P2 > makeCallback(ObjectPtr iObject, void(Object::*iMethod)(P1, P2))
make a Callback2 from a object and method
void reset()
Reset to empty callback.
Callback2< P1, P2 > makeCallback(ObjectPtr iObject, void(Object::*iMethod)(P1, P2) const)
make a Callback2 from a object and const method
bool isEmpty() const
Returns true if no callback dispatcher is assigned to this object.
Callback2(FunctionType iFunction)
Construct function callback.
void operator()(typename util::CallTraits< P1 >::TParam iP1, typename util::CallTraits< P2 >::TParam iP2) const
THE operator.
Callback2()
Default constructor, construct empty callback.
void swap(TSelf &iOther)
Swaps the dispatcher of this callback with the dispatcher of another.
general utility, debug facilities, ...
Library for Assembled Shared Sources.