## Public API Reference

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

- File List
- File Members

# csutil/eventhandlers.h File Reference

Event handler naming, name management, indexing, and instantiation. More...

`#include "cssysdef.h"`
`#include "csextern.h"`
`#include "iutil/eventnames.h"`
`#include "iutil/eventhandlers.h"`
`#include "iutil/eventh.h"`
`#include "csutil/csstring.h"`
`#include "csutil/eventnames.h"`
`#include "csutil/scf_implementation.h"`
`#include "csutil/hash.h"`
`#include "csutil/strset.h"`
`#include "csutil/ref.h"`

Go to the source code of this file.

## Classes

class | csEventHandlerRegistry
| 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...
class | FrameSignpost_2DConsole
class | FrameSignpost_3D2D
class | FrameSignpost_ConsoleDebug
class | FrameSignpost_DebugFrame
class | FrameSignpost_Logic3D
struct | iFrameEventSignpost

## Defines

#define | CS_EVENTHANDLER_PHASE_2D(x)
| Use this macro to declare your event handler as wanting to handle the csevFrame event in the "2D" phase (i.e., after any handlers in the "3D" phase and before any handlers in the "console" phase).
#define | CS_EVENTHANDLER_PHASE_3D(x)
| Use this macro to declare your event handler as wanting to handle the csevFrame event in the "3D" phase (i.e., after any handlers in the "logic" phase and before any handlers in the "2D" phase).
#define | CS_EVENTHANDLER_PHASE_CONSOLE(x)
| Use this macro to declare your event handler as wanting to handle the csevFrame event in the "Console" phase (i.e., after any handlers in the "2D" phase and before any handlers in the "debug" phase).
#define | CS_EVENTHANDLER_PHASE_DEBUG(x)
| Use this macro to declare your event handler as wanting to handle the csevFrame event in the "Debug" phase (i.e., after any handlers in the "Console" phase and before any handlers in the "Frame" phase).
#define | CS_EVENTHANDLER_PHASE_FRAME(x)
| Use this macro to declare your event handler as wanting to handle the csevFrame event in the "Debug" phase (i.e., after any handlers in the "Console" phase and before any handlers in the "Frame" phase).
#define | CS_EVENTHANDLER_PHASE_LOGIC(x)
| Use this macro to declare your event handler as wanting to handle the csevFrame event in the "logic" phase (i.e., before any handlers in the "3D" phase).

## Detailed Description

Event handler naming, name management, indexing, and instantiation.

Definition in file eventhandlers.h.

## Define Documentation

#define CS_EVENTHANDLER_PHASE_2D | ( | x |  | ) |

Value:

    CS_EVENTHANDLER_NAMES(x)                                                \
    CS_EVENTHANDLER_DEFAULT_INSTANCE_CONSTRAINTS                            \
    CS_CONST_METHOD virtual const csHandlerID * GenericPrec                 \
    (csRef<iEventHandlerRegistry> &r1, csRef<iEventNameRegistry> &r2,       \
     csEventID event) const {                                               \
      static csHandlerID precConstraint[3];                                 \
      if (event != csevFrame(r2))                                           \
        return 0;                                                           \
      precConstraint[0] = FrameSignpost_Logic3D::StaticID(r1);              \
      precConstraint[1] = FrameSignpost_3D2D::StaticID(r1);                 \
      precConstraint[2] = CS_HANDLERLIST_END;                               \
      return precConstraint;                                                \
    }                                                                       \
    CS_CONST_METHOD virtual const csHandlerID * GenericSucc                 \
    (csRef<iEventHandlerRegistry> &r1, csRef<iEventNameRegistry> &r2,       \
     csEventID event) const {                                               \
      static csHandlerID succConstraint[4];                                 \
      if (event != csevFrame(r2))                                           \
        return 0;                                                           \
      succConstraint[0] = FrameSignpost_2DConsole::StaticID(r1);            \
      succConstraint[1] = FrameSignpost_ConsoleDebug::StaticID(r1);         \
      succConstraint[2] = FrameSignpost_DebugFrame::StaticID(r1);           \
      succConstraint[3] = CS_HANDLERLIST_END;                               \
      return succConstraint;                                                \
    }

Use this macro to declare your event handler as wanting to handle the csevFrame event in the "2D" phase (i.e., after any handlers in the "3D" phase and before any handlers in the "console" phase).

Definition at line 389 of file eventhandlers.h.

#define CS_EVENTHANDLER_PHASE_3D | ( | x |  | ) |

