WIP
DirectOutput framework for virtual pinball cabinets WIP
Go to:
Overview 
InputQueue.cs
Go to the documentation of this file.
1 using System;
2 using System.Collections.Generic;
3 using DirectOutput.Table;
4 
5 namespace DirectOutput.PinballSupport
6 {
7 
12  public class InputQueue : Queue<TableElementData>
13  {
14  private object QueueLocker = new object();
15 
16 
23  public void Enqueue(Char TableElementTypeChar, int Number, int Value)
24  {
25  Enqueue(new TableElementData(TableElementTypeChar, Number, Value));
26  }
27 
28 
34  {
35  lock (QueueLocker)
36  {
37  base.Enqueue(TableElementData);
38  }
39  }
40 
41 
42  public void Enqueue(string TableElementName, int Value)
43  {
44  if (TableElementName.IsNullOrWhiteSpace()) return;
45 
46  Enqueue(new TableElementData(TableElementName.Replace(" ","_"), Value));
47  }
48 
49 
50 
56  {
57  lock (QueueLocker)
58  {
59  return base.Dequeue();
60  }
61  }
62 
67  public new TableElementData Peek()
68  {
69  lock (QueueLocker)
70  {
71  return base.Peek();
72  }
73  }
74 
75 
82  public new int Count
83  {
84  get
85  {
86 
87  lock (QueueLocker)
88  {
89  return base.Count;
90  }
91  }
92  }
93 
94 
98  public new void Clear()
99  {
100  lock (QueueLocker)
101  {
102  base.Clear();
103  }
104  }
105 
106 
107 
108  }
109 }
Simple queue of TableElementData objects. Used by the framework to separate data receiving and data ...
Definition: InputQueue.cs:12
void Enqueue(Char TableElementTypeChar, int Number, int Value)
Enqueues input data.
Definition: InputQueue.cs:23
new TableElementData Dequeue()
Dequeues the TableElementData object at the front of the queue.
Definition: InputQueue.cs:55
new void Clear()
Clears all elements from the queue.
Definition: InputQueue.cs:98
Data representing the state of a table emlement
void Enqueue(string TableElementName, int Value)
Definition: InputQueue.cs:42
new TableElementData Peek()
Returns the TableElementData object at the front of the queue without dequeueing it.
Definition: InputQueue.cs:67
The Table namespace contains all table specific classes like the Table class itself, TableElement and effect assigment classes.
Definition: Table.cs:14
new void Enqueue(TableElementData TableElementData)
Enqueues the specified TableElementData object.
Definition: InputQueue.cs:33