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::ConstMemberFunction< T, RET, Arguments > Class Template Reference

Representation of a const member function. More...

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

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

Public Types

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

Public Member Functions

 ConstMemberFunction (const T *obj, Func func)
 Constructor. More...
 
virtual ~ConstMemberFunction ()
 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

const 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::ConstMemberFunction< T, RET, Arguments >

Representation of a const member function.

Member Typedef Documentation

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

Typed function pointer for a member function of class T.

Constructor & Destructor Documentation

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

Constructor.

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

Destructor.

Member Function Documentation

template<class T , typename RET , typename... Arguments>
std::unique_ptr< AbstractFunction > cppexpose::ConstMemberFunction< 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::ConstMemberFunction< T, RET, Arguments >::m_func, and cppexpose::ConstMemberFunction< T, RET, Arguments >::m_obj.

template<class T , typename RET , typename... Arguments>
Variant cppexpose::ConstMemberFunction< 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::ConstMemberFunction< T, RET, Arguments >::callMethod().

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

Member Data Documentation

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

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