MADNESS 0.10.1
|
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. | |
typedef MemFuncWrapper< ptrT, memfnT, void > | MemFuncWrapper_ |
Alias for a wrapper that returns void . | |
typedef resT | result_type |
Alias for the function's result type. | |
Public Member Functions | |
MemFuncWrapper () | |
Constructor that sets the pointer to the default value from DefaultInitPtr<ptrT> . | |
MemFuncWrapper (const MemFuncWrapper_ &other) | |
Copy constructor that copies the object pointer and member function pointer. | |
MemFuncWrapper (ptrT ptr, memfnT memfn) | |
Constructs a wrapper from an object pointer and a member function pointer. | |
template<typename... argTs> | |
result_type | operator() (argTs &&... args) const |
Evaluates the member function, when dereferenced from the object pointer. | |
MemFuncWrapper_ & | operator= (const MemFuncWrapper_ &other) |
template<typename Archive > | |
void | serialize (const Archive &ar) |
Serializes a MemFuncWrapper . | |
Private Attributes | |
memfnT | memfn_ |
Member function of the object's type. | |
ptrT | ptr_ |
Pointer to the object. | |
Friends | |
memfnT | get_mem_func_ptr (const MemFuncWrapper< ptrT, memfnT, resT > &) |
Returns the member function pointer from a wrapper. | |
memfnT | get_mem_func_ptr (const MemFuncWrapper_ &wrapper) |
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.
ptrT | Pointer type. |
memfnT | Member function pointer type. |
resT | Result type of the member function. |
typedef memfnT madness::detail::MemFuncWrapper< ptrT, memfnT, resT >::memfn_type |
Alias for the type of the member function pointer.
typedef MemFuncWrapper<ptrT, memfnT, void> madness::detail::MemFuncWrapper< ptrT, memfnT, resT >::MemFuncWrapper_ |
Alias for a wrapper that returns void
.
typedef resT madness::detail::MemFuncWrapper< ptrT, memfnT, resT >::result_type |
Alias for the function's result type.
|
inline |
Constructor that sets the pointer to the default value from DefaultInitPtr<ptrT>
.
|
inline |
Copy constructor that copies the object pointer and member function pointer.
|
inline |
Constructs a wrapper from an object pointer and a member function pointer.
[in] | ptr | The object pointer. |
[in] | memfn | The member function pointer. |
|
inline |
Evaluates the member function, when dereferenced from the object pointer.
argTs | Argument type pack. |
[in,out] | args | Argument parameter pack. |
References MADNESS_ASSERT, madness::detail::MemFuncWrapper< ptrT, memfnT, resT >::memfn_, and madness::detail::MemFuncWrapper< ptrT, memfnT, resT >::ptr_.
|
inline |
Copy assignment operator.
[in] | other | The wrapper to be copied. |
other
. References madness::detail::MemFuncWrapper< ptrT, memfnT, resT >::memfn_, madness::detail::MemFuncWrapper< ptrT, memfnT, void >::memfn_, madness::detail::MemFuncWrapper< ptrT, memfnT, resT >::ptr_, and madness::detail::MemFuncWrapper< ptrT, memfnT, void >::ptr_.
|
inline |
Serializes a MemFuncWrapper
.
Archive | The archive type. |
[in,out] | ar | The archive. |
References madness::detail::MemFuncWrapper< ptrT, memfnT, resT >::memfn_, and madness::detail::MemFuncWrapper< ptrT, memfnT, resT >::ptr_.
|
friend |
Returns the member function pointer from a wrapper.
ptrT | Pointer type. |
memfnT | Member function pointer type. |
resT | Member function return type. |
wrapper | Wrapper to the member function. |
|
friend |
|
private |
Member function of the object's type.
Referenced by madness::detail::MemFuncWrapper< ptrT, memfnT, resT >::operator()(), madness::detail::MemFuncWrapper< ptrT, memfnT, void >::operator()(), madness::detail::MemFuncWrapper< ptrT, memfnT, resT >::operator=(), madness::detail::MemFuncWrapper< ptrT, memfnT, void >::operator=(), madness::detail::MemFuncWrapper< ptrT, memfnT, resT >::serialize(), and madness::detail::MemFuncWrapper< ptrT, memfnT, void >::serialize().
|
private |
Pointer to the object.
Referenced by madness::detail::MemFuncWrapper< ptrT, memfnT, resT >::operator()(), madness::detail::MemFuncWrapper< ptrT, memfnT, void >::operator()(), madness::detail::MemFuncWrapper< ptrT, memfnT, resT >::operator=(), madness::detail::MemFuncWrapper< ptrT, memfnT, void >::operator=(), madness::detail::MemFuncWrapper< ptrT, memfnT, resT >::serialize(), and madness::detail::MemFuncWrapper< ptrT, memfnT, void >::serialize().