Description | |
|
A Queue is principally used to process messages asynchronously - they can literally be queued up as if in a buffer, and handled at a different rate to that in which they arrive.
Data is added at the end of the queue, and taken from the start, although methods are provided, such as GetEnumerator and Peek that allow processing over and above this simple first-in, first-out way.
The Queue may be constructed from scratch or from an existing queue or list. Control is provided over the capacity and expansion. |
|
Syntax | |
| Constructor Create ( |
); | Constructor Create ( | Collection : ICollection
; ); | Constructor Create ( | InitialCapacity : Integer
; ); | Constructor Create ( | InitialCapacity : Integer; GrowthFactor : Single ); |
|
Methods | |
| | Clear | Clear (remove) all entries in the current Queue | | Clone | Make a new Queue that is a clone of the current Queue | | Contains | Returns true if the current Queue contains the given Value | | CopyTo | Copies elements from the Queue to a single dimension array | | DeQueue | Remove the item from the beginning of the current Queue | | EnQueue | Add an item to the end of the current Queue | | GetEnumerator | Gets an enumerator to allow reading the elements of the current Queue | | Peek | Peek at, but do not DeQueue the begining item on the current Queue | | ToArray | Copies elements from the Queue to a new single dimension array | | TrimToSize | Removes unused space in the current Queue |
|
|
|
Properties | |
| Count | | Integer | | Gets the number of elements contained in the Queue.
| IsSynchronized | | Boolean | | Gets a value indicating whether access to the Queue is synchronized (thread-safe).
| SyncRoot | | Object | | Gets an object that can be used to synchronize access to the Queue |
|
Delphi Basics links | |
| |
Microsoft MSDN links | |
|
|