My Project
Public Member Functions | List of all members
Queue Class Reference

#include <queue.hpp>

Public Member Functions

 Queue ()
 
 Queue (Db *database)
 
void addSong (Song s)
 
Song pop (void)
 
bool isEmpty (void)
 

Detailed Description

A priority queue that contains Song objects sorted by user tastes found in a database.

Constructor & Destructor Documentation

◆ Queue() [1/2]

Queue::Queue ( )

Creates a Queue object with an empty queue and no database reference. This object will not be able to function as it does not have a Db to get taste values from

◆ Queue() [2/2]

Queue::Queue ( Db database)

Creates a Queue object that weights Songs based on taste values from a database

Parameters
databaePointer to a Db object

Member Function Documentation

◆ addSong()

void Queue::addSong ( Song  s)

Adds a Song into the queue

Parameters
sSong to add

◆ isEmpty()

bool Queue::isEmpty ( void  )
inline

Checks if the queue is empty

Returns
true if empty, else otherwise

◆ pop()

Song Queue::pop ( void  )

Gets the Song at the front of the queue

Returns
Song at the front of the queue

The documentation for this class was generated from the following files: