Fiber
Fibers Lighweight Cooperative Multitasking
Askowl.Emitter Class Reference

Cached C# Action instances using the observer pattern More...

Inheritance diagram for Askowl.Emitter:

Public Member Functions

delegate void Action (Emitter emitter)
 Returns false to remove listener from future firings More...
 
Context< T > ()
 Retrieve the context as a class type - null for none or wrong type More...
 
Emitter Context< T > (T value)
 Set the context to an instance of a type More...
 
Context< T > (string name)
 Retrieve the context as a class type - null for none or wrong type More...
 
Emitter Context< T > (string name, T value)
 Set the context to an instance of a type More...
 
void Fire ()
 The owner shoots and all the listeners hear More...
 
Emitter Listen (Action action)
 Ask an emitter to tell me too More...
 
Emitter Remove (Action action)
 Remove a listener if it is in the list More...
 
Emitter StopListening ()
 Remove the listener currently being acted on More...
 
void RemoveAllListeners ()
 Removes all listeners More...
 
void Dispose ()
 Call when we are done with this emitter. More...
 
override string ToString ()
 

Public Attributes

int Firings
 Count of the number of times an emitter has fired More...
 
bool Waiting => listeners.Count > 0
 Return true if we have one or more listeners registered More...
 

Static Public Attributes

static Emitter Instance => Cache<Emitter>.Instance
 Retrieve an emitter from recycling or new More...
 

Properties

static Emitter SingleFireInstance [get]
 Fire once then dispose of the emitter More...
 

Detailed Description

Member Function Documentation

◆ Action()

delegate void Askowl.Emitter.Action ( Emitter  emitter)

◆ Context< T >() [1/4]

T Askowl.Emitter.Context< T > ( )

Retrieve the context as a class type - null for none or wrong type

Type Constraints
T :class 
T :context 
T :typeof 
T :T 
T :Value 
T :as 
T :T 

◆ Context< T >() [2/4]

Emitter Askowl.Emitter.Context< T > ( value)

Set the context to an instance of a type

Type Constraints
T :class 

Definition at line 32 of file Emitter.cs.

◆ Context< T >() [3/4]

T Askowl.Emitter.Context< T > ( string  name)

Retrieve the context as a class type - null for none or wrong type

Type Constraints
T :class 
T :context 
T :name 
T :Value 
T :as 
T :T 

◆ Context< T >() [4/4]

Emitter Askowl.Emitter.Context< T > ( string  name,
value 
)

Set the context to an instance of a type

Type Constraints
T :class 

Definition at line 41 of file Emitter.cs.

◆ Dispose()

void Askowl.Emitter.Dispose ( )

◆ Fire()

void Askowl.Emitter.Fire ( )

◆ Listen()

Emitter Askowl.Emitter.Listen ( Action  action)

Ask an emitter to tell me too

Definition at line 70 of file Emitter.cs.

◆ Remove()

Emitter Askowl.Emitter.Remove ( Action  action)

◆ RemoveAllListeners()

void Askowl.Emitter.RemoveAllListeners ( )

Removes all listeners

Definition at line 93 of file Emitter.cs.

◆ StopListening()

Emitter Askowl.Emitter.StopListening ( )

Member Data Documentation

◆ Firings

int Askowl.Emitter.Firings

◆ Instance

Emitter Askowl.Emitter.Instance => Cache<Emitter>.Instance
static

◆ Waiting

bool Askowl.Emitter.Waiting => listeners.Count > 0

Property Documentation

◆ SingleFireInstance

Emitter Askowl.Emitter.SingleFireInstance
staticget

The documentation for this class was generated from the following file: