Queue implementation using a native C++ array as data storage.
More...
#include <StaticQueue.hpp>
template<class T>
class StaticQueue< T >
Queue implementation using a native C++ array as data storage.
- Author
- Douglas De Rizzo Meneghetti (dougl.nosp@m.asri.nosp@m.zzom@.nosp@m.gmai.nosp@m.l.com)
- Date
- 2017-6-14Queue implementation using a native C++ array as data storage.
- Template Parameters
-
T | The type of object the data structure will contain |
Definition at line 17 of file StaticQueue.hpp.
◆ StaticQueue() [1/2]
Create a fixed-size queue.
- Parameters
-
size | the size of the queue |
Definition at line 27 of file StaticQueue.hpp.
◆ StaticQueue() [2/2]
create the structure and populate it with the data from the array
- Parameters
-
data | an array with data with which the structure will be initialized |
Definition at line 35 of file StaticQueue.hpp.
◆ ~StaticQueue()
◆ dequeue()
Remove an element from the queue.
- Returns
- the value that is being removed
Implements Queue< T >.
Definition at line 55 of file StaticQueue.hpp.
57 throw std::out_of_range(
"The queue is empty.");
bool isEmpty()
Check whether the structure is empty.
◆ enqueue()
Add an element to the end of the queue.
- Parameters
-
val | the value to be added to the queue |
Implements Queue< T >.
Definition at line 45 of file StaticQueue.hpp.
47 throw std::out_of_range(
"The queue is full.");
bool isFull()
Check whether the structure is full.
◆ getName()
Provides the name of the data structure as a string representation.
- Returns
- name of the data structure
Implements DataStructure.
Definition at line 23 of file StaticQueue.hpp.
23 {
return "Static Queue"; }
◆ getSize()
Outputs the number of elements stored in the structure.
- Returns
- number of elements stored in the structure
Implements DataStructure.
Definition at line 72 of file StaticQueue.hpp.
◆ isEmpty()
◆ isFull()
◆ peek()
See the first value from the queue, without removing it.
- Returns
- The first value on the queue
Implements Queue< T >.
Definition at line 66 of file StaticQueue.hpp.
68 throw std::out_of_range(
"The queue is empty.");
bool isEmpty()
Check whether the structure is empty.
◆ count
◆ data
◆ head
◆ size
◆ tail
The documentation for this class was generated from the following file: