Kross::Api::ProxyFunction< INSTANCE, METHOD, RET, ARG1, ARG2, ARG3, ARG4 > Class Template Reference

#include <proxy.h>

Inheritance diagram for Kross::Api::ProxyFunction< INSTANCE, METHOD, RET, ARG1, ARG2, ARG3, ARG4 >:

Inheritance graph
[legend]
Collaboration diagram for Kross::Api::ProxyFunction< INSTANCE, METHOD, RET, ARG1, ARG2, ARG3, ARG4 >:

Collaboration graph
[legend]
List of all members.

Detailed Description

template<class INSTANCE, typename METHOD, class RET = ProxyValue<Kross::Api::Object,void>, class ARG1 = ProxyValue<Kross::Api::Object,void>, class ARG2 = ProxyValue<Kross::Api::Object,void>, class ARG3 = ProxyValue<Kross::Api::Object,void>, class ARG4 = ProxyValue<Kross::Api::Object,void>>
class Kross::Api::ProxyFunction< INSTANCE, METHOD, RET, ARG1, ARG2, ARG3, ARG4 >

The ProxyFunction template-class is used to publish any C/C++ method (not only slots) of a struct or class instance as a a Kross::Api::Function to Kross.

With this class we don't need to have a method-wrapper for each single function what a) should reduce the code needed for wrappers and b) is more typesafe cause the connection to the C/C++ method is done on compiletime.

Definition at line 71 of file proxy.h.

Public Member Functions

 ProxyFunction (INSTANCE *instance, const METHOD &method)
Object::Ptr call (List::Ptr args)

Classes

struct  ProxyFunctionCaller
struct  ProxyFunctionCaller< PROXYFUNC, void >


Constructor & Destructor Documentation

template<class INSTANCE, typename METHOD, class RET = ProxyValue<Kross::Api::Object,void>, class ARG1 = ProxyValue<Kross::Api::Object,void>, class ARG2 = ProxyValue<Kross::Api::Object,void>, class ARG3 = ProxyValue<Kross::Api::Object,void>, class ARG4 = ProxyValue<Kross::Api::Object,void>>
Kross::Api::ProxyFunction< INSTANCE, METHOD, RET, ARG1, ARG2, ARG3, ARG4 >::ProxyFunction INSTANCE *  instance,
const METHOD &  method
[inline]
 

Constructor.

Parameters:
instance The objectinstance to which the method belongs to.
method The method-pointer.

Definition at line 111 of file proxy.h.

00112                 : m_instance(instance), m_method(method) {}


Member Function Documentation

template<class INSTANCE, typename METHOD, class RET = ProxyValue<Kross::Api::Object,void>, class ARG1 = ProxyValue<Kross::Api::Object,void>, class ARG2 = ProxyValue<Kross::Api::Object,void>, class ARG3 = ProxyValue<Kross::Api::Object,void>, class ARG4 = ProxyValue<Kross::Api::Object,void>>
Object::Ptr Kross::Api::ProxyFunction< INSTANCE, METHOD, RET, ARG1, ARG2, ARG3, ARG4 >::call List::Ptr  args  )  [inline, virtual]
 

This method got called if the wrapped method should be executed.

Parameters:
args The optional list of arguments passed to the execution-call.
Returns:
The returnvalue of the functioncall. It will be NULL if the functioncall doesn't provide us a returnvalue (e.g. if the function has void as returnvalue).

Implements Kross::Api::Function.

Definition at line 123 of file proxy.h.

00123                                          {
00124                 return ProxyFunctionCaller<ProxyFunction, typename RET::type>::exec(this,
00125                     Kross::Api::Object::fromObject<typename ARG1::object>(args->item(0))->operator typename ARG1::type(),
00126                     Kross::Api::Object::fromObject<typename ARG2::object>(args->item(1))->operator typename ARG2::type(),
00127                     Kross::Api::Object::fromObject<typename ARG3::object>(args->item(2))->operator typename ARG3::type(),
00128                     Kross::Api::Object::fromObject<typename ARG4::object>(args->item(3))->operator typename ARG4::type()
00129                 );
00130             }


The documentation for this class was generated from the following file:
Generated on Thu Feb 9 18:00:33 2006 for Kross by  doxygen 1.4.6