MADNESS  0.10.1
Public Types | Public Member Functions | Private Attributes | Friends | List of all members
madness::detail::MemFuncWrapper< ptrT, memfnT, resT > Class Template Reference

Functor wrapper for object and member function pointers. More...

#include <mem_func_wrapper.h>

Public Types

typedef memfnT memfn_type
 Alias for the type of the member function pointer. More...
 
typedef MemFuncWrapper< ptrT, memfnT, void > MemFuncWrapper_
 Alias for a wrapper that returns void. More...
 
typedef resT result_type
 Alias for the function's result type. More...
 

Public Member Functions

 MemFuncWrapper ()
 Constructor that sets the pointer to the default value from DefaultInitPtr<ptrT>. More...
 
 MemFuncWrapper (const MemFuncWrapper_ &other)
 Copy constructor that copies the object pointer and member function pointer. More...
 
 MemFuncWrapper (ptrT ptr, memfnT memfn)
 Constructs a wrapper from an object pointer and a member function pointer. More...
 
template<typename... argTs>
result_type operator() (argTs &&... args) const
 Evaluates the member function, when dereferenced from the object pointer. More...
 
MemFuncWrapper_operator= (const MemFuncWrapper_ &other)
 
template<typename Archive >
void serialize (const Archive &ar)
 Serializes a MemFuncWrapper. More...
 

Private Attributes

memfnT memfn_
 Member function of the object's type. More...
 
ptrT ptr_
 Pointer to the object. More...
 

Friends

memfnT get_mem_func_ptr (const MemFuncWrapper< ptrT, memfnT, resT > &)
 Returns the member function pointer from a wrapper. More...
 
memfnT get_mem_func_ptr (const MemFuncWrapper_ &wrapper)
 

Detailed Description

template<typename ptrT, typename memfnT, typename resT>
class madness::detail::MemFuncWrapper< ptrT, memfnT, resT >

Functor wrapper for object and member function pointers.

This class encapsulates a pointer to an object and a member pointer to a function of that object's type.

Template Parameters
ptrTPointer type.
memfnTMember function pointer type.
resTResult type of the member function.

Member Typedef Documentation

◆ memfn_type

template<typename ptrT , typename memfnT , typename resT >
typedef memfnT madness::detail::MemFuncWrapper< ptrT, memfnT, resT >::memfn_type

Alias for the type of the member function pointer.

◆ MemFuncWrapper_

template<typename ptrT , typename memfnT , typename resT >
typedef MemFuncWrapper<ptrT, memfnT, void> madness::detail::MemFuncWrapper< ptrT, memfnT, resT >::MemFuncWrapper_

Alias for a wrapper that returns void.

◆ result_type

template<typename ptrT , typename memfnT , typename resT >
typedef resT madness::detail::MemFuncWrapper< ptrT, memfnT, resT >::result_type

Alias for the function's result type.

Constructor & Destructor Documentation

◆ MemFuncWrapper() [1/3]

template<typename ptrT , typename memfnT , typename resT >
madness::detail::MemFuncWrapper< ptrT, memfnT, resT >::MemFuncWrapper ( )
inline

Constructor that sets the pointer to the default value from DefaultInitPtr<ptrT>.

◆ MemFuncWrapper() [2/3]

template<typename ptrT , typename memfnT , typename resT >
madness::detail::MemFuncWrapper< ptrT, memfnT, resT >::MemFuncWrapper ( const MemFuncWrapper_ other)
inline

Copy constructor that copies the object pointer and member function pointer.

◆ MemFuncWrapper() [3/3]

template<typename ptrT , typename memfnT , typename resT >
madness::detail::MemFuncWrapper< ptrT, memfnT, resT >::MemFuncWrapper ( ptrT  ptr,
memfnT  memfn 
)
inline

Constructs a wrapper from an object pointer and a member function pointer.

Parameters
[in]ptrThe object pointer.
[in]memfnThe member function pointer.

Member Function Documentation

◆ operator()()

template<typename ptrT , typename memfnT , typename resT >
template<typename... argTs>
result_type madness::detail::MemFuncWrapper< ptrT, memfnT, resT >::operator() ( argTs &&...  args) const
inline

Evaluates the member function, when dereferenced from the object pointer.

Template Parameters
argTsArgument type pack.
Parameters
[in,out]argsArgument parameter pack.
Returns
The member function's return value.

References MADNESS_ASSERT, madness::detail::MemFuncWrapper< ptrT, memfnT, resT >::memfn_, and madness::detail::MemFuncWrapper< ptrT, memfnT, resT >::ptr_.

◆ operator=()

template<typename ptrT , typename memfnT , typename resT >
MemFuncWrapper_& madness::detail::MemFuncWrapper< ptrT, memfnT, resT >::operator= ( const MemFuncWrapper_ other)
inline

◆ serialize()

template<typename ptrT , typename memfnT , typename resT >
template<typename Archive >
void madness::detail::MemFuncWrapper< ptrT, memfnT, resT >::serialize ( const Archive &  ar)
inline

Serializes a MemFuncWrapper.

Template Parameters
ArchiveThe archive type.
Parameters
[in,out]arThe archive.

References madness::detail::MemFuncWrapper< ptrT, memfnT, resT >::memfn_, and madness::detail::MemFuncWrapper< ptrT, memfnT, resT >::ptr_.

Friends And Related Function Documentation

◆ get_mem_func_ptr [1/2]

template<typename ptrT , typename memfnT , typename resT >
memfnT get_mem_func_ptr ( const MemFuncWrapper< ptrT, memfnT, resT > &  )
friend

Returns the member function pointer from a wrapper.

Template Parameters
ptrTPointer type.
memfnTMember function pointer type.
resTMember function return type.
Parameters
wrapperWrapper to the member function.
Returns
The member function pointer.

◆ get_mem_func_ptr [2/2]

template<typename ptrT , typename memfnT , typename resT >
memfnT get_mem_func_ptr ( const MemFuncWrapper_ wrapper)
friend

Member Data Documentation

◆ memfn_

template<typename ptrT , typename memfnT , typename resT >
memfnT madness::detail::MemFuncWrapper< ptrT, memfnT, resT >::memfn_
private

◆ ptr_

template<typename ptrT , typename memfnT , typename resT >
ptrT madness::detail::MemFuncWrapper< ptrT, memfnT, resT >::ptr_
private

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