registry.js

Summary
registry.js
bbop.registryBBOP generic lightweight listener/callback registry system.
Functions
registryContructor for BBOP registry.
registerAdd the specified function from the registry, with an optional relative priority against other callback functions.
unregisterRemove the specified function from the registry.
get_callbacksGeneric getter for callback functions, returns by priority.
apply_callbacksGeneric runner for prioritized callbacks with various arguments and an optional change in context..

bbop.registry

BBOP generic lightweight listener/callback registry system.

Summary
Functions
registryContructor for BBOP registry.
registerAdd the specified function from the registry, with an optional relative priority against other callback functions.
unregisterRemove the specified function from the registry.
get_callbacksGeneric getter for callback functions, returns by priority.
apply_callbacksGeneric runner for prioritized callbacks with various arguments and an optional change in context..

Functions

registry

bbop.registry = function(evt_list)

Contructor for BBOP registry.  Takes a list of event categories as strings.

Arguments

evt_lista list of strings that identify the events to be used

Returns

bbop registry object

register

this.register = function(category,
function_id,
in_function,
in_priority)

Add the specified function from the registry, with an optional relative priority against other callback functions.

The in_priority value is relative to others in the category, with a higher priority...getting priority.

Parameters

categorystring; ont of the pre-defined categories
function_idstring; a unique string to identify a function
in_functionfunction
in_priority[optional] number

Returns

n/a

See also

<apply>

unregister

this.unregister = function(category,
function_id)

Remove the specified function from the registry.  Must specify a legitimate category and the function id of the function in it.

Parameters

categorystring
function_idstring

Returns

n/a

get_callbacks

this.get_callbacks = function(category)

Generic getter for callback functions, returns by priority.

Parameters

categorystring

Returns

an ordered (by priority) list of function_id strings

apply_callbacks

this.apply_callbacks = function(category,
arg_list,
context)

Generic runner for prioritized callbacks with various arguments and an optional change in context..

Parameters

categorystring
arg_lista list of arguments to pass to the function in the category
context[optional] the context to apply the arguments in

Returns

n/a

bbop.registry = function(evt_list)
Contructor for BBOP registry.
this.register = function(category,
function_id,
in_function,
in_priority)
Add the specified function from the registry, with an optional relative priority against other callback functions.
this.unregister = function(category,
function_id)
Remove the specified function from the registry.
this.get_callbacks = function(category)
Generic getter for callback functions, returns by priority.
this.apply_callbacks = function(category,
arg_list,
context)
Generic runner for prioritized callbacks with various arguments and an optional change in context..
Close