57#ifndef LASS_GUARDIAN_OF_INCLUSION_UTIL_CALLBACK_0_H
58#define LASS_GUARDIAN_OF_INCLUSION_UTIL_CALLBACK_0_H
88 typedef SharedPtr<impl::Dispatcher0> TDispatcherPtr;
100 template <
typename Function>
102 dispatcher_(make(iFunction,
meta::Wrap<typename
meta::IsDerived<Function, impl::Dispatcher0>::Type>()))
108 template <
typename ObjectPtr,
typename Method>
110 dispatcher_(new impl::Dispatcher0Method<ObjectPtr, Method>(iObject, iMethod))
117 dispatcher_(iOther.dispatcher_)
124 dispatcher_(std::move(iOther.dispatcher_))
144 dispatcher_ = std::move(iOther.dispatcher_);
172 return dispatcher_.isEmpty();
179 return dispatcher_.isEmpty();
184 explicit operator bool()
const
186 return !dispatcher_.isEmpty();
193 dispatcher_.swap(iOther.dispatcher_);
201 if (dispatcher_ == iOther.dispatcher_)
205 return dispatcher_ && dispatcher_->isEquivalent(iOther.dispatcher_.get());
208 const TDispatcherPtr& dispatcher()
const
215 template <
typename Function>
216 static TDispatcherPtr make(Function iFunction, meta::Wrap<meta::False>)
218 return TDispatcherPtr(
new impl::Dispatcher0Function<Function>(iFunction));
221 template <
typename Dispatcher>
222 static TDispatcherPtr make(Dispatcher iDispatcher, meta::Wrap<meta::True>)
224 return TDispatcherPtr(
new Dispatcher(iDispatcher));
227 TDispatcherPtr dispatcher_;
263template <
typename ObjectPtr,
typename Object>
inline
274template <
typename ObjectPtr,
typename Object>
inline
286#define LASS_PRIM_HAVE_PY_EXPORT_TRAITS_CALLBACK_0
287#ifdef LASS_GUARDIAN_OF_INCLUSION_UTIL_CALLBACK_PYTHON_H
callback with 0 parameter(s) and without returnvalue.
Callback0 makeCallback(void(*iFunction)())
make a Callback0 from a function
bool isEmpty() const
Returns true if no callback dispatcher is assigned to this object.
Callback0 makeCallback(ObjectPtr iObject, void(Object::*iMethod)())
make a Callback0 from a object and method
TSelf & operator=(TSelf &&iOther) noexcept
move assignment operator
Callback0(const Callback0 &iOther)
copy constructor
TSelf & operator=(const TSelf &iOther)
assignment operator
Callback0(Function iFunction)
callback to function or other callable entity.
bool operator==(const TSelf &iOther) const
return true if two callbacks call the same function/method, NEEDS RTTI!
bool operator!=(const Callback0 &iA, const Callback0 &iB)
return true if two callbacks are different
Callback0 makeCallback(ObjectPtr iObject, void(Object::*iMethod)() const)
make a Callback0 from a object and const method
Callback0()
Default constructor, construct empty callback.
Callback0(ObjectPtr iObject, Method iMethod)
callback to method of object
Callback0(Callback0 &&iOther) noexcept
move constructor
void operator()() const
THE operator.
bool operator!() const
return this->isEmpty()
void swap(TSelf &iOther)
Swaps the dispatcher of this callback with the dispatcher of another.
void reset()
Reset to empty callback.
general utility, debug facilities, ...
const Callback0 & makeCallback(const Callback0 &iCallback)
convencie function, make callback from callback
Library for Assembled Shared Sources.