Value:

    CS_EVENTHANDLER_NAMES(x)                                                \
    CS_EVENTHANDLER_DEFAULT_INSTANCE_CONSTRAINTS                            \
    CS_CONST_METHOD virtual const csHandlerID * GenericPrec                 \
    (csRef<iEventHandlerRegistry> &r1, csRef<iEventNameRegistry> &r2,       \
     csEventID event) const {                                               \
      static csHandlerID precConstraint[2];                                 \
      if (event != csevFrame(r2))                                           \
        return 0;                                                           \
      precConstraint[0] = FrameSignpost_Logic3D::StaticID(r1);              \
      precConstraint[1] = CS_HANDLERLIST_END;                               \
      return precConstraint;                                                \
    }                                                                       \
    CS_CONST_METHOD virtual const csHandlerID * GenericSucc                 \
    (csRef<iEventHandlerRegistry> &r1, csRef<iEventNameRegistry> &r2,       \
     csEventID event) const {                                               \
      static csHandlerID succConstraint[5];                                 \
      if (event != csevFrame(r2))                                           \
        return 0;                                                           \
      succConstraint[0] = FrameSignpost_3D2D::StaticID(r1);                 \
      succConstraint[1] = FrameSignpost_2DConsole::StaticID(r1);            \
      succConstraint[2] = FrameSignpost_ConsoleDebug::StaticID(r1);         \
      succConstraint[3] = FrameSignpost_DebugFrame::StaticID(r1);           \
      succConstraint[4] = CS_HANDLERLIST_END;                               \
      return succConstraint;                                                \
    }

Use this macro to declare your event handler as wanting to handle the csevFrame event in the "3D" phase (i.e., after any handlers in the "logic" phase and before any handlers in the "2D" phase).

Definition at line 356 of file eventhandlers.h.

#define CS_EVENTHANDLER_PHASE_CONSOLE | ( | x |  | ) |

Value:

    CS_EVENTHANDLER_NAMES(x)                                                \
    CS_EVENTHANDLER_DEFAULT_INSTANCE_CONSTRAINTS                            \
    CS_CONST_METHOD virtual const csHandlerID * GenericPrec                 \
    (csRef<iEventHandlerRegistry> &r1, csRef<iEventNameRegistry> &r2,       \
     csEventID event) const {                                               \
      static csHandlerID precConstraint[4];                                 \
      if (event != csevFrame(r2))                                           \
        return 0;                                                           \
      precConstraint[0] = FrameSignpost_Logic3D::StaticID(r1);              \
      precConstraint[1] = FrameSignpost_3D2D::StaticID(r1);                 \
      precConstraint[2] = FrameSignpost_2DConsole::StaticID(r1);            \
      precConstraint[3] = CS_HANDLERLIST_END;                               \
      return precConstraint;                                                \
    }                                                                       \
    CS_CONST_METHOD virtual const csHandlerID * GenericSucc                 \
    (csRef<iEventHandlerRegistry> &r1, csRef<iEventNameRegistry> &r2,       \
     csEventID event) const {                                               \
      static csHandlerID succConstraint[3];                                 \
      if (event != csevFrame(r2))                                           \
        return 0;                                                           \
      succConstraint[0] = FrameSignpost_ConsoleDebug::StaticID(r1);         \
      succConstraint[1] = FrameSignpost_DebugFrame::StaticID(r1);           \
      succConstraint[2] = CS_HANDLERLIST_END;                               \
      return succConstraint;                                                \
    }

Use this macro to declare your event handler as wanting to handle the csevFrame event in the "Console" phase (i.e., after any handlers in the "2D" phase and before any handlers in the "debug" phase).

Definition at line 422 of file eventhandlers.h.

#define CS_EVENTHANDLER_PHASE_DEBUG | ( | x |  | ) |

Value:

    CS_EVENTHANDLER_NAMES(x)                                                \
    CS_EVENTHANDLER_DEFAULT_INSTANCE_CONSTRAINTS                            \
    CS_CONST_METHOD virtual const csHandlerID * GenericPrec                 \
    (csRef<iEventHandlerRegistry> &r1, csRef<iEventNameRegistry> &r2,       \
     csEventID event) const {                                               \
      static csHandlerID precConstraint[5];                                 \
      if (event != csevFrame(r2))                                           \
        return 0;                                                           \
      precConstraint[0] = FrameSignpost_Logic3D::StaticID(r1);              \
      precConstraint[0] = FrameSignpost_3D2D::StaticID(r1);                 \
      precConstraint[0] = FrameSignpost_2DConsole::StaticID(r1);            \
      precConstraint[0] = FrameSignpost_ConsoleDebug::StaticID(r1);         \
      precConstraint[1] = CS_HANDLERLIST_END;                               \
      return precConstraint;                                                \
    }                                                                       \
    CS_CONST_METHOD virtual const csHandlerID * GenericSucc                 \
    (csRef<iEventHandlerRegistry> &r1, csRef<iEventNameRegistry> &r2,       \
     csEventID event) const {                                               \
      static csHandlerID succConstraint[2];                                 \
      if (event != csevFrame(r2))                                           \
        return 0;                                                           \
      succConstraint[0] = FrameSignpost_DebugFrame::StaticID(r1);           \
      succConstraint[1] = CS_HANDLERLIST_END;                               \
      return succConstraint;                                                \
    }

Use this macro to declare your event handler as wanting to handle the csevFrame event in the "Debug" phase (i.e., after any handlers in the "Console" phase and before any handlers in the "Frame" phase).

Definition at line 455 of file eventhandlers.h.

#define CS_EVENTHANDLER_PHASE_FRAME | ( | x |  | ) |

Value:

    CS_EVENTHANDLER_NAMES(x)                                                \
    CS_EVENTHANDLER_DEFAULT_INSTANCE_CONSTRAINTS                            \
    CS_CONST_METHOD virtual const csHandlerID * GenericPrec                 \
    (csRef<iEventHandlerRegistry> &r1, csRef<iEventNameRegistry> &r2,       \
     csEventID event) const {                                               \
      static csHandlerID precConstraint[6];                                 \
      if (event != csevFrame(r2))                                           \
        return 0;                                                           \
      precConstraint[0] = FrameSignpost_Logic3D::StaticID(r1);              \
      precConstraint[0] = FrameSignpost_3D2D::StaticID(r1);                 \
      precConstraint[0] = FrameSignpost_2DConsole::StaticID(r1);            \
      precConstraint[0] = FrameSignpost_ConsoleDebug::StaticID(r1);         \
      precConstraint[0] = FrameSignpost_DebugFrame::StaticID(r1);           \
      precConstraint[1] = CS_HANDLERLIST_END;                               \
      return precConstraint;                                                \
    }                                                                       \
    CS_CONST_METHOD virtual const csHandlerID * GenericSucc                 \
    (csRef<iEventHandlerRegistry> &, csRef<iEventNameRegistry> &,           \
     csEventID) const {                                                     \
      return 0;                                                             \
    }

Use this macro to declare your event handler as wanting to handle the csevFrame event in the "Debug" phase (i.e., after any handlers in the "Console" phase and before any handlers in the "Frame" phase).

Definition at line 488 of file eventhandlers.h.

#define CS_EVENTHANDLER_PHASE_LOGIC | ( | x |  | ) |

Value:

    CS_EVENTHANDLER_NAMES(x)                                                \
    CS_EVENTHANDLER_DEFAULT_INSTANCE_CONSTRAINTS                            \
    CS_CONST_METHOD virtual const csHandlerID * GenericPrec                 \
    (csRef<iEventHandlerRegistry> &, csRef<iEventNameRegistry> &,           \
     csEventID) const {                                                     \
      return 0;                                                             \
    }                                                                       \
    CS_CONST_METHOD virtual const csHandlerID * GenericSucc                 \
    (csRef<iEventHandlerRegistry> &r1, csRef<iEventNameRegistry> &r2,       \
     csEventID event) const {                                               \
      static csHandlerID succConstraint[6];                                 \
      if (event != csevFrame(r2))                                           \
        return 0;                                                           \
      succConstraint[0] = FrameSignpost_Logic3D::StaticID(r1);              \
      succConstraint[1] = FrameSignpost_3D2D::StaticID(r1);                 \
      succConstraint[2] = FrameSignpost_2DConsole::StaticID(r1);            \
      succConstraint[3] = FrameSignpost_ConsoleDebug::StaticID(r1);         \
      succConstraint[4] = FrameSignpost_DebugFrame::StaticID(r1);           \
      succConstraint[5] = CS_HANDLERLIST_END;                               \
      return succConstraint;                                                \
    }

Use this macro to declare your event handler as wanting to handle the csevFrame event in the "logic" phase (i.e., before any handlers in the "3D" phase).

Definition at line 327 of file eventhandlers.h.