DeveelDB  20151217
complete SQL database system, primarly developed for .NET/Mono frameworks
Public Member Functions | Protected Member Functions | Private Attributes | List of all members
Deveel.Data.Diagnostics.ContextExtensions.DelegateRouter< TEvent > Class Template Reference
Inheritance diagram for Deveel.Data.Diagnostics.ContextExtensions.DelegateRouter< TEvent >:
Deveel.Data.Diagnostics.ThreadedQueue< TEvent > Deveel.Data.Diagnostics.IEventRouter

Public Member Functions

 DelegateRouter (Action< TEvent > route, Func< TEvent, bool > condition)
 
bool CanRoute (IEvent @event)
 
void RouteEvent (IEvent e)
 Routes the input event to the final destination. More...
 
- Public Member Functions inherited from Deveel.Data.Diagnostics.ThreadedQueue< TEvent >
void Dispose ()
 

Protected Member Functions

override void Consume (TEvent message)
 
- Protected Member Functions inherited from Deveel.Data.Diagnostics.ThreadedQueue< TEvent >
 ThreadedQueue ()
 
abstract void Consume (TMessage message)
 
void Enqueue (TMessage message)
 
virtual void Dispose (bool disposing)
 

Private Attributes

Func< TEvent, bool > condition
 
Action< TEvent > route
 

Additional Inherited Members

- Public Attributes inherited from Deveel.Data.Diagnostics.ThreadedQueue< TEvent >
const int DefaultThreadCount
 
- Properties inherited from Deveel.Data.Diagnostics.ThreadedQueue< TEvent >
virtual int ThreadCount [get]
 

Detailed Description

Type Constraints
TEvent :class 
TEvent :IEvent 

Definition at line 57 of file ContextExtensions.cs.

Constructor & Destructor Documentation

Deveel.Data.Diagnostics.ContextExtensions.DelegateRouter< TEvent >.DelegateRouter ( Action< TEvent >  route,
Func< TEvent, bool >  condition 
)
inline

Definition at line 61 of file ContextExtensions.cs.

Member Function Documentation

bool Deveel.Data.Diagnostics.ContextExtensions.DelegateRouter< TEvent >.CanRoute ( IEvent event)
inline

Implements Deveel.Data.Diagnostics.IEventRouter.

Definition at line 70 of file ContextExtensions.cs.

70  {
71  if (!(@event is TEvent))
72  return false;
73 
74  if (condition == null)
75  return true;
76 
77  return condition((TEvent)@event);
78  }
override void Deveel.Data.Diagnostics.ContextExtensions.DelegateRouter< TEvent >.Consume ( TEvent  message)
inlineprotected

Definition at line 66 of file ContextExtensions.cs.

66  {
67  route(message);
68  }
void Deveel.Data.Diagnostics.ContextExtensions.DelegateRouter< TEvent >.RouteEvent ( IEvent  e)
inline

Routes the input event to the final destination.

Parameters
eThe system event to be routed.

Implements Deveel.Data.Diagnostics.IEventRouter.

Definition at line 80 of file ContextExtensions.cs.

80  {
81  Enqueue((TEvent)e);
82  }

Member Data Documentation

Func<TEvent, bool> Deveel.Data.Diagnostics.ContextExtensions.DelegateRouter< TEvent >.condition
private

Definition at line 58 of file ContextExtensions.cs.

Action<TEvent> Deveel.Data.Diagnostics.ContextExtensions.DelegateRouter< TEvent >.route
private

Definition at line 59 of file ContextExtensions.cs.


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