Website Summary Files Commits Branches @commit @diff @stats
path: root / src / Models
diff options
context:
space:
mode:
Commitbb4433952047a63906e1e61cdf3f2336e7b517d3 (patch)
Author
 Syndamia <kamen.d.mladenov@protonmail.com>
2022-05-07 16:23:41 +0300
Committer
 Syndamia <kamen.d.mladenov@protonmail.com>
2022-05-07 16:23:41 +0300
Filescfb61a1543a131cc72baf3c833526038ea981562 /src/Models
FMI-OOP-P1_TicketSystem-bb4433952047a63906e1e61cdf3f2336e7b517d3.tar
FMI-OOP-P1_TicketSystem-bb4433952047a63906e1e61cdf3f2336e7b517d3.tar.gz
FMI-OOP-P1_TicketSystem-bb4433952047a63906e1e61cdf3f2336e7b517d3.zip
Parentc8e3d1a1a5dbaf4503df950fdae05b69d8744e70 (diff)
Autocommit at 07.05.2022 @ 16:23
2 files changed, 13 insertions, 0 deletions
-rw-r--r--src/Models/Event.cpp5
-rw-r--r--src/Models/Event.h8
diff --git a/src/Models/Event.cpp b/src/Models/Event.cpp
index 4328e3b..51fb16c 100644
--- a/src/Models/Event.cpp
+++ b/src/Models/Event.cpp
@@ -34,3 +34,8 @@ int Event::compare(const Event& other) {
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);
diff --git a/src/Models/Event.h b/src/Models/Event.h
index c69f1b8..92b5622 100644
--- a/src/Models/Event.h
+++ b/src/Models/Event.h
@@ -7,6 +7,8 @@
#include "Hall.h"
#include "Ticket.h"
#include "Reservation.h"
+#include <istream>
+#include <ostream>
class Event {
const Hall* hall;
@@ -25,7 +27,13 @@ public:
OrderedList<Ticket>& get_tickets();
OrderedList<Reservation>& get_reservations();
+ void print(std::ostream& ostr);
+ void write(std::istream& istr);
+
int compare(const Event& other);
+
+ friend std::istream& operator>>(std::istream& istr, Event& event);
+ friend std::ostream& operator<<(std::ostream& ostr, Event& event);
};
#endif