BDE 4.14.0 Production release
Loading...
Searching...
No Matches
bdlf::MemFnInstance< PROTOTYPE, INSTANCE > Class Template Reference

#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< ObjectTypeDeref
 

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.
 
MemFnInstanceoperator= (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
 

Detailed Description

template<class PROTOTYPE, class INSTANCE>
class bdlf::MemFnInstance< PROTOTYPE, INSTANCE >

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

Member Typedef Documentation

◆ Args

template<class PROTOTYPE , class INSTANCE >
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.

◆ Deref

template<class PROTOTYPE , class INSTANCE >
typedef MemFn_Dereference<ObjectType> bdlf::MemFnInstance< PROTOTYPE, INSTANCE >::Deref

◆ ObjectType

template<class PROTOTYPE , class INSTANCE >
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.

◆ Prototype

template<class PROTOTYPE , class INSTANCE >
typedef PROTOTYPE bdlf::MemFnInstance< PROTOTYPE, INSTANCE >::Prototype

ProtoType is an alias for the parameterized PROTOTYPE passed as a template argument to this wrapper.

◆ ProtoType

template<class PROTOTYPE , class INSTANCE >
typedef PROTOTYPE bdlf::MemFnInstance< PROTOTYPE, INSTANCE >::ProtoType

ProtoType is an alias for the parameterized PROTOTYPE passed as a template argument to this wrapper.

Deprecated:
Use Prototype instead.

◆ ResultType

template<class PROTOTYPE , class INSTANCE >
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.

Constructor & Destructor Documentation

◆ MemFnInstance() [1/2]

template<class PROTOTYPE , class INSTANCE >
bdlf::MemFnInstance< PROTOTYPE, INSTANCE >::MemFnInstance ( PROTOTYPE  func,
const INSTANCE &  object,
bslma::Allocator basicAllocator = 0 
)
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.

◆ MemFnInstance() [2/2]

template<class PROTOTYPE , class INSTANCE >
bdlf::MemFnInstance< PROTOTYPE, INSTANCE >::MemFnInstance ( const MemFnInstance< PROTOTYPE, INSTANCE > &  original,
bslma::Allocator basicAllocator = 0 
)
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.

◆ ~MemFnInstance()

template<class PROTOTYPE , class INSTANCE >
bdlf::MemFnInstance< PROTOTYPE, INSTANCE >::~MemFnInstance ( )
inline

Member Function Documentation

◆ operator()() [1/15]

template<class PROTOTYPE , class INSTANCE >
MemFnInstance< PROTOTYPE, INSTANCE >::ResultType bdlf::MemFnInstance< PROTOTYPE, INSTANCE >::operator() ( ) const
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.

◆ operator()() [2/15]

template<class PROTOTYPE , class INSTANCE >
MemFnInstance< PROTOTYPE, INSTANCE >::ResultType bdlf::MemFnInstance< PROTOTYPE, INSTANCE >::operator() ( ARG1  arg1) const
inline

◆ operator()() [3/15]

template<class PROTOTYPE , class INSTANCE >
MemFnInstance< PROTOTYPE, INSTANCE >::ResultType bdlf::MemFnInstance< PROTOTYPE, INSTANCE >::operator() ( ARG1  arg1,
ARG2  arg2 
) const
inline

◆ operator()() [4/15]

template<class PROTOTYPE , class INSTANCE >
MemFnInstance< PROTOTYPE, INSTANCE >::ResultType bdlf::MemFnInstance< PROTOTYPE, INSTANCE >::operator() ( ARG1  arg1,
ARG2  arg2,
ARG3  arg3 
) const
inline

◆ operator()() [5/15]

template<class PROTOTYPE , class INSTANCE >
MemFnInstance< PROTOTYPE, INSTANCE >::ResultType bdlf::MemFnInstance< PROTOTYPE, INSTANCE >::operator() ( ARG1  arg1,
ARG2  arg2,
ARG3  arg3,
ARG4  arg4 
) const
inline

◆ operator()() [6/15]

template<class PROTOTYPE , class INSTANCE >
MemFnInstance< PROTOTYPE, INSTANCE >::ResultType bdlf::MemFnInstance< PROTOTYPE, INSTANCE >::operator() ( ARG1  arg1,
ARG2  arg2,
ARG3  arg3,
ARG4  arg4,
ARG5  arg5 
) const
inline

◆ operator()() [7/15]

template<class PROTOTYPE , class INSTANCE >
MemFnInstance< PROTOTYPE, INSTANCE >::ResultType bdlf::MemFnInstance< PROTOTYPE, INSTANCE >::operator() ( ARG1  arg1,
ARG2  arg2,
ARG3  arg3,
ARG4  arg4,
ARG5  arg5,
ARG6  arg6 
) const
inline

◆ operator()() [8/15]

template<class PROTOTYPE , class INSTANCE >
MemFnInstance< PROTOTYPE, INSTANCE >::ResultType bdlf::MemFnInstance< PROTOTYPE, INSTANCE >::operator() ( ARG1  arg1,
ARG2  arg2,
ARG3  arg3,
ARG4  arg4,
ARG5  arg5,
ARG6  arg6,
ARG7  arg7 
) const
inline

◆ operator()() [9/15]

template<class PROTOTYPE , class INSTANCE >
MemFnInstance< PROTOTYPE, INSTANCE >::ResultType bdlf::MemFnInstance< PROTOTYPE, INSTANCE >::operator() ( ARG1  arg1,
ARG2  arg2,
ARG3  arg3,
ARG4  arg4,
ARG5  arg5,
ARG6  arg6,
ARG7  arg7,
ARG8  arg8 
) const
inline

◆ operator()() [10/15]

template<class PROTOTYPE , class INSTANCE >
MemFnInstance< PROTOTYPE, INSTANCE >::ResultType bdlf::MemFnInstance< PROTOTYPE, INSTANCE >::operator() ( ARG1  arg1,
ARG2  arg2,
ARG3  arg3,
ARG4  arg4,
ARG5  arg5,
ARG6  arg6,
ARG7  arg7,
ARG8  arg8,
ARG9  arg9 
) const
inline

◆ operator()() [11/15]

template<class PROTOTYPE , class INSTANCE >
MemFnInstance< PROTOTYPE, INSTANCE >::ResultType bdlf::MemFnInstance< PROTOTYPE, INSTANCE >::operator() ( ARG1  arg1,
ARG2  arg2,
ARG3  arg3,
ARG4  arg4,
ARG5  arg5,
ARG6  arg6,
ARG7  arg7,
ARG8  arg8,
ARG9  arg9,
ARG10  arg10 
) const
inline

◆ operator()() [12/15]

template<class PROTOTYPE , class INSTANCE >
MemFnInstance< PROTOTYPE, INSTANCE >::ResultType bdlf::MemFnInstance< PROTOTYPE, INSTANCE >::operator() ( ARG1  arg1,
ARG2  arg2,
ARG3  arg3,
ARG4  arg4,
ARG5  arg5,
ARG6  arg6,
ARG7  arg7,
ARG8  arg8,
ARG9  arg9,
ARG10  arg10,
ARG11  arg11 
) const
inline

◆ operator()() [13/15]

template<class PROTOTYPE , class INSTANCE >
MemFnInstance< PROTOTYPE, INSTANCE >::ResultType bdlf::MemFnInstance< PROTOTYPE, INSTANCE >::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
inline

◆ operator()() [14/15]

template<class PROTOTYPE , class INSTANCE >
MemFnInstance< PROTOTYPE, INSTANCE >::ResultType bdlf::MemFnInstance< PROTOTYPE, INSTANCE >::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
inline

◆ operator()() [15/15]

template<class PROTOTYPE , class INSTANCE >
MemFnInstance< PROTOTYPE, INSTANCE >::ResultType bdlf::MemFnInstance< PROTOTYPE, INSTANCE >::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
inline

◆ operator=()

template<class PROTOTYPE , class INSTANCE >
MemFnInstance< PROTOTYPE, INSTANCE > & bdlf::MemFnInstance< PROTOTYPE, INSTANCE >::operator= ( const MemFnInstance< PROTOTYPE, INSTANCE > &  rhs)
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.


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