## Public API Reference

- Main Page
- Modules
- Namespaces
- Classes
- Files
- Related Pages

- Alphabetical List
- Class List
- Class Hierarchy
- Class Members

# 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:

[legend]
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 csString &)
| Get a csHandlerID based upon some string.
iEventHandler * | GetHandler (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 (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 const | IsInstance (csHandlerID id)
| returns true if id is a handler instance (i.e., not a generic name).
bool const | 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.
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.

## Static Public Member Functions

static csHandlerID | GetGeneric (iObjectRegistry *reg, csHandlerID id)
static csHandlerID | GetGenericID (iObjectRegistry *reg, const csString &name)
static csHandlerID | GetGenericPostBoundID (iObjectRegistry *reg, csHandlerID id)
static csHandlerID | GetGenericPreBoundID (iObjectRegistry *reg, csHandlerID id)
static iEventHandler * | GetHandler (iObjectRegistry *reg, csHandlerID id)
static csHandlerID | GetID (iObjectRegistry *reg, iEventHandler *h)
static const char * | GetString (iObjectRegistry *reg, csHandlerID id)
static bool | IsInstance (iObjectRegistry *reg, csHandlerID id)
static bool | IsInstanceOf (iObjectRegistry *reg, csHandlerID instanceid, csHandlerID genericid)
static void | ReleaseID (iObjectRegistry *reg, iEventHandler *h)
static void | ReleaseID (iObjectRegistry *reg, csHandlerID id)

## 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 47 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 csString & |  | ) | `[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 | ( | 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 const csEventHandlerRegistry::IsInstance | ( | csHandlerID | id | ) | `[virtual]`

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

bool const 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.

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:

- csutil/eventhandlers.h