Website Summary Files Commits Branches @commit @diff @stats
path: root / src / Models / Reservation.h
blob: 50e9d65360dc1bde3028be508cc67396ed4199cd (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
#ifndef HEADER_EVENTSYSTEM_RESERVATION
#define HEADER_EVENTSYSTEM_RESERVATION

#include "Ticket.h"
#include <istream>
#include <ostream>

#define PASSWORD_LEN 8
#define NOTE_LEN 32

class Reservation {
	Ticket ticket;
	char password[PASSWORD_LEN];
	char note[NOTE_LEN];

public:
	Reservation();
	Reservation(const Ticket& ticket);
	Reservation(const Ticket& ticket, const char* password, const char* note);

	const Ticket& get_ticket() const;
	const char* get_password() const;
	const char* get_note() const;

	void read(std::istream& istr);
	void write(std::ostream& ostr) const;
	int compare(const Reservation& other) const;

	friend std::istream& operator>>(std::istream& istr, Reservation& reservation);
	friend std::ostream& operator<<(std::ostream& ostr, const Reservation& reservation);
};

#endif