CrystalSpace

Public API Reference

csEventHandlerRegistry Class Reference
[Event handling]

The csEventHandlerRegistry maintains a global one-to-one mapping from strings to csHandlerIDs, and a one-to-(zero or one) mapping from csHandlerIDs to iEventHandler pointers. More...

#include <csutil/eventhandlers.h>

Inheritance diagram for csEventHandlerRegistry:

List of all members.

Public Member Functions

csHandlerID const GetGeneric (csHandlerID id)
 Returns the csHandleID for the generic name for instance name id.
csHandlerID GetGenericID (const char *)
 Get a csHandlerID based upon some string.
iEventHandlerGetHandler (csHandlerID id)
 Returns the handler registered for a csHandlerID (will be 0 if csHandlerID is a generic name, i.e., if (!csEventHandlerRegistry->IsInstance(id)).
csHandlerID GetID (const char *)
 Get the ID for a given event handler name.
csHandlerID GetID (iEventHandler *)
 Get the csHandlerID for a specified event handler, which provides its own name via the iEventHandler::GetInstanceName() method.
const char * GetString (csHandlerID id)
 Returns the string name for a csHandlerID.
bool IsInstance (csHandlerID id)
 returns true if id is a handler instance (i.e., not a generic name).
bool IsInstanceOf (csHandlerID instanceid, csHandlerID genericid)
 returns true if instanceid is a handler instance, genericid is a generic instance, and instanceid is an instance of genericid in particular.
csHandlerID RegisterID (iEventHandler *)
 Register an event handler to obtain a handler ID.
void ReleaseID (iEventHandler *)
 Used when an iEventHandler is destroyed to remove our reference.
void ReleaseID (csHandlerID id)
 Used when an iEventHandler is desroyed to remove our reference.

Detailed Description

The csEventHandlerRegistry maintains a global one-to-one mapping from strings to csHandlerIDs, and a one-to-(zero or one) mapping from csHandlerIDs to iEventHandler pointers.

Definition at line 52 of file eventhandlers.h.


Member Function Documentation

csHandlerID const csEventHandlerRegistry::GetGeneric ( csHandlerID  id  )  [virtual]

Returns the csHandleID for the generic name for instance name id.

Implements iEventHandlerRegistry.

csHandlerID csEventHandlerRegistry::GetGenericID ( const char *   )  [virtual]

Get a csHandlerID based upon some string.

This should only ever be done to reference generic (non-instantiated) handler names or single-instance handlers.

Implements iEventHandlerRegistry.

iEventHandler* csEventHandlerRegistry::GetHandler ( csHandlerID  id  )  [virtual]

Returns the handler registered for a csHandlerID (will be 0 if csHandlerID is a generic name, i.e., if (!csEventHandlerRegistry->IsInstance(id)).

Implements iEventHandlerRegistry.

csHandlerID csEventHandlerRegistry::GetID ( const char *   )  [virtual]

Get the ID for a given event handler name.

This should usually not be used, since it does not handle magic creation of ":pre" and ":post" signpost handlers or any other such bookkeeping magic.

Implements iEventHandlerRegistry.

csHandlerID csEventHandlerRegistry::GetID ( iEventHandler  )  [virtual]

Get the csHandlerID for a specified event handler, which provides its own name via the iEventHandler::GetInstanceName() method.

Implements iEventHandlerRegistry.

const char* csEventHandlerRegistry::GetString ( csHandlerID  id  )  [virtual]

Returns the string name for a csHandlerID.

Implements iEventHandlerRegistry.

bool csEventHandlerRegistry::IsInstance ( csHandlerID  id  )  [virtual]

returns true if id is a handler instance (i.e., not a generic name).

Implements iEventHandlerRegistry.

bool csEventHandlerRegistry::IsInstanceOf ( csHandlerID  instanceid,
csHandlerID  genericid 
) [virtual]

returns true if instanceid is a handler instance, genericid is a generic instance, and instanceid is an instance of genericid in particular.

Implements iEventHandlerRegistry.

csHandlerID csEventHandlerRegistry::RegisterID ( iEventHandler  )  [virtual]

Register an event handler to obtain a handler ID.

Remarks:
Every call must be balanced with a call to ReleaseID() to ensure proper housekeeping. Otherwise, event handler instances may be leaking.

Implements iEventHandlerRegistry.

void csEventHandlerRegistry::ReleaseID ( iEventHandler  )  [virtual]

Used when an iEventHandler is destroyed to remove our reference.

Implements iEventHandlerRegistry.

void csEventHandlerRegistry::ReleaseID ( csHandlerID  id  )  [virtual]

Used when an iEventHandler is desroyed to remove our reference.

Implements iEventHandlerRegistry.


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

Generated for Crystal Space 2.0 by doxygen 1.6.1