Adding exam part 1/4

This commit is contained in:
Christopher Sanden
2025-11-03 21:30:23 +01:00
parent d6e494cf1c
commit a8006be05f
95 changed files with 12245 additions and 25 deletions

41
Exam/part1/Song.h Normal file
View File

@@ -0,0 +1,41 @@
#pragma once
#include <string>
struct TSong
{
std::string title;
std::string artist;
TSong(std::string aTitle, std::string aArtist)
: title(aTitle), artist(aArtist) {
}
};
// TMusicPlayerApp.h
#pragma once
#include "TLinkedList.hpp"
#include "TQueue.hpp"
#include "TStack.hpp"
#include "TSong.h"
#include <string>
class TMusicPlayerApp
{
private:
// Attributes
TLinkedList<TSong*> mSongLibrary;
TQueue<TSong*> mMainQueue;
TQueue<TSong*> mWishQueue;
TStack<TSong*> mHistoryStack;
// Private helper for loading
void LoadLibrary(const std::string& aFilename);
public:
// Constructor / Destructor
TMusicPlayerApp(const std::string& aSongFilename);
~TMusicPlayerApp(); // Will be empty, destructors of attributes handle it
// Public API for RunApp() to call
// ... (we will define these next)
};