lib
Kross::Api::Event< T > Class Template Reference
#include <event.h>
Inheritance diagram for Kross::Api::Event< T >:

Detailed Description
template<class T>
class Kross::Api::Event< T >
Template class for all kinds of callable events.
An event is the abstract base for callable objects like methodfunctions in Class instances or EventSlot and EventSignal to access Qt signals and slots.
Definition at line 45 of file event.h.
Public Member Functions | |
Event (const QString &name) | |
virtual | ~Event () |
void | addFunction (const QString &name, FunctionPtr function) |
void | addFunction (const QString &name, Function *function) |
template<class RETURNOBJ, class ARG1OBJ, class ARG2OBJ, class ARG3OBJ, class ARG4OBJ, class INSTANCE, typename METHOD> | |
void | addFunction4 (const QString &name, INSTANCE *instance, METHOD method, ARG1OBJ *arg1=0, ARG2OBJ *arg2=0, ARG3OBJ *arg3=0, ARG4OBJ *arg4=0) |
template<class RETURNOBJ, class ARG1OBJ, class ARG2OBJ, class ARG3OBJ, class INSTANCE, typename METHOD> | |
void | addFunction3 (const QString &name, INSTANCE *instance, METHOD method, ARG1OBJ *arg1=0, ARG2OBJ *arg2=0, ARG3OBJ *arg3=0) |
template<class RETURNOBJ, class ARG1OBJ, class ARG2OBJ, class INSTANCE, typename METHOD> | |
void | addFunction2 (const QString &name, INSTANCE *instance, METHOD method, ARG1OBJ *arg1=0, ARG2OBJ *arg2=0) |
template<class RETURNOBJ, class ARG1OBJ, class INSTANCE, typename METHOD> | |
void | addFunction1 (const QString &name, INSTANCE *instance, METHOD method, ARG1OBJ *arg1=0) |
template<class RETURNOBJ, class INSTANCE, typename METHOD> | |
void | addFunction0 (const QString &name, INSTANCE *instance, METHOD method) |
bool | isAFunction (const QString &name) const |
virtual Object::Ptr | call (const QString &name, List::Ptr arguments) |
Constructor & Destructor Documentation
template<class T>
Kross::Api::Event< T >::Event | ( | const QString & | name | ) | [inline] |
template<class T>
virtual Kross::Api::Event< T >::~Event | ( | ) | [inline, virtual] |
Member Function Documentation
template<class T>
void Kross::Api::Event< T >::addFunction | ( | const QString & | name, | |
FunctionPtr | function | |||
) | [inline] |
Add a Callable methodfunction to the list of functions this Object supports.
The FunctionPtr points to the concret Object::Ptr myfuncname(List::Ptr) method in the class defined with template T.
- Parameters:
-
name The functionname. Each function this object holds should have an unique name to be still accessable. function A pointer to the methodfunction that should handle calls.
- Todo:
- Remove this method as soon as there is no code using it
template<class T>
void Kross::Api::Event< T >::addFunction | ( | const QString & | name, | |
Function * | function | |||
) | [inline] |
Add a methodfunction to the list of functions this Object supports.
template<class T>
template<class RETURNOBJ, class ARG1OBJ, class ARG2OBJ, class ARG3OBJ, class ARG4OBJ, class INSTANCE, typename METHOD>
void Kross::Api::Event< T >::addFunction4 | ( | const QString & | name, | |
INSTANCE * | instance, | |||
METHOD | method, | |||
ARG1OBJ * | arg1 = 0 , |
|||
ARG2OBJ * | arg2 = 0 , |
|||
ARG3OBJ * | arg3 = 0 , |
|||
ARG4OBJ * | arg4 = 0 | |||
) | [inline] |
Template function to add a ProxyFunction as builtin-function to this Event instance.
template<class T>
template<class RETURNOBJ, class ARG1OBJ, class ARG2OBJ, class ARG3OBJ, class INSTANCE, typename METHOD>
void Kross::Api::Event< T >::addFunction3 | ( | const QString & | name, | |
INSTANCE * | instance, | |||
METHOD | method, | |||
ARG1OBJ * | arg1 = 0 , |
|||
ARG2OBJ * | arg2 = 0 , |
|||
ARG3OBJ * | arg3 = 0 | |||
) | [inline] |
template<class T>
template<class RETURNOBJ, class ARG1OBJ, class ARG2OBJ, class INSTANCE, typename METHOD>
void Kross::Api::Event< T >::addFunction2 | ( | const QString & | name, | |
INSTANCE * | instance, | |||
METHOD | method, | |||
ARG1OBJ * | arg1 = 0 , |
|||
ARG2OBJ * | arg2 = 0 | |||
) | [inline] |
template<class T>
template<class RETURNOBJ, class ARG1OBJ, class INSTANCE, typename METHOD>
void Kross::Api::Event< T >::addFunction1 | ( | const QString & | name, | |
INSTANCE * | instance, | |||
METHOD | method, | |||
ARG1OBJ * | arg1 = 0 | |||
) | [inline] |
template<class T>
template<class RETURNOBJ, class INSTANCE, typename METHOD>
void Kross::Api::Event< T >::addFunction0 | ( | const QString & | name, | |
INSTANCE * | instance, | |||
METHOD | method | |||
) | [inline] |
template<class T>
bool Kross::Api::Event< T >::isAFunction | ( | const QString & | name | ) | const [inline] |
template<class T>
virtual Object::Ptr Kross::Api::Event< T >::call | ( | const QString & | name, | |
List::Ptr | arguments | |||
) | [inline, virtual] |
Overloaded method to handle function-calls.
- Exceptions:
-
AttributeException if argumentparameters arn't valid. RuntimeException if the functionname isn't valid.
- Parameters:
-
name The functionname. Each function this Object holds should have a different name cause they are access by they name. If name is QString::null or empty, a self-reference to this instance is returned. arguments The list of arguments.
- Returns:
- An Object representing the call result or NULL if there doesn't exists such a function with defined name.
Reimplemented from Kross::Api::Callable.
The documentation for this class was generated from the following file: