Website Summary Files Commits Branches @commit @diff @stats
path: root / src / Models
diff options
context:
space:
mode:
2 files changed, 12 insertions, 9 deletions
-rw-r--r--src/Models/Hall.cpp18
-rw-r--r--src/Models/Hall.h3
diff --git a/src/Models/Hall.cpp b/src/Models/Hall.cpp
index fbe482f..220fc90 100644
--- a/src/Models/Hall.cpp
+++ b/src/Models/Hall.cpp
@@ -13,22 +13,22 @@ Hall::Hall(int number, unsigned rows, unsigned seatsPerRow) {
int Hall::get_number() const {
return number;
}
-void Hall::set_number(int number) {
- this->number = number;
-}
-
unsigned Hall::get_rows() const {
return rows;
}
-void Hall::set_rows(unsigned rows) {
- this->rows = rows;
-}
unsigned Hall::get_seatsPerRow() const {
return seatsPerRow;
}
-void Hall::set_seatsPerRow(unsigned seatsPerRow) {
- this->seatsPerRow = seatsPerRow;
+
+void Hall::read(std::istream& istr) {
+ istr.read((char*)&number, sizeof(number));
+ istr.read((char*)&rows, sizeof(rows));
+ istr.read((char*)&seatsPerRow, sizeof(seatsPerRow));
+}
+
+void write(std::ostream& ostr) {
+
}
int Hall::compare(const Hall& other) const {
diff --git a/src/Models/Hall.h b/src/Models/Hall.h
index cd35a47..3cdcac4 100644
--- a/src/Models/Hall.h
+++ b/src/Models/Hall.h
@@ -21,6 +21,9 @@ public:
void read(std::istream& istr);
void write(std::ostream& ostr);
int compare(const Hall& other) const;
+
+ friend std::istream& operator>>(std::istream& istr, Hall& hall);
+ friend std::ostream& operator<<(std::ostream& ostr, const Hall& hall);
};
#endif