-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMovieDatabase.h
31 lines (26 loc) · 914 Bytes
/
MovieDatabase.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#ifndef MOVIEDATABASE_INCLUDED
#define MOVIEDATABASE_INCLUDED
#include <string>
#include <vector>
#include "treemm.h"
class Movie;
class MovieDatabase
{
public:
MovieDatabase();
bool load(const std::string& filename);
Movie* get_movie_from_id(const std::string& id) const;
std::vector<Movie*> get_movies_with_director(const std::string& director) const;
std::vector<Movie*> get_movies_with_actor(const std::string& actor) const;
std::vector<Movie*> get_movies_with_genre(const std::string& genre) const;
private:
//maps movieID to movies
TreeMultimap <std::string, Movie> movie_database;
//maps director to movies
TreeMultimap <std::string, Movie> director_database;
//maps actor to movies
TreeMultimap <std::string, Movie> actor_database;
//maps genre to movies
TreeMultimap <std::string, Movie> genre_database;
};
#endif // MOVIEDATABASE_INCLUDED