Website Summary Files Commits Branches @commit @diff @stats
path: root / src / Models / Hall.cpp
diff options
context:
space:
mode:
1 files changed, 12 insertions, 0 deletions
-rw-r--r--src/Models/Hall.cpp12
diff --git a/src/Models/Hall.cpp b/src/Models/Hall.cpp
index 41644df..d1c25f7 100644
--- a/src/Models/Hall.cpp
+++ b/src/Models/Hall.cpp
@@ -36,3 +36,15 @@ void Hall::write(std::ostream& ostr) const {
int Hall::compare(const Hall& other) const {
return (number > other.get_number()) - (number < other.get_number());
}
+
+std::istream& operator>>(std::istream& istr, Hall& hall) {
+ int number;
+ unsigned rows, seatsPerRow;
+ istr >> number >> rows >> seatsPerRow;
+ hall = Hall(number, rows, seatsPerRow);
+ return istr;
+}
+
+std::ostream& operator<<(std::ostream& ostr, const Hall& hall) {
+ return ostr << hall.get_number() << " " << hall.get_rows() << " "<< hall.get_seatsPerRow();
+}