lib

Kross::Api::Event< T > Class Template Reference

#include <event.h>

Inheritance diagram for Kross::Api::Event< T >:
Kross::Api::Callable Kross::Api::Object Kross::Api::Class< T >

Public Member Functions

 Event (const TQString &name)
virtual ~Event ()
void addFunction (const TQString &name, FunctionPtr function)
void addFunction (const TQString &name, Function *function)
template<class RETURNOBJ, class ARG1OBJ, class ARG2OBJ, class ARG3OBJ, class ARG4OBJ, class INSTANCE, typename METHOD>
void addFunction4 (const TQString &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 TQString &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 TQString &name, INSTANCE *instance, METHOD method, ARG1OBJ *arg1=0, ARG2OBJ *arg2=0)
template<class RETURNOBJ, class ARG1OBJ, class INSTANCE, typename METHOD>
void addFunction1 (const TQString &name, INSTANCE *instance, METHOD method, ARG1OBJ *arg1=0)
template<class RETURNOBJ, class INSTANCE, typename METHOD>
void addFunction0 (const TQString &name, INSTANCE *instance, METHOD method)
bool isAFunction (const TQString &name) const
virtual Object::Ptr call (const TQString &name, List::Ptr arguments)
Public Member Functions inherited from Kross::Api::Callable
 Callable (const TQString &name)
virtual ~Callable ()
const TQString getName () const
virtual const TQString getClassName () const
bool hasChild (const TQString &name) const
Object::Ptr getChild (const TQString &name) const
TQMap< TQString, Object::Ptr > getChildren () const
bool addChild (const TQString &name, Object *object)
bool addChild (Callable *object)
void removeChild (const TQString &name)
void removeAllChildren ()
Public Member Functions inherited from Kross::Api::Object
 Object ()
virtual ~Object ()
virtual const TQString toString ()
virtual Object::Ptr call (const TQString &name, TDESharedPtr< List > arguments)
virtual TQStringList getCalls ()

Additional Inherited Members

Public Types inherited from Kross::Api::Callable
typedef TDESharedPtr< Callable > Ptr
Public Types inherited from Kross::Api::Object
typedef TDESharedPtr< Object > Ptr
Static Public Member Functions inherited from Kross::Api::Object
template<class T>
static T * fromObject (Object::Ptr object)
template<typename TYPE>
static Object::Ptr toObject (TYPE 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 TQt signals and slots.

Definition at line 45 of file event.h.

Constructor & Destructor Documentation

◆ Event()

template<class T>
Kross::Api::Event< T >::Event ( const TQString & name)
inline

Constructor.

Parameters
nameThe name this Event has.

Definition at line 67 of file event.h.

◆ ~Event()

template<class T>
virtual Kross::Api::Event< T >::~Event ( )
inlinevirtual

Destructor.

Definition at line 75 of file event.h.

Member Function Documentation

◆ addFunction() [1/2]

template<class T>
void Kross::Api::Event< T >::addFunction ( const TQString & name,
Function * function )
inline

Add a methodfunction to the list of functions this Object supports.

Parameters
nameThe functionname. Each function this object holds should have an unique name to be still accessable.
functionA Function instance which defines the methodfunction. This Event will be the owner of the Function instance and will take care of deleting it if this Event got deleted.

Definition at line 115 of file event.h.

◆ addFunction() [2/2]

template<class T>
void Kross::Api::Event< T >::addFunction ( const TQString & 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
nameThe functionname. Each function this object holds should have an unique name to be still accessable.
functionA pointer to the methodfunction that should handle calls.
Todo
Remove this method as soon as there is no code using it

Definition at line 98 of file event.h.

◆ addFunction0()

template<class T>
template<class RETURNOBJ, class INSTANCE, typename METHOD>
void Kross::Api::Event< T >::addFunction0 ( const TQString & name,
INSTANCE * instance,
METHOD method )
inline

Same as above with no arguments.

Definition at line 165 of file event.h.

◆ addFunction1()

template<class T>
template<class RETURNOBJ, class ARG1OBJ, class INSTANCE, typename METHOD>
void Kross::Api::Event< T >::addFunction1 ( const TQString & name,
INSTANCE * instance,
METHOD method,
ARG1OBJ * arg1 = 0 )
inline

Same as above, but with one argument.

Definition at line 155 of file event.h.

◆ addFunction2()

template<class T>
template<class RETURNOBJ, class ARG1OBJ, class ARG2OBJ, class INSTANCE, typename METHOD>
void Kross::Api::Event< T >::addFunction2 ( const TQString & name,
INSTANCE * instance,
METHOD method,
ARG1OBJ * arg1 = 0,
ARG2OBJ * arg2 = 0 )
inline

Same as above with two arguments.

Definition at line 145 of file event.h.

◆ addFunction3()

template<class T>
template<class RETURNOBJ, class ARG1OBJ, class ARG2OBJ, class ARG3OBJ, class INSTANCE, typename METHOD>
void Kross::Api::Event< T >::addFunction3 ( const TQString & name,
INSTANCE * instance,
METHOD method,
ARG1OBJ * arg1 = 0,
ARG2OBJ * arg2 = 0,
ARG3OBJ * arg3 = 0 )
inline

Same as above with three arguments.

Definition at line 135 of file event.h.

◆ addFunction4()

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 TQString & 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.

Definition at line 125 of file event.h.

◆ call()

template<class T>
virtual Object::Ptr Kross::Api::Event< T >::call ( const TQString & name,
List::Ptr arguments )
inlinevirtual

Overloaded method to handle function-calls.

Exceptions
AttributeExceptionif argumentparameters arn't valid.
RuntimeExceptionif the functionname isn't valid.
Parameters
nameThe functionname. Each function this Object holds should have a different name cause they are access by they name. If name is TQString() or empty, a self-reference to this instance is returned.
argumentsThe 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.

Definition at line 201 of file event.h.

◆ isAFunction()

template<class T>
bool Kross::Api::Event< T >::isAFunction ( const TQString & name) const
inline

Check if a function is a member of this Callable.

Parameters
namethe function name
Returns
true if the function is available in this Callable

Definition at line 178 of file event.h.


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