BasicSlot Class Reference
[Basic classes]

Stores an event's slot (function pointer and name). More...

#include <basicobject.h>

Collaboration diagram for BasicSlot:

Collaboration graph
[legend]
List of all members.

Public Types

typedef void(*) Callback (void *sender, BasicObject *reciever, void *data)

Public Member Functions

DECLSPEC BasicSlot (const char *fname, const char *classname, Callback func)
virtual DECLSPEC ~BasicSlot ()
 Destructor. Frees the strName.
Callback getFunction ()
 
Returns:
the function pointer of this slot

const char * getName ()
 
Returns:
the name of this slot

bool matchName (const char *name)

Static Public Member Functions

static BasicSlotgetFirst ()
static Callback getFunction (const char *name, const char *classname=NULL)

Public Attributes

BasicSlotbeNext
 Pointer to the next slot in the global event list.

Detailed Description

Stores an event's slot (function pointer and name).

This class is used to get a pointer to a function when knowing its name. Slots can be assigned to a classname.


Member Typedef Documentation

typedef void(*) BasicSlot::Callback(void *sender, BasicObject *reciever, void *data)

Definition for callback functions. The params might be used different as described here.

Parameters:
sender a pointer to the object that called the function
reciever a pointer to the object of which the function is called
data a pointer to anywhere, depends on how it is used


Constructor & Destructor Documentation

BasicSlot::BasicSlot ( const char *  fname,
const char *  classname,
Callback  func 
)

Constructor.

Parameters:
fname the name of the function (must not be NULL, neither contain a '#' nor a dot '.')
classname the name of the class (may be NULL for global methods)
func the function pointer
next pointer to the next slot in the list


Member Function Documentation

bool BasicSlot::matchName ( const char *  name  )  [inline]

Checks, whether the slot's name is equal to the given parameter.

Parameters:
name the name to check for equivalence
Returns:
true if equal, false if not

static BasicSlot* BasicSlot::getFirst (  )  [inline, static]

Returns:
a pointer to the first slot (the one, that was added last) in the global event list

BasicSlot::Callback BasicSlot::getFunction ( const char *  name,
const char *  classname = NULL 
) [static]

Parameters:
name the function's name (must not be NULL), has the form:
 [<class>.]<function> 
if class is given here, the 2nd param "classname" is ignored
classname the class's name or NULL, if the function does not belong to any class
Returns:
a pointer to the function, that matches the given names

Todo:
optimise search algorithm (O = log(n) would be nice)


The documentation for this class was generated from the following files:
Generated on Wed May 9 17:36:11 2007 for netrinjo by  doxygen 1.5.1