Arbit - project tracking

Arbit - project tracking

API documentation :: Docs For Class arbitSignalSlot

Core::arbitSignalSlot

Class arbitSignalSlot

Arbit signal slot implementation The arbit specific signal slot implementation has some special requirements, which are not commonly included in signal slot implementations, so that we got our own implementation.

  • Signal documentation
We enforce, that each signal is documented, because we want to optionally expose the signals to the user, so that they may be notified about emitted signals.

Arbit signal slot implementation The arbit specific signal slot implementation has some special requirements, which are not commonly included in signal slot implementations, so that we got our own implementation. The special requirements are:

  • Signal documentation
We enforce, that each signal is documented, because we want to optionally expose the signals to the user, so that they may be notified about emitted signals.
  • Signal module association
Each signal stays associated with the module (or core), which threw the signal, so that we can generate a clear signal overview page.
  • Invalid signal detection
To ensure documentation and make debugging easier we only signals to be emitted, which are defined by the modules.
  • Signal parameter enforcement
Each signal may only contain one single clearly defined parameter, a signal specific struct, which offers more information about the thrown signal. See protocol from 14.02.08 for details. The signal struct always has the name <signalName>Struct, so that it will be easy to find more documentation about the signals data. The class provides core functionality and is mostly called statically. It is impossible to replace this class and / or extend this class in arbit.

Author(s):
Version:   $Revision: 1236 $
License:   GPL

Constants

ALL_SLOTS = 1 Constant used as a placeholder, if somethings wants to register for all availaable slots.

Constant used as a placeholder, if somethings wants to register for all availaable slots.

Member Variables

protected static array $moduleSignals
Array containing the signal module assiciation and the signal descriptions. documentation purpose.

Array containing the signal module assiciation and the signal descriptions. This array is maintained mainly for application user documentation purpose.

protected static array $signals
Array of defined signals for fast checks, if the provided signal is valid.

Array of defined signals for fast checks, if the provided signal is valid. The array looks like:

  1.   array(
  2.       'signalName' => true,
  3.       ...
  4.   )

protected static array $slots
Array with slots for each signal.

Array with slots for each signal. The array looks like:

  1.   array(
  2.       'signalName' = array(
  3.           'slot1',
  4.           ...
  5.       ),
  6.       ...
  7.   )

Method Summary

public static void emit( $signal , $data )
Emit a signal This method is used to emit signals from a module. parameter containing the signal data, which needs to be an object of the class arbit<signalName>Struct, which extends the arbitSignalSlotStruct base struct.
public static array getSignals( )
Get list of defined signals.
public static void registerSignals( $module , $signals )
Register a set of signals.
public static void registerSlots( $slots )
Register a set of slots.

Methods

emit

static void emit( string $signal , arbitSignalSlotStruct $data )

Emit a signal This method is used to emit signals from a module. parameter containing the signal data, which needs to be an object of the class arbit<signalName>Struct, which extends the arbitSignalSlotStruct base struct.

Emit a signal This method is used to emit signals from a module. You must provide a parameter containing the signal data, which needs to be an object of the class arbit<signalName>Struct, which extends the arbitSignalSlotStruct base struct. All registered slots will be called in any order.

Parameters:
Name Type Description
$signal string
$data arbitSignalSlotStruct

getSignals

static array getSignals( )

Get list of defined signals.

Get list of defined signals. Returns a list with all defined signals for all modules, associated with their description. The array will look like:

  1.   array(
  2.       'core' => array(
  3.           'signalName' => 'Signal description.',
  4.           ...
  5.       ),
  6.       ...
  7.   )

registerSignals

static void registerSignals( string $module , $signals )

Register a set of signals.

Register a set of signals. Registers a set of signals for a module. The signal array has to look like specified in the arbitModuleDefintion class:

  1.   array(
  2.       'signalName' => 'Signal description.',
  3.       ...
  4.   )

Parameters:
Name Type Description
$module string
$signals array

registerSlots

static void registerSlots( $slots )

Register a set of slots.

Register a set of slots. Registers a set of slots for the given signals. The provided array has to look like specified in the arbitModuleDefintion class:

  1.   array(
  2.       'signalName' => 'arbitFooModuleController::signalHandler',
  3.       ...
  4.   )

Parameters:
Name Type Description
$slots array
Documentation generated on Mon, 05 Apr 2010 14:02:18 +0200 by phpDocumentor 1.4.3