Event

An event structure representing a one-to-many function/delegate relationship. It mimics a function by overriding the call operator. It also implements the bidirectional range interface.

Destructor

~this
~this()
Undocumented in source.

Members

Aliases

ListenerType
alias ListenerType = T

The listeners' type.

ParamTypes
alias ParamTypes = ParameterTypeTuple!T

The event's argument type tuple.

ReturnType
alias ReturnType = void

The event's return type.

ReturnType
alias ReturnType = void
Undocumented in source.
ReturnType
alias ReturnType = ReturnTypeTpl!T[]
Undocumented in source.

Functions

append
void append(T[] listeners)

Appends a listener to the listener collection.

back
T back()

Get the last listener or throw an error if there are no listeners. Part of the bidirectional range interface.

call
void call(ParamTypes params)

Calls all the registered listeners in order.

clear
void clear()

Clears all listeners.

empty
bool empty()

A boolean property indicating whether there are listeners. Part of the bidirectional range interface.

front
T front()

Get the first listener or throw an error if there are no listeners. Part of the bidirectional range interface.

listeners
auto listeners()

A range array of all the listeners.

opCall
void opCall(ParamTypes params)

Aliases $(DDOC_PSYMBOL call).

opOpAssign
void opOpAssign(T listener)

Aliases $(DDOC_PSYMBOL append).

opOpAssign
void opOpAssign(T listener)

Aliases $(DDOC_PSYMBOL remove).

opSlice
auto opSlice()
popBack
void popBack()

Remove the last listener or throw an error if there are no listeners. Part of the bidirectional range interface.

popFront
void popFront()

Remove the first listener or throw an error if there are no listeners. Part of the bidirectional range interface.

prepend
void prepend(T[] listeners)

Prepend listeners to the listener collection.

remove
void remove(T[] listeners)

Removed all occurrences of the given listeners.

save
auto save()

Copies the event to allow multiple range-like iteration. Part of the bidirectional range interface.

size
size_t size()

The number of listeners.

Parameters

T

The listener type this event contains.

Meta