blob: 51fb16c5cb7a411bc0ed28b850e92487470fb38b (
plain) (
blame)
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
|
#include "Event.h"
#include "Reservation.h"
Event::Event() : hall(), name(), date() {}
Event::Event(const Hall& hall, String name, Date date) : tickets(), reservations() {
this->hall = &hall;
this->name = name;
this->date = date;
}
OrderedList<Ticket>& Event::get_tickets() {
return tickets;
}
OrderedList<Reservation>& Event::get_reservations() {
return reservations;
}
const Hall& Event::get_hall() const {
return *hall;
}
const String& Event::get_name() const {
return name;
}
const Date& Event::get_date() const {
return date;
}
int Event::compare(const Event& other) {
if (hall == other.hall)
return date.compare(other.date);
return hall->compare(*other.hall);
}
std::istream& operator>>(std::istream& istr, Event& event) {
return istr >> event.hall >> event.name >> event.date >> event.tickets >> event.reservations;
}
std::ostream& operator<<(std::ostream& ostr, Event& event);
|