BDE 4.14.0 Production release
|
#include <bdlf_memfn.h>
Public Types | |
typedef Traits::ResultType | ResultType |
typedef Traits::ArgumentList | Args |
typedef Traits::ClassType | ObjectType |
typedef PROTOTYPE | Prototype |
typedef PROTOTYPE | ProtoType |
typedef MemFn_Dereference< ObjectType > | Deref |
Public Member Functions | |
MemFnInstance (PROTOTYPE func, const INSTANCE &object, bslma::Allocator *basicAllocator=0) | |
MemFnInstance (const MemFnInstance &original, bslma::Allocator *basicAllocator=0) | |
~MemFnInstance () | |
Destroy this object. | |
MemFnInstance & | operator= (const MemFnInstance &rhs) |
ResultType | operator() () const |
ResultType | operator() (ARG1 arg1) const |
ResultType | operator() (ARG1 arg1, ARG2 arg2) const |
ResultType | operator() (ARG1 arg1, ARG2 arg2, ARG3 arg3) const |
ResultType | operator() (ARG1 arg1, ARG2 arg2, ARG3 arg3, ARG4 arg4) const |
ResultType | operator() (ARG1 arg1, ARG2 arg2, ARG3 arg3, ARG4 arg4, ARG5 arg5) const |
ResultType | operator() (ARG1 arg1, ARG2 arg2, ARG3 arg3, ARG4 arg4, ARG5 arg5, ARG6 arg6) const |
ResultType | operator() (ARG1 arg1, ARG2 arg2, ARG3 arg3, ARG4 arg4, ARG5 arg5, ARG6 arg6, ARG7 arg7) const |
ResultType | operator() (ARG1 arg1, ARG2 arg2, ARG3 arg3, ARG4 arg4, ARG5 arg5, ARG6 arg6, ARG7 arg7, ARG8 arg8) const |
ResultType | operator() (ARG1 arg1, ARG2 arg2, ARG3 arg3, ARG4 arg4, ARG5 arg5, ARG6 arg6, ARG7 arg7, ARG8 arg8, ARG9 arg9) const |
ResultType | operator() (ARG1 arg1, ARG2 arg2, ARG3 arg3, ARG4 arg4, ARG5 arg5, ARG6 arg6, ARG7 arg7, ARG8 arg8, ARG9 arg9, ARG10 arg10) const |
ResultType | operator() (ARG1 arg1, ARG2 arg2, ARG3 arg3, ARG4 arg4, ARG5 arg5, ARG6 arg6, ARG7 arg7, ARG8 arg8, ARG9 arg9, ARG10 arg10, ARG11 arg11) const |
ResultType | operator() (ARG1 arg1, ARG2 arg2, ARG3 arg3, ARG4 arg4, ARG5 arg5, ARG6 arg6, ARG7 arg7, ARG8 arg8, ARG9 arg9, ARG10 arg10, ARG11 arg11, ARG12 arg12) const |
ResultType | operator() (ARG1 arg1, ARG2 arg2, ARG3 arg3, ARG4 arg4, ARG5 arg5, ARG6 arg6, ARG7 arg7, ARG8 arg8, ARG9 arg9, ARG10 arg10, ARG11 arg11, ARG12 arg12, ARG13 arg13) const |
ResultType | operator() (ARG1 arg1, ARG2 arg2, ARG3 arg3, ARG4 arg4, ARG5 arg5, ARG6 arg6, ARG7 arg7, ARG8 arg8, ARG9 arg9, ARG10 arg10, ARG11 arg11, ARG12 arg12, ARG13 arg13, ARG14 arg14) const |
This class encapsulates a member function pointer having the parameterized PROTOTYPE
and a value of the parameterized INSTANCE
type, which can be either be the type of object referred to by the PROTOTYPE
, or a pointer to one, such that the member function pointer can be invoked on the wrapped instance in syntactically the same manner as a free function pointer. Zero to fourteen additional arguments may be specified depending on the PROTOTYPE
. Note that whether INSTANCE
is a pointer or an object is determined by whether it has pointer semantics or not (as determined by the bslmf::HasPointerSemantics
type trait). Also note that if INSTANCE
is an object that does not have pointer semantics, PROTOTYPE
must be const-qualified.
See bdlf_memfn
typedef Traits::ArgumentList bdlf::MemFnInstance< PROTOTYPE, INSTANCE >::Args |
Args
is an alias for the list of arguments passed to an invocation of this member function wrapper, expressed as a bslmf_Typelist
.
typedef MemFn_Dereference<ObjectType> bdlf::MemFnInstance< PROTOTYPE, INSTANCE >::Deref |
typedef Traits::ClassType bdlf::MemFnInstance< PROTOTYPE, INSTANCE >::ObjectType |
ObjectType
is an alias for the class type to which the member function that is wrapped belongs.
typedef PROTOTYPE bdlf::MemFnInstance< PROTOTYPE, INSTANCE >::Prototype |
ProtoType
is an alias for the parameterized PROTOTYPE
passed as a template argument to this wrapper.
typedef PROTOTYPE bdlf::MemFnInstance< PROTOTYPE, INSTANCE >::ProtoType |
ProtoType
is an alias for the parameterized PROTOTYPE
passed as a template argument to this wrapper.
typedef Traits::ResultType bdlf::MemFnInstance< PROTOTYPE, INSTANCE >::ResultType |
ResultType
is an alias for the type of the object returned by an invocation of this member function wrapper.
|
inline |
Create a member function pointer wrapper around the specified func
member function pointer of the parameterized PROTOTYPE
, that is invocable on the specified object
instance of the parameterized INSTANCE
. Optionally specify a basicAllocator
used to supply memory. If basicAllocator
is 0, the currently installed default allocator is used.
|
inline |
Create a member function pointer wrapper around the same member function and instance pointed to by the specified original
object. Optionally specify a basicAllocator
used to supply memory. If basicAllocator
is 0, the currently installed default allocator is used.
|
inline |
|
inline |
Invoke the member function pointer held by this wrapper on the provided object with the specified arg1
up to argN
as arguments, with N
being the number of arguments of the member function, and return the result of this invocation, or void
if this member function pointer does not return a result.
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
Assign to this member function pointer wrapper the same member function and instance pointed to by the specified rhs
member function pointer wrapper, and return a reference to this modifiable member function pointer wrapper.