swift
Public Member Functions | List of all members
swift::misc::CSlot< R(Args...)> Class Template Reference

Callable wrapper for a member function with function signature R(Args...). More...

Public Member Functions

 CSlot ()=default
 Construct an empty slot.
 
template<typename T , typename U >
 CSlot (T *object, R(U::*function)(Args...))
 Construct a slot from the given member function of the given object.
 
template<typename T >
 CSlot (T *object, std::function< R(Args...)> function)
 Construct a slot from the given object passing a function and a object.
 
operator() (Args... args) const
 Call the slot. The behaviour is undefined if the slot is empty.
 
bool singleShot (Args... args) const
 Call function "de-coupled" in original thread.
 
QObjectobject () const
 Returns the object which the slot belongs to. Use this as the third argument to QObject::connect to ensure the slot is called in the correct thread.
 
void setObject (QObject *object)
 Set the object which the slot belongs to. Use this as the third argument to QObject::connect to ensure the slot is called in the correct thread.
 
 operator bool () const
 True if the slot can be called, false if it is empty.
 
bool operator! () const
 True if the slot is empty or object is null, false if it can be called.
 
bool isEmpty () const
 True if the slot is empty, false if it can be called.
 
bool hasNullObject () const
 True if the object is null.
 

Detailed Description

template<typename R, typename... Args>
class swift::misc::CSlot< R(Args...)>

Callable wrapper for a member function with function signature R(Args...).

Allows for easy manipulation of slots to be used as callbacks.

Definition at line 69 of file slot.h.


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