Adding assignment 1
This commit is contained in:
33
assignment1/TMovieList.h
Normal file
33
assignment1/TMovieList.h
Normal file
@@ -0,0 +1,33 @@
|
||||
#ifndef IKT203_TMOVIELIST_H
|
||||
#define IKT203_TMOVIELIST_H
|
||||
|
||||
#include "TMovie.h"
|
||||
#include "TMovieNode.h"
|
||||
|
||||
|
||||
|
||||
using namespace std;
|
||||
|
||||
class TMovieList {
|
||||
private:
|
||||
TMovieNode* head;
|
||||
|
||||
public:
|
||||
TMovieList() : head(new TMovieNode(nullptr)) {}
|
||||
|
||||
~TMovieList()
|
||||
{
|
||||
TMovieNode* current = head;
|
||||
while(current)
|
||||
{
|
||||
TMovieNode* next = current->GetNextNode();
|
||||
delete current;
|
||||
current = next;
|
||||
}
|
||||
head = nullptr;
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
|
||||
#endif //IKT203_TMOVIELIST_H
|
||||
Reference in New Issue
Block a user