![](/media/cache/profiles/Felicito_-_New_Avatar.jpg.50x50_q85.jpg)
Proyecto ABInBev para la tarjeta Guaria 1/2.
VoicePlaylist/playlist.hpp@19:5580a9a54ad5, 2022-07-07 (annotated)
- Committer:
- fmanzano_dtk
- Date:
- Thu Jul 07 16:17:25 2022 +0000
- Revision:
- 19:5580a9a54ad5
- Parent:
- 1:9e821e640117
Sincronizacion;
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
fmanzano_dtk | 1:9e821e640117 | 1 | /** |
fmanzano_dtk | 1:9e821e640117 | 2 | * @file playlist.hpp |
fmanzano_dtk | 1:9e821e640117 | 3 | * @author Felícito Manzano (felicito.manzano@detektor.com.sv) |
fmanzano_dtk | 1:9e821e640117 | 4 | * @brief |
fmanzano_dtk | 1:9e821e640117 | 5 | * https://www.techiedelight.com/queue-implementation-cpp/ |
fmanzano_dtk | 1:9e821e640117 | 6 | * @version 0.1 |
fmanzano_dtk | 1:9e821e640117 | 7 | * @date 2020-11-19 |
fmanzano_dtk | 1:9e821e640117 | 8 | * |
fmanzano_dtk | 1:9e821e640117 | 9 | * @copyright Copyright (c) 2020 |
fmanzano_dtk | 1:9e821e640117 | 10 | * |
fmanzano_dtk | 1:9e821e640117 | 11 | */ |
fmanzano_dtk | 1:9e821e640117 | 12 | |
fmanzano_dtk | 1:9e821e640117 | 13 | #ifndef __PLAYLIST_H |
fmanzano_dtk | 1:9e821e640117 | 14 | #define __PLAYLIST_H |
fmanzano_dtk | 1:9e821e640117 | 15 | |
fmanzano_dtk | 1:9e821e640117 | 16 | #include <iostream> |
fmanzano_dtk | 1:9e821e640117 | 17 | #include <cstdlib> |
fmanzano_dtk | 1:9e821e640117 | 18 | using namespace std; |
fmanzano_dtk | 1:9e821e640117 | 19 | |
fmanzano_dtk | 1:9e821e640117 | 20 | // define default capacity of the queue |
fmanzano_dtk | 1:9e821e640117 | 21 | #define SIZE 10 |
fmanzano_dtk | 1:9e821e640117 | 22 | |
fmanzano_dtk | 1:9e821e640117 | 23 | // Class for queue |
fmanzano_dtk | 1:9e821e640117 | 24 | class queue |
fmanzano_dtk | 1:9e821e640117 | 25 | { |
fmanzano_dtk | 1:9e821e640117 | 26 | int *arr; // array to store queue elements |
fmanzano_dtk | 1:9e821e640117 | 27 | int capacity; // maximum capacity of the queue |
fmanzano_dtk | 1:9e821e640117 | 28 | int front; // front points to front element in the queue (if any) |
fmanzano_dtk | 1:9e821e640117 | 29 | int rear; // rear points to last element in the queue |
fmanzano_dtk | 1:9e821e640117 | 30 | int count; // current size of the queue |
fmanzano_dtk | 1:9e821e640117 | 31 | |
fmanzano_dtk | 1:9e821e640117 | 32 | public: |
fmanzano_dtk | 1:9e821e640117 | 33 | queue(int size = SIZE); // constructor |
fmanzano_dtk | 1:9e821e640117 | 34 | ~queue(); // destructor |
fmanzano_dtk | 1:9e821e640117 | 35 | void dequeue(); |
fmanzano_dtk | 1:9e821e640117 | 36 | void enqueue(int x); |
fmanzano_dtk | 1:9e821e640117 | 37 | int peek(); |
fmanzano_dtk | 1:9e821e640117 | 38 | int size(); |
fmanzano_dtk | 1:9e821e640117 | 39 | //void erase(); |
fmanzano_dtk | 1:9e821e640117 | 40 | bool isEmpty(); |
fmanzano_dtk | 1:9e821e640117 | 41 | bool isFull(); |
fmanzano_dtk | 1:9e821e640117 | 42 | }; |
fmanzano_dtk | 1:9e821e640117 | 43 | |
fmanzano_dtk | 1:9e821e640117 | 44 | #endif //__PLAYLIST_H |