KS.Reactor.ksEventSet< T > Class Template Reference

Tracks events in a hashset. More...

Public Member Functions

delegate void ForEachCallback (T item)
 
void Remove (T item)
 Remove an item from the event set More...
 
void ForEach (ForEachCallback callback)
 Iterate and invoke the callback on all items. More...
 

Static Public Member Functions

static ksEventSet< T > operator+ (ksEventSet< T > lhs, T rhs)
 Adds an event handler to the event. More...
 
static ksEventSet< T > operator- (ksEventSet< T > lhs, T rhs)
 Adds an event handler to the event. More...
 

Public Attributes

List< T > Handlers = new List<T>()
 

Detailed Description

Tracks events in a hashset.

Template Parameters
T

Member Function Documentation

◆ ForEach()

void KS.Reactor.ksEventSet< T >.ForEach ( ForEachCallback  callback)

Iterate and invoke the callback on all items.

Parameters
callback

◆ operator+()

static ksEventSet<T> KS.Reactor.ksEventSet< T >.operator+ ( ksEventSet< T >  lhs,
rhs 
)
static

Adds an event handler to the event.

Parameters
lhsEvent to add handler to.
rhsHandler to add.
Returns
lhs

◆ operator-()

static ksEventSet<T> KS.Reactor.ksEventSet< T >.operator- ( ksEventSet< T >  lhs,
rhs 
)
static

Adds an event handler to the event.

Parameters
lhsEvent to add handler to.
rhsHandler to add.
Returns
lhs

◆ Remove()

void KS.Reactor.ksEventSet< T >.Remove ( item)

Remove an item from the event set

Parameters
itemItem to be removed
Returns
True if the remove was handled immediately. If the removal was not immediate, ProcessRemovals() must be invoked.