Website Summary Files Commits Branches @commit @diff @stats
path: root / src / Models / Event.h
diff options
context:
space:
mode:
Commitbf7689ba06764b72a6212549a5c8a39e294cceee (patch)
Author
 Syndamia <kamen.d.mladenov@protonmail.com>
2022-05-08 20:40:30 +0300
Committer
 Syndamia <kamen.d.mladenov@protonmail.com>
2022-05-08 20:40:30 +0300
Filesa9ff9780c4f502de58b9d075290acbacf4769d44 /src/Models/Event.h
FMI-OOP-P1_TicketSystem-bf7689ba06764b72a6212549a5c8a39e294cceee.tar
FMI-OOP-P1_TicketSystem-bf7689ba06764b72a6212549a5c8a39e294cceee.tar.gz
FMI-OOP-P1_TicketSystem-bf7689ba06764b72a6212549a5c8a39e294cceee.zip
Parenta8388cfdc47386dcb61f1b5bb9190ce382bf3f1d (diff)
Fully documented all Models
1 files changed, 22 insertions, 2 deletions
-rw-r--r--src/Models/Event.h24
diff --git a/src/Models/Event.h b/src/Models/Event.h
index 496ecab..1162b8f 100644
--- a/src/Models/Event.h
+++ b/src/Models/Event.h
@@ -1,6 +1,10 @@
#ifndef HEADER_MODEL_EVENT
#define HEADER_MODEL_EVENT
+/*! \file Event.h
+ * \brief Stores the declaration of class Event
+ */
+
#include "../Generic/List/OrderedList.hpp"
#include "../Generic/Date/Date.h"
#include "../Generic/String/String.h"
@@ -10,6 +14,8 @@
#include <istream>
#include <ostream>
+/*! \brief Stores an event's hall, name, date, bought tickets and reservations
+ */
class Event {
Hall hall;
String name;
@@ -18,26 +24,40 @@ class Event {
OrderedList<Reservation> reservations;
public:
+ //! Calls default constructors on data
Event();
+ //! Copies given hall and sets name and date
Event(const Hall& hall, String name, Date date);
+ //! Returns constant reference Hall in which event will be held
const Hall& get_hall() const;
+ //! Returns constant reference to name of event
const String& get_name() const;
+ //! Returns constant reference to date on which event will be held
const Date& get_date() const;
+ //! Returns reference to bought tickets
OrderedList<Ticket>& get_tickets();
+ //! Returns constant reference to bought tickets
const OrderedList<Ticket>& get_tickets() const;
+ //! Returns reference to reservations
OrderedList<Reservation>& get_reservations();
+ //! Returns constant reference to reservations
const OrderedList<Reservation>& get_reservations() const;
- void write(std::ostream& ostr);
+ //! Reads Event from stream
void read(std::istream& istr);
-
+ //! Writes Event to stream
+ void write(std::ostream& ostr);
+ //! Compares two events
int compare(const Event& other);
};
+//! Reads Event from stream with >> operator
std::istream& operator>>(std::istream& istr, Event& event);
+//! Configures how Event should be shown, when written to stream with << operator
void configureEventInsertionOp(unsigned setting);
+//! Writes Event to stream with << operator
std::ostream& operator<<(std::ostream& ostr, const Event& event);
#endif