-
Notifications
You must be signed in to change notification settings - Fork 0
/
comedy.h
57 lines (44 loc) · 1.31 KB
/
comedy.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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
/**
* Comedy.h
* Child class of Movies, a Comedy is a specific type of Movie
* Comedy (‘F’) sorted by Title, then Year it released
*
* @author Olga Kuriatnyk
*/
#ifndef COMEDY_H
#define COMEDY_H
#include "movie.h"
class Comedy : public Movie {
public:
// explicit constructor
explicit Comedy(const char &movieType);
// destructor
~Comedy() override;
// copy constructor not allowed
Comedy(const Comedy &c) = delete;
// move not allowed
Comedy(Comedy &&other) = delete;
// assignment not allowed
Comedy &operator=(const Comedy &other) = delete;
// move assignment not allowed
Comedy &operator=(Comedy &&other) = delete;
// reads the line from the file and sets the values to this object
// has validation check for stock and year
bool read(istream &is) override;
// print our comedy movie object
void printMovie() const override;
};
// Creating ComedyFactory to make Comedy objects
// ComedyFactory object will register itself later and get stored in the Item
// class
class ComedyFactory : public MovieFactory {
public:
// Constructor?
// when called will register Comedy in the Item class
ComedyFactory() { Movie::registerType('F', this); }
// @return new Item object
Movie *create(const char &movieType) const override {
return new Comedy(movieType);
}
};
#endif