MPD  0.20.18
Data Structures | Namespaces | Macros | Functions
BindMethod.hxx File Reference
#include <type_traits>
#include <utility>
Include dependency graph for BindMethod.hxx:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

class  BoundMethod< S >
 This object stores a function pointer wrapping a method, and a reference to an instance of the method's class. More...
 
class  BoundMethod< R(Args...)>
 
struct  BindMethodDetail::MethodWithSignature< T, S >
 Helper class which converts a signature type to a method pointer type. More...
 
struct  BindMethodDetail::MethodWithSignature< T, R(Args...)>
 
struct  BindMethodDetail::MethodSignatureHelper< M >
 Helper class which introspects a method pointer type. More...
 
struct  BindMethodDetail::MethodSignatureHelper< R(T::*)(Args...)>
 
struct  BindMethodDetail::MethodWrapperWithSignature< S >
 Helper class which converts a plain function signature type to a wrapper function pointer type. More...
 
struct  BindMethodDetail::MethodWrapperWithSignature< R(Args...)>
 
struct  BindMethodDetail::BindMethodWrapperGenerator2< T, M, method, R, Args >
 Generate a wrapper function. More...
 
struct  BindMethodDetail::BindMethodWrapperGenerator< T, M, method, S >
 Generate a wrapper function. More...
 
struct  BindMethodDetail::BindMethodWrapperGenerator< T, M, method, R(Args...)>
 

Namespaces

 BindMethodDetail
 

Macros

#define BIND_METHOD(instance, method)
 Shortcut macro which takes an instance and a method pointer and constructs a BoundMethod instance. More...
 
#define BIND_THIS_METHOD(method)   BIND_METHOD(*this, &std::remove_reference<decltype(*this)>::type::method)
 Shortcut wrapper for BIND_METHOD() which assumes "*this" is the instance to be bound. More...
 

Functions

template<typename T , typename S , typename MethodWithSignature< T, S >::method_pointer method>
MethodWrapperWithSignature< S >::function_pointer BindMethodDetail::MakeBindMethodWrapper ()
 
template<typename T , typename S , typename BindMethodDetail::MethodWithSignature< T, S >::method_pointer method>
constexpr BoundMethod< S > BindMethod (T &_instance)
 Construct a BoundMethod instance. More...
 

Macro Definition Documentation

◆ BIND_METHOD

#define BIND_METHOD (   instance,
  method 
)
Value:
BindMethod<typename BindMethodDetail::MethodSignatureHelper<decltype(method)>::class_type, \
method>(instance)
Instance * instance
Helper class which introspects a method pointer type.
Definition: BindMethod.hxx:105

Shortcut macro which takes an instance and a method pointer and constructs a BoundMethod instance.

Definition at line 198 of file BindMethod.hxx.

◆ BIND_THIS_METHOD

#define BIND_THIS_METHOD (   method)    BIND_METHOD(*this, &std::remove_reference<decltype(*this)>::type::method)

Shortcut wrapper for BIND_METHOD() which assumes "*this" is the instance to be bound.

Definition at line 207 of file BindMethod.hxx.

Function Documentation

◆ BindMethod()

template<typename T , typename S , typename BindMethodDetail::MethodWithSignature< T, S >::method_pointer method>
constexpr BoundMethod<S> BindMethod ( T &  _instance)

Construct a BoundMethod instance.

Parameters
Tthe containing class
Sthe plain function signature type
methodthe method pointer
instancethe instance of #T to be bound

Definition at line 188 of file BindMethod.hxx.