1 /*******************************************************************************
2 
3     Base class template for a queue storing items of a specific type.
4 
5     Copyright:
6         Copyright (c) 2009-2016 dunnhumby Germany GmbH.
7         All rights reserved.
8 
9     License:
10         Boost Software License Version 1.0. See LICENSE_BOOST.txt for details.
11         Alternatively, this file may be distributed under the terms of the Tango
12         3-Clause BSD License (see LICENSE_BSD.txt for details).
13 
14 *******************************************************************************/
15 
16 module ocean.util.container.queue.model.IQueue;
17 
18 
19 
20 
21 import ocean.util.container.queue.model.IQueueInfo;
22 
23 
24 
25 /*******************************************************************************
26 
27     Base class template for a queue storing items of a specific type.
28 
29 *******************************************************************************/
30 
31 public interface IQueue ( T ) : IQueueInfo
32 {
33     /***************************************************************************
34 
35         Removes all items from the queue.
36 
37     ***************************************************************************/
38 
39     public void clear ( );
40 
41 
42     /***************************************************************************
43 
44         Reserves space for an element of the size T.sizeof at the queue and
45         returns a pointer to it.
46         The value of the element must then be copied to the location pointed to
47         before calling push() or pop() the next time.
48 
49         Returns:
50             pointer to the element pushed into the queue or null if the queue is
51             full.
52 
53     ***************************************************************************/
54 
55     public T* push ( );
56 
57 
58     /***************************************************************************
59 
60         Pushes an element into the queue.
61 
62         Params:
63             element = element to push (will be left unchanged)
64 
65         Returns:
66             true on success or false if the queue is full.
67 
68     ***************************************************************************/
69 
70     public bool push ( T element );
71 
72 
73     /***************************************************************************
74 
75         Pops an element from the queue and returns a pointer to that element.
76         The value of the element must then be copied from the location pointed
77         to before calling push() or pop() the next time.
78 
79         Returns:
80             pointer to the element popped from the queue or null if the queue is
81             empty.
82 
83     ***************************************************************************/
84 
85     public T* pop ( );
86 
87 
88     /***************************************************************************
89 
90         NOT IMPLEMENTED
91 
92         Peek at the next item that would be popped from the queue.
93 
94         Returns:
95             pointer to the element that would be popped from queue,
96             may be null if queue is empty
97 
98     ***************************************************************************/
99 
100     //public T* peek ( );
101 }
102