FMI Ticket System
| Kamen Mladenov | FMI Computer Science Year 1 Group 6 | Project 1 | Project Topic 4 |
Classes | Functions
Event.h File Reference

Stores the declaration of class Event. More...

#include "../Generic/List/OrderedList.hpp"
#include "../Generic/Date/Date.h"
#include "../Generic/String/String.h"
#include "Hall.h"
#include "Ticket.h"
#include "Reservation.h"
#include <istream>
#include <ostream>

Go to the source code of this file.

Classes

class  Event
 Stores an event's hall, name, date, bought tickets and reservations. More...
 

Functions

std::istream & operator>> (std::istream &istr, Event &event)
 Reads Event from stream with >> operator. More...
 
void configureEventInsertionOp (unsigned setting)
 Configures how Event should be shown, when written to stream with << operator. More...
 
std::ostream & operator<< (std::ostream &ostr, const Event &event)
 Writes Event to stream with << operator. More...
 

Detailed Description

Stores the declaration of class Event.

Function Documentation

◆ configureEventInsertionOp()

void configureEventInsertionOp ( unsigned  setting)

Configures how Event should be shown, when written to stream with << operator.

Parameters
settingA number, defining the different options. It's best if it is passed as binary number.

Sets a configuration setting for how operator<< should behave. Setting is stored as a global variable in the cpp file, so it's independent of Event instance.

Each bit in the number is a certain setting. Each bit from left to right represents one of these options, from top to bottom:

  1. Write count of bought tickets (available only if 5. is set)
  2. Write count of reserved tickets (available only if 5. is set)
  3. Write reservations
  4. Write bought tickets
  5. Write Hall information
Example
To configure printing the Hall information, bought tickets count and the bought tickets themselves, you would do:
void configureEventInsertionOp(unsigned setting)
Configures how Event should be shown, when written to stream with << operator.
Definition: Event.cpp:120

◆ operator<<()

std::ostream & operator<< ( std::ostream &  ostr,
const Event &  event 
)

Writes Event to stream with << operator.

Uses the stream's << operator to write all internal data, following setting from configureEventInsertionOp() Stored types must have defined operator <<.

Note
Best used with std::cout or text std::ofstream

◆ operator>>()

std::istream & operator>> ( std::istream &  istr,
Event &  event 
)

Reads Event from stream with >> operator.

Uses the stream's >> operator to read and parse all internal values. Stored types must have defined operator >>.

Note
Best used with std::cin or text std::ifstream