FMI Ticket System
| Kamen Mladenov | FMI Computer Science Year 1 Group 6 | Project 1 | Project Topic 4 |
Hall.h
Go to the documentation of this file.
1#ifndef HEADER_MODEL_HALL
2#define HEADER_MODEL_HALL
3
8#include <istream>
9#include <ostream>
10
13class Hall {
14 int number;
15 unsigned rows;
16 unsigned seatsPerRow;
17
18public:
20 Hall();
22 Hall(int number);
24 Hall(int number, unsigned rows, unsigned seatsPerRow);
25
27 int get_number() const;
29 unsigned get_rows() const;
31 unsigned get_seatsPerRow() const;
32
34 void read(std::istream& istr);
36 void write(std::ostream& ostr) const;
38 int compare(const Hall& other) const;
39
40};
41
43std::istream& operator>>(std::istream& istr, Hall& hall);
45std::ostream& operator<<(std::ostream& ostr, const Hall& hall);
46
47#endif
std::ostream & operator<<(std::ostream &ostr, const Hall &hall)
Writes Hall to stream with << operator.
Definition: Hall.cpp:74
std::istream & operator>>(std::istream &istr, Hall &hall)
Reads Hall from stream with >> operator.
Definition: Hall.cpp:61
Each hall contains a number, rows and seats per row.
Definition: Hall.h:13
void write(std::ostream &ostr) const
Writes Hall to steam.
Definition: Hall.cpp:44
Hall()
Sets values to 0.
Definition: Hall.cpp:3
int compare(const Hall &other) const
Compare two Halls.
Definition: Hall.cpp:52
unsigned get_seatsPerRow() const
Return a Hall's seats per row count.
Definition: Hall.cpp:20
unsigned get_rows() const
Returns a Hall's row count.
Definition: Hall.cpp:16
int get_number() const
Returns a Hall's number.
Definition: Hall.cpp:13
void read(std::istream &istr)
Reads Hall from stream.
Definition: Hall.cpp:31