lib

Kross::Api::Function1< INSTANCE, P1 > Class Template Reference

#include <function.h>

Inheritance diagram for Kross::Api::Function1< INSTANCE, P1 >:
Kross::Api::Function

Public Member Functions

 Function1 (INSTANCE *instance, Method method, P1 p1)
Object::Ptr call (List::Ptr args)

Detailed Description

template<class INSTANCE, typename P1>
class Kross::Api::Function1< INSTANCE, P1 >

Specialization of the Function0 which takes as additional parameter a const-value.

This const-value will be hidden for the scripting backend and is only passed through on function-call.

So, this class could be as example used to point to a function like;

TDESharedPtr< List > Ptr
Shared pointer to implement reference-counting.
Definition list.h:44
TDESharedPtr< Object > Ptr
Shared pointer to implement reference-counting.
Definition object.h:57

and then we are able to point to the function with something like

this->addFunction("myfunctionname",
this, // pointer to an instance of MYCLASS
&MYCLASS::myfunction, // the method which should be wrapped
17 // the const-value we like to pass to the function.
) );
Specialization of the Function0 which takes as additional parameter a const-value.
Definition function.h:97

The defined integer myinteger which has the value 17 will be passed transparently to myfunc. The scripting-backend won't know that there exists such an additional integer at all. So, it's hidden and the user aka the scripting code won't be able to manipulate that additional value.

Definition at line 96 of file function.h.

Constructor & Destructor Documentation

◆ Function1()

template<class INSTANCE, typename P1>
Kross::Api::Function1< INSTANCE, P1 >::Function1 ( INSTANCE * instance,
Method method,
P1 p1 )
inline

Definition at line 104 of file function.h.

Member Function Documentation

◆ call()

template<class INSTANCE, typename P1>
Object::Ptr Kross::Api::Function1< INSTANCE, P1 >::call ( List::Ptr )
inlinevirtual

Each function needs to implement the call-method which will be executed if the function itself should be executed.

Implements Kross::Api::Function.

Definition at line 106 of file function.h.


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