66#ifndef LASS_GUARDIAN_OF_INCLUSION_UTIL_CALLBACK_1_H
67#define LASS_GUARDIAN_OF_INCLUSION_UTIL_CALLBACK_1_H
101 typedef SharedPtr< impl::Dispatcher1<P1> > TDispatcherPtr;
113 template <
typename FunctionType>
115 dispatcher_(new impl::Dispatcher1Function<P1, FunctionType>(iFunction))
121 template <
typename ObjectPtr,
typename Method>
123 dispatcher_(new impl::Dispatcher1Method<P1, 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)
const
167 dispatcher_->call(iP1);
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_;
247template <
typename P1>
inline
258template <
typename P1>
inline
269template <
typename ObjectPtr,
typename Object,
typename P1>
inline
280template <
typename ObjectPtr,
typename Object,
typename P1>
inline
292#define LASS_PRIM_HAVE_PY_EXPORT_TRAITS_CALLBACK_1
293#ifdef LASS_GUARDIAN_OF_INCLUSION_UTIL_CALLBACK_PYTHON_H
bool operator!=(const Callback1< P1 > &iA, const Callback1< P1 > &iB)
return true if two callbacks are different
const Callback1< P1 > & makeCallback(const Callback1< P1 > &iCallback)
make a Callback1 from a callback
TSelf & operator=(TSelf &&iOther) noexcept
move assignment operator
bool operator==(const TSelf &iOther) const
return true if two callbacks call the same function/method, NEEDS RTTI!
Callback1(ObjectPtr iObject, Method iMethod)
Construct object/method callback.
Callback1(FunctionType iFunction)
Construct function callback.
bool isEmpty() const
Returns true if no callback dispatcher is assigned to this object.
void operator()(typename util::CallTraits< P1 >::TParam iP1) const
THE operator.
Callback1< P1 > makeCallback(void(*iFunction)(P1))
make a Callback1 from a function
void reset()
Reset to empty callback.
Callback1(const TSelf &iOther)
copy constructor
Callback1(TSelf &&iOther) noexcept
move constructor
Callback1< P1 > makeCallback(ObjectPtr iObject, void(Object::*iMethod)(P1))
make a Callback1 from a object and method
Callback1()
Default constructor, construct empty callback.
TSelf & operator=(const TSelf &iOther)
assignment operator
Callback1< P1 > makeCallback(ObjectPtr iObject, void(Object::*iMethod)(P1) const)
make a Callback1 from a object and const method
bool operator!() const
return this->isEmpty()
void swap(TSelf &iOther)
Swaps the dispatcher of this callback with the dispatcher of another.
general utility, debug facilities, ...
Library for Assembled Shared Sources.