cppexpose  1.0.0.b785e04f23b8
C++ library for type introspection, reflection, and scripting interface
Public Types | Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
cppexpose::MemberFunction< T, RET, Arguments > Class Template Reference

Representation of a member function. More...

#include <cppexpose/include/cppexpose/function/MemberFunction.h>

Inheritance diagram for cppexpose::MemberFunction< T, RET, Arguments >:
Inheritance graph
[legend]
Collaboration diagram for cppexpose::MemberFunction< T, RET, Arguments >:
Collaboration graph
[legend]

Public Types

typedef RET(T::* Func) (Arguments...)
 Typed function pointer for a member function of class T. More...
 

Public Member Functions

 MemberFunction (T *obj, Func func)
 Constructor. More...
 
virtual ~MemberFunction ()
 Destructor. More...
 
virtual std::unique_ptr< AbstractFunctionclone () override
 Create a copy of the function object. More...
 
virtual Variant call (const std::vector< Variant > &args) override
 Call function. More...
 
- Public Member Functions inherited from cppexpose::AbstractFunction
 AbstractFunction ()
 Constructor. More...
 
virtual ~AbstractFunction ()
 Destructor. More...
 

Protected Member Functions

template<size_t... I>
Variant callMethod (helper::Seq< I... >, const std::vector< Variant > &args)
 

Protected Attributes

T * m_obj
 Pointer to instance of class T. More...
 
Func m_func
 Function object (for non-const function) More...
 

Detailed Description

template<class T, typename RET, typename... Arguments>
class cppexpose::MemberFunction< T, RET, Arguments >

Representation of a member function.

Member Typedef Documentation

template<class T , typename RET , typename... Arguments>
typedef RET(T::* cppexpose::MemberFunction< T, RET, Arguments >::Func) (Arguments...)

Typed function pointer for a member function of class T.

Constructor & Destructor Documentation

template<class T , typename RET , typename... Arguments>
cppexpose::MemberFunction< T, RET, Arguments >::MemberFunction ( T *  obj,
Func  func 
)

Constructor.

Parameters
[in]objPointer to object
[in]funcPointer to member function
template<class T , typename RET , typename... Arguments>
cppexpose::MemberFunction< T, RET, Arguments >::~MemberFunction ( )
virtual

Destructor.

Member Function Documentation

template<class T , typename RET , typename... Arguments>
std::unique_ptr< AbstractFunction > cppexpose::MemberFunction< T, RET, Arguments >::clone ( )
overridevirtual

Create a copy of the function object.

Returns
New function object pointing to the same function. Has to be deleted by the caller.

Implements cppexpose::AbstractFunction.

References cppexpose::MemberFunction< T, RET, Arguments >::m_func, and cppexpose::MemberFunction< T, RET, Arguments >::m_obj.

template<class T , typename RET , typename... Arguments>
Variant cppexpose::MemberFunction< T, RET, Arguments >::call ( const std::vector< Variant > &  args)
overridevirtual

Call function.

Parameters
[in]argsList of arguments as Variants
Returns
New function object pointing to the same function. Has to be deleted by the caller.

Implements cppexpose::AbstractFunction.

References cppexpose::MemberFunction< T, RET, Arguments >::callMethod().

template<class T , typename RET , typename... Arguments>
template<size_t... I>
Variant cppexpose::MemberFunction< T, RET, Arguments >::callMethod ( helper::Seq< I... >  ,
const std::vector< Variant > &  args 
)
protected

Member Data Documentation

template<class T , typename RET , typename... Arguments>
T* cppexpose::MemberFunction< T, RET, Arguments >::m_obj
protected
template<class T , typename RET , typename... Arguments>
Func cppexpose::MemberFunction< T, RET, Arguments >::m_func
protected

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