CrystalSpace

Public API Reference

iEventHandlerRegistry Struct Reference
[Event handling]

This interface represents a general event handler registry/resolver. More...

#include <iutil/eventhandlers.h>

Inheritance diagram for iEventHandlerRegistry:

Inheritance graph
[legend]
List of all members.

Public Member Functions

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

Detailed Description

This interface represents a general event handler registry/resolver.

An iHandlerRegistry maintains a one-to-one mapping from strings to csHandlerIDs, and a one-to-(zero or one) mapping from csHandlerIDs to iEventHandler pointers.

Definition at line 58 of file eventhandlers.h.


Member Function Documentation

virtual csHandlerID const iEventHandlerRegistry::GetGeneric ( csHandlerID  id  )  [pure virtual]

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

Implemented in csEventHandlerRegistry.

virtual csHandlerID iEventHandlerRegistry::GetGenericID ( const char *   )  [pure 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.

Implemented in csEventHandlerRegistry.

virtual iEventHandler* iEventHandlerRegistry::GetHandler ( csHandlerID  id  )  [pure virtual]

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

Implemented in csEventHandlerRegistry.

virtual csHandlerID iEventHandlerRegistry::GetID ( const char *   )  [pure virtual]

Get the csHandlerID for an arbitrary handler name.

Does not set up any mappings, implicit names, or anything else that you need; a handler needs be registered with RegisterID() beforehand.

Implemented in csEventHandlerRegistry.

virtual csHandlerID iEventHandlerRegistry::GetID ( iEventHandler  )  [pure virtual]

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

Does not set up any mappings, implicit names, or anything else that you need; a handler needs be registered with RegisterID() beforehand.

Implemented in csEventHandlerRegistry.

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

Returns the string name for a csHandlerID.

Implemented in csEventHandlerRegistry.

virtual bool const iEventHandlerRegistry::IsInstance ( csHandlerID  id  )  [pure virtual]

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

Implemented in csEventHandlerRegistry.

virtual bool const iEventHandlerRegistry::IsInstanceOf ( csHandlerID  instanceid,
csHandlerID  genericid 
) [pure virtual]

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

Implemented in csEventHandlerRegistry.

virtual csHandlerID iEventHandlerRegistry::RegisterID ( iEventHandler  )  [pure 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.

Implemented in csEventHandlerRegistry.

virtual void iEventHandlerRegistry::ReleaseID ( iEventHandler  )  [pure virtual]

Used when an iEventHandler is destroyed to remove our reference.

Implemented in csEventHandlerRegistry.

virtual void iEventHandlerRegistry::ReleaseID ( csHandlerID  id  )  [pure virtual]

Used when an iEventHandler is destroyed to remove our reference.

Implemented in csEventHandlerRegistry.


The documentation for this struct was generated from the following file:
Generated for Crystal Space by doxygen 1.4.7