diff options
Added files from project 1 (mirror)
1 files changed, 678 insertions, 0 deletions
| -rw-r--r-- | Year 1/Object-oriented Programming/Project 1/docs/html/classEventService.html | 678 |
diff --git a/Year 1/Object-oriented Programming/Project 1/docs/html/classEventService.html b/Year 1/Object-oriented Programming/Project 1/docs/html/classEventService.html new file mode 100644 index 0000000..3cabe28 --- /dev/null +++ b/Year 1/Object-oriented Programming/Project 1/docs/html/classEventService.html @@ -0,0 +1,678 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml"> +<head> +<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/> +<meta http-equiv="X-UA-Compatible" content="IE=11"/> +<meta name="generator" content="Doxygen 1.9.3"/> +<meta name="viewport" content="width=device-width, initial-scale=1"/> +<title>FMI Ticket System: EventService Class Reference</title> +<link href="tabs.css" rel="stylesheet" type="text/css"/> +<script type="text/javascript" src="jquery.js"></script> +<script type="text/javascript" src="dynsections.js"></script> +<link href="search/search.css" rel="stylesheet" type="text/css"/> +<script type="text/javascript" src="search/searchdata.js"></script> +<script type="text/javascript" src="search/search.js"></script> +<link href="doxygen.css" rel="stylesheet" type="text/css" /> +</head> +<body> +<div id="top"><!-- do not remove this div, it is closed by doxygen! --> +<div id="titlearea"> +<table cellspacing="0" cellpadding="0"> + <tbody> + <tr id="projectrow"> + <td id="projectalign"> + <div id="projectname">FMI Ticket System + </div> + <div id="projectbrief">| Kamen Mladenov | FMI Computer Science Year 1 Group 6 | Project 1 | Project Topic 4 |</div> + </td> + </tr> + </tbody> +</table> +</div> +<!-- end header part --> +<!-- Generated by Doxygen 1.9.3 --> +<script type="text/javascript"> +/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */ +var searchBox = new SearchBox("searchBox", "search",'Search','.html'); +/* @license-end */ +</script> +<script type="text/javascript" src="menudata.js"></script> +<script type="text/javascript" src="menu.js"></script> +<script type="text/javascript"> +/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */ +$(function() { + initMenu('',true,false,'search.php','Search'); + $(document).ready(function() { init_search(); }); +}); +/* @license-end */ +</script> +<div id="main-nav"></div> +<!-- window showing the filter options --> +<div id="MSearchSelectWindow" + onmouseover="return searchBox.OnSearchSelectShow()" + onmouseout="return searchBox.OnSearchSelectHide()" + onkeydown="return searchBox.OnSearchSelectKey(event)"> +</div> + +<!-- iframe showing the search results (closed by default) --> +<div id="MSearchResultsWindow"> +<iframe src="javascript:void(0)" frameborder="0" + name="MSearchResults" id="MSearchResults"> +</iframe> +</div> + +</div><!-- top --> +<div class="header"> + <div class="summary"> +<a href="#pub-methods">Public Member Functions</a> | +<a href="classEventService-members.html">List of all members</a> </div> + <div class="headertitle"><div class="title">EventService Class Reference</div></div> +</div><!--header--> +<div class="contents"> + +<p>Each <a class="el" href="classEventService.html" title="Each EventService stores all events and a pointer to HallService.">EventService</a> stores all events and a pointer to <a class="el" href="classHallService.html" title="Each HallService stores all halls.">HallService</a>. + <a href="classEventService.html#details">More...</a></p> + +<p><code>#include <<a class="el" href="EventService_8h_source.html">EventService.h</a>></code></p> +<table class="memberdecls"> +<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="pub-methods" name="pub-methods"></a> +Public Member Functions</h2></td></tr> +<tr class="memitem:a9b30bb95890abac259ba27b53cabe545"><td class="memItemLeft" align="right" valign="top"><a id="a9b30bb95890abac259ba27b53cabe545" name="a9b30bb95890abac259ba27b53cabe545"></a> + </td><td class="memItemRight" valign="bottom"><b>EventService</b> (const <a class="el" href="classHallService.html">HallService</a> *hs)</td></tr> +<tr class="memdesc:a9b30bb95890abac259ba27b53cabe545"><td class="mdescLeft"> </td><td class="mdescRight">Sets <a class="el" href="classHallService.html" title="Each HallService stores all halls.">HallService</a> pointer and initializes events <a class="el" href="classList.html" title="Templated class that stores an array of elements in dynamic memory.">List</a>. <br /></td></tr> +<tr class="separator:a9b30bb95890abac259ba27b53cabe545"><td class="memSeparator" colspan="2"> </td></tr> +<tr class="memitem:af35cde4a05edfec88496772b6d0b1e37"><td class="memItemLeft" align="right" valign="top"><a id="af35cde4a05edfec88496772b6d0b1e37" name="af35cde4a05edfec88496772b6d0b1e37"></a> + </td><td class="memItemRight" valign="bottom"><b>EventService</b> (const <a class="el" href="classHallService.html">HallService</a> *hs, const <a class="el" href="classEvent.html">Event</a> *events, unsigned eventCount)</td></tr> +<tr class="memdesc:af35cde4a05edfec88496772b6d0b1e37"><td class="mdescLeft"> </td><td class="mdescRight">Sets <a class="el" href="classHallService.html" title="Each HallService stores all halls.">HallService</a> pointer and copies values from events into events <a class="el" href="classList.html" title="Templated class that stores an array of elements in dynamic memory.">List</a>. <br /></td></tr> +<tr class="separator:af35cde4a05edfec88496772b6d0b1e37"><td class="memSeparator" colspan="2"> </td></tr> +<tr class="memitem:a7a21a5909116215e402254510d6d81d6"><td class="memItemLeft" align="right" valign="top"><a class="el" href="StatusCode_8h.html#ae98a46f4ea1a43ca48acaf15d2eb7113">StatusCode</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="classEventService.html#a7a21a5909116215e402254510d6d81d6">createEvent</a> (int hallNumber, const <a class="el" href="classString.html">String</a> &name, const <a class="el" href="classDate.html">Date</a> &date)</td></tr> +<tr class="memdesc:a7a21a5909116215e402254510d6d81d6"><td class="mdescLeft"> </td><td class="mdescRight">Creates an <a class="el" href="classEvent.html" title="Stores an event's hall, name, date, bought tickets and reservations.">Event</a>, with the given hallNumber, name and date. <a href="classEventService.html#a7a21a5909116215e402254510d6d81d6">More...</a><br /></td></tr> +<tr class="separator:a7a21a5909116215e402254510d6d81d6"><td class="memSeparator" colspan="2"> </td></tr> +<tr class="memitem:ac7ea565af5ad78e84749558477ceaf26"><td class="memItemLeft" align="right" valign="top"><a class="el" href="StatusCode_8h.html#ae98a46f4ea1a43ca48acaf15d2eb7113">StatusCode</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="classEventService.html#ac7ea565af5ad78e84749558477ceaf26">cancelEvent</a> (const char *name, const <a class="el" href="classDate.html">Date</a> &date)</td></tr> +<tr class="memdesc:ac7ea565af5ad78e84749558477ceaf26"><td class="mdescLeft"> </td><td class="mdescRight">Cancels an <a class="el" href="classEvent.html" title="Stores an event's hall, name, date, bought tickets and reservations.">Event</a> with the given name and date. <a href="classEventService.html#ac7ea565af5ad78e84749558477ceaf26">More...</a><br /></td></tr> +<tr class="separator:ac7ea565af5ad78e84749558477ceaf26"><td class="memSeparator" colspan="2"> </td></tr> +<tr class="memitem:a3c0d2a05e2a3026044b9e13e6802fbdb"><td class="memItemLeft" align="right" valign="top"><a class="el" href="StatusCode_8h.html#ae98a46f4ea1a43ca48acaf15d2eb7113">StatusCode</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="classEventService.html#a3c0d2a05e2a3026044b9e13e6802fbdb">reserveTicket</a> (const char *name, const <a class="el" href="classDate.html">Date</a> &date, const char *password, const char *note, const <a class="el" href="classTicket.html">Ticket</a> &ticket)</td></tr> +<tr class="memdesc:a3c0d2a05e2a3026044b9e13e6802fbdb"><td class="mdescLeft"> </td><td class="mdescRight">Creates a <a class="el" href="classReservation.html" title="Each Reservations contains a ticket, a password and a note.">Reservation</a> for an <a class="el" href="classEvent.html" title="Stores an event's hall, name, date, bought tickets and reservations.">Event</a> by name and date. <a href="classEventService.html#a3c0d2a05e2a3026044b9e13e6802fbdb">More...</a><br /></td></tr> +<tr class="separator:a3c0d2a05e2a3026044b9e13e6802fbdb"><td class="memSeparator" colspan="2"> </td></tr> +<tr class="memitem:aa6fd620de878f225f7c51bb0df6ea749"><td class="memItemLeft" align="right" valign="top"><a class="el" href="StatusCode_8h.html#ae98a46f4ea1a43ca48acaf15d2eb7113">StatusCode</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="classEventService.html#aa6fd620de878f225f7c51bb0df6ea749">cancelTicketReservation</a> (const char *name, const <a class="el" href="classDate.html">Date</a> &date, const <a class="el" href="classTicket.html">Ticket</a> &ticket)</td></tr> +<tr class="memdesc:aa6fd620de878f225f7c51bb0df6ea749"><td class="mdescLeft"> </td><td class="mdescRight">Cancels a <a class="el" href="classReservation.html" title="Each Reservations contains a ticket, a password and a note.">Reservation</a> for a ticket. <a href="classEventService.html#aa6fd620de878f225f7c51bb0df6ea749">More...</a><br /></td></tr> +<tr class="separator:aa6fd620de878f225f7c51bb0df6ea749"><td class="memSeparator" colspan="2"> </td></tr> +<tr class="memitem:ad1efbed6111da8e755d86b5bc9ada806"><td class="memItemLeft" align="right" valign="top"><a class="el" href="StatusCode_8h.html#ae98a46f4ea1a43ca48acaf15d2eb7113">StatusCode</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="classEventService.html#ad1efbed6111da8e755d86b5bc9ada806">ticketIsReserved</a> (const char *name, const <a class="el" href="classDate.html">Date</a> &date, const <a class="el" href="classTicket.html">Ticket</a> &ticket)</td></tr> +<tr class="memdesc:ad1efbed6111da8e755d86b5bc9ada806"><td class="mdescLeft"> </td><td class="mdescRight">Whether a ticket is a reserved or not. <a href="classEventService.html#ad1efbed6111da8e755d86b5bc9ada806">More...</a><br /></td></tr> +<tr class="separator:ad1efbed6111da8e755d86b5bc9ada806"><td class="memSeparator" colspan="2"> </td></tr> +<tr class="memitem:ac447cac3e4974b9cc676d9bb90152979"><td class="memItemLeft" align="right" valign="top"><a class="el" href="StatusCode_8h.html#ae98a46f4ea1a43ca48acaf15d2eb7113">StatusCode</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="classEventService.html#ac447cac3e4974b9cc676d9bb90152979">buyTicket</a> (const char *name, const <a class="el" href="classDate.html">Date</a> &date, const <a class="el" href="classTicket.html">Ticket</a> &ticket, const char *password, <a class="el" href="classString.html">String</a> *reservationNoteOutput)</td></tr> +<tr class="memdesc:ac447cac3e4974b9cc676d9bb90152979"><td class="mdescLeft"> </td><td class="mdescRight">Buys ticket, assuming it is reserved and stores the reservation note. <a href="classEventService.html#ac447cac3e4974b9cc676d9bb90152979">More...</a><br /></td></tr> +<tr class="separator:ac447cac3e4974b9cc676d9bb90152979"><td class="memSeparator" colspan="2"> </td></tr> +<tr class="memitem:ad0a204aca9cc8287f562f42916248e9e"><td class="memItemLeft" align="right" valign="top"><a class="el" href="StatusCode_8h.html#ae98a46f4ea1a43ca48acaf15d2eb7113">StatusCode</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="classEventService.html#ad0a204aca9cc8287f562f42916248e9e">buyTicket</a> (const char *name, const <a class="el" href="classDate.html">Date</a> &date, const <a class="el" href="classTicket.html">Ticket</a> &ticket)</td></tr> +<tr class="memdesc:ad0a204aca9cc8287f562f42916248e9e"><td class="mdescLeft"> </td><td class="mdescRight">Buys ticket, assuming it isn't reserved. <a href="classEventService.html#ad0a204aca9cc8287f562f42916248e9e">More...</a><br /></td></tr> +<tr class="separator:ad0a204aca9cc8287f562f42916248e9e"><td class="memSeparator" colspan="2"> </td></tr> +<tr class="memitem:a7f4632e3beae5d24087047ab0223f85e"><td class="memItemLeft" align="right" valign="top"><a class="el" href="classString.html">String</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="classEventService.html#a7f4632e3beae5d24087047ab0223f85e">createSeatingString</a> (const char *name, const <a class="el" href="classDate.html">Date</a> &date, unsigned *seatsPerRow)</td></tr> +<tr class="memdesc:a7f4632e3beae5d24087047ab0223f85e"><td class="mdescLeft"> </td><td class="mdescRight">Creates a special <a class="el" href="classString.html">String</a> for status of all seats in given <a class="el" href="classEvent.html" title="Stores an event's hall, name, date, bought tickets and reservations.">Event</a> (by name and date) and returns seatsPerRow in given pointer. <a href="classEventService.html#a7f4632e3beae5d24087047ab0223f85e">More...</a><br /></td></tr> +<tr class="separator:a7f4632e3beae5d24087047ab0223f85e"><td class="memSeparator" colspan="2"> </td></tr> +<tr class="memitem:a6700bd4f9da6d12a47812b9c8549556e"><td class="memItemLeft" align="right" valign="top"><a class="el" href="classList.html">List</a>< <a class="el" href="classEvent.html">Event</a> > </td><td class="memItemRight" valign="bottom"><a class="el" href="classEventService.html#a6700bd4f9da6d12a47812b9c8549556e">queryMostWatched</a> (unsigned topN)</td></tr> +<tr class="separator:a6700bd4f9da6d12a47812b9c8549556e"><td class="memSeparator" colspan="2"> </td></tr> +<tr class="memitem:a814de3510f72150f2e54d44f8c8948bb"><td class="memItemLeft" align="right" valign="top"><a class="el" href="classList.html">List</a>< <a class="el" href="classEvent.html">Event</a> > </td><td class="memItemRight" valign="bottom"><a class="el" href="classEventService.html#a814de3510f72150f2e54d44f8c8948bb">queryInsufficientlyVisited</a> ()</td></tr> +<tr class="separator:a814de3510f72150f2e54d44f8c8948bb"><td class="memSeparator" colspan="2"> </td></tr> +<tr class="memitem:a277194aea79a2c9bf955b7706a20c54c"><td class="memItemLeft" align="right" valign="top"><a class="el" href="StatusCode_8h.html#ae98a46f4ea1a43ca48acaf15d2eb7113">StatusCode</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="classEventService.html#a277194aea79a2c9bf955b7706a20c54c">reportReservations</a> (const char *name, const <a class="el" href="classDate.html">Date</a> &date)</td></tr> +<tr class="memdesc:a277194aea79a2c9bf955b7706a20c54c"><td class="mdescLeft"> </td><td class="mdescRight">Creates a report that lists all Events (with given name and date) and their reserved tickets. <a href="classEventService.html#a277194aea79a2c9bf955b7706a20c54c">More...</a><br /></td></tr> +<tr class="separator:a277194aea79a2c9bf955b7706a20c54c"><td class="memSeparator" colspan="2"> </td></tr> +<tr class="memitem:afc74fc6d44fca054bce8e54997c0cd3e"><td class="memItemLeft" align="right" valign="top"><a class="el" href="StatusCode_8h.html#ae98a46f4ea1a43ca48acaf15d2eb7113">StatusCode</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="classEventService.html#afc74fc6d44fca054bce8e54997c0cd3e">reportBoughtTickets</a> (int hallNumber, const <a class="el" href="classDate.html">Date</a> &start, const <a class="el" href="classDate.html">Date</a> &end, bool all=false)</td></tr> +<tr class="memdesc:afc74fc6d44fca054bce8e54997c0cd3e"><td class="mdescLeft"> </td><td class="mdescRight">Creates a report that Lists all Events (with given name and date) and number of bought tickets. <a href="classEventService.html#afc74fc6d44fca054bce8e54997c0cd3e">More...</a><br /></td></tr> +<tr class="separator:afc74fc6d44fca054bce8e54997c0cd3e"><td class="memSeparator" colspan="2"> </td></tr> +<tr class="memitem:a1225c23dae83fa928da47113cd1c5617"><td class="memItemLeft" align="right" valign="top"><a class="el" href="StatusCode_8h.html#ae98a46f4ea1a43ca48acaf15d2eb7113">StatusCode</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="classEventService.html#a1225c23dae83fa928da47113cd1c5617">load</a> ()</td></tr> +<tr class="memdesc:a1225c23dae83fa928da47113cd1c5617"><td class="mdescLeft"> </td><td class="mdescRight">Loads Events from a database file. <a href="classEventService.html#a1225c23dae83fa928da47113cd1c5617">More...</a><br /></td></tr> +<tr class="separator:a1225c23dae83fa928da47113cd1c5617"><td class="memSeparator" colspan="2"> </td></tr> +<tr class="memitem:a5aac3df17ef30f84c1c28277c256ec32"><td class="memItemLeft" align="right" valign="top"><a class="el" href="StatusCode_8h.html#ae98a46f4ea1a43ca48acaf15d2eb7113">StatusCode</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="classEventService.html#a5aac3df17ef30f84c1c28277c256ec32">save</a> ()</td></tr> +<tr class="memdesc:a5aac3df17ef30f84c1c28277c256ec32"><td class="mdescLeft"> </td><td class="mdescRight">Saves Events to a database file. <a href="classEventService.html#a5aac3df17ef30f84c1c28277c256ec32">More...</a><br /></td></tr> +<tr class="separator:a5aac3df17ef30f84c1c28277c256ec32"><td class="memSeparator" colspan="2"> </td></tr> +</table> +<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2> +<div class="textblock"><p >Each <a class="el" href="classEventService.html" title="Each EventService stores all events and a pointer to HallService.">EventService</a> stores all events and a pointer to <a class="el" href="classHallService.html" title="Each HallService stores all halls.">HallService</a>. </p> +</div><h2 class="groupheader">Member Function Documentation</h2> +<a id="ad0a204aca9cc8287f562f42916248e9e" name="ad0a204aca9cc8287f562f42916248e9e"></a> +<h2 class="memtitle"><span class="permalink"><a href="#ad0a204aca9cc8287f562f42916248e9e">◆ </a></span>buyTicket() <span class="overload">[1/2]</span></h2> + +<div class="memitem"> +<div class="memproto"> + <table class="memname"> + <tr> + <td class="memname"><a class="el" href="StatusCode_8h.html#ae98a46f4ea1a43ca48acaf15d2eb7113">StatusCode</a> EventService::buyTicket </td> + <td>(</td> + <td class="paramtype">const char * </td> + <td class="paramname"><em>name</em>, </td> + </tr> + <tr> + <td class="paramkey"></td> + <td></td> + <td class="paramtype">const <a class="el" href="classDate.html">Date</a> & </td> + <td class="paramname"><em>date</em>, </td> + </tr> + <tr> + <td class="paramkey"></td> + <td></td> + <td class="paramtype">const <a class="el" href="classTicket.html">Ticket</a> & </td> + <td class="paramname"><em>ticket</em> </td> + </tr> + <tr> + <td></td> + <td>)</td> + <td></td><td></td> + </tr> + </table> +</div><div class="memdoc"> + +<p>Buys ticket, assuming it isn't reserved. </p> +<p >Calls buyTicket with <a class="el" href="classReservation.html" title="Each Reservations contains a ticket, a password and a note.">Reservation</a>, but sets password and noteOutput to nullptr. </p><dl class="section return"><dt>Returns</dt><dd>E_EventDoesNotExist <b>if</b> No <a class="el" href="classEvent.html" title="Stores an event's hall, name, date, bought tickets and reservations.">Event</a> with the given name and date exists </dd> +<dd> +E_TicketAlreadyBought <b>if</b> A ticket for the given row and seat has already been bought </dd> +<dd> +E_TicketAlreadyReserved <b>if</b> The seat and row are reserved, but given password is nullptr </dd> +<dd> +E_WrongReservationPassword <b>if</b> The seat and row are reserved, but given password is incorrect </dd> +<dd> +Success <b>otherwise</b> </dd></dl> + +</div> +</div> +<a id="ac447cac3e4974b9cc676d9bb90152979" name="ac447cac3e4974b9cc676d9bb90152979"></a> +<h2 class="memtitle"><span class="permalink"><a href="#ac447cac3e4974b9cc676d9bb90152979">◆ </a></span>buyTicket() <span class="overload">[2/2]</span></h2> + +<div class="memitem"> +<div class="memproto"> + <table class="memname"> + <tr> + <td class="memname"><a class="el" href="StatusCode_8h.html#ae98a46f4ea1a43ca48acaf15d2eb7113">StatusCode</a> EventService::buyTicket </td> + <td>(</td> + <td class="paramtype">const char * </td> + <td class="paramname"><em>name</em>, </td> + </tr> + <tr> + <td class="paramkey"></td> + <td></td> + <td class="paramtype">const <a class="el" href="classDate.html">Date</a> & </td> + <td class="paramname"><em>date</em>, </td> + </tr> + <tr> + <td class="paramkey"></td> + <td></td> + <td class="paramtype">const <a class="el" href="classTicket.html">Ticket</a> & </td> + <td class="paramname"><em>ticket</em>, </td> + </tr> + <tr> + <td class="paramkey"></td> + <td></td> + <td class="paramtype">const char * </td> + <td class="paramname"><em>password</em>, </td> + </tr> + <tr> + <td class="paramkey"></td> + <td></td> + <td class="paramtype"><a class="el" href="classString.html">String</a> * </td> + <td class="paramname"><em>reservationNoteOutput</em> </td> + </tr> + <tr> + <td></td> + <td>)</td> + <td></td><td></td> + </tr> + </table> +</div><div class="memdoc"> + +<p>Buys ticket, assuming it is reserved and stores the reservation note. </p> +<dl class="section return"><dt>Returns</dt><dd>E_EventDoesNotExist <b>if</b> No <a class="el" href="classEvent.html" title="Stores an event's hall, name, date, bought tickets and reservations.">Event</a> with the given name and date exists </dd> +<dd> +E_TicketAlreadyBought <b>if</b> A ticket for the given row and seat has already been bought </dd> +<dd> +E_TicketAlreadyReserved <b>if</b> The seat and row are reserved, but given password is nullptr </dd> +<dd> +E_WrongReservationPassword <b>if</b> The seat and row are reserved, but given password is incorrect </dd> +<dd> +Success <b>otherwise</b> </dd></dl> + +</div> +</div> +<a id="ac7ea565af5ad78e84749558477ceaf26" name="ac7ea565af5ad78e84749558477ceaf26"></a> +<h2 class="memtitle"><span class="permalink"><a href="#ac7ea565af5ad78e84749558477ceaf26">◆ </a></span>cancelEvent()</h2> + +<div class="memitem"> +<div class="memproto"> + <table class="memname"> + <tr> + <td class="memname"><a class="el" href="StatusCode_8h.html#ae98a46f4ea1a43ca48acaf15d2eb7113">StatusCode</a> EventService::cancelEvent </td> + <td>(</td> + <td class="paramtype">const char * </td> + <td class="paramname"><em>name</em>, </td> + </tr> + <tr> + <td class="paramkey"></td> + <td></td> + <td class="paramtype">const <a class="el" href="classDate.html">Date</a> & </td> + <td class="paramname"><em>date</em> </td> + </tr> + <tr> + <td></td> + <td>)</td> + <td></td><td></td> + </tr> + </table> +</div><div class="memdoc"> + +<p>Cancels an <a class="el" href="classEvent.html" title="Stores an event's hall, name, date, bought tickets and reservations.">Event</a> with the given name and date. </p> +<dl class="section return"><dt>Returns</dt><dd>E_EventDoesNotExist <b>if</b> No <a class="el" href="classEvent.html" title="Stores an event's hall, name, date, bought tickets and reservations.">Event</a> with the given name and date exists </dd> +<dd> +Success <b>otherwise</b> </dd></dl> + +</div> +</div> +<a id="aa6fd620de878f225f7c51bb0df6ea749" name="aa6fd620de878f225f7c51bb0df6ea749"></a> +<h2 class="memtitle"><span class="permalink"><a href="#aa6fd620de878f225f7c51bb0df6ea749">◆ </a></span>cancelTicketReservation()</h2> + +<div class="memitem"> +<div class="memproto"> + <table class="memname"> + <tr> + <td class="memname"><a class="el" href="StatusCode_8h.html#ae98a46f4ea1a43ca48acaf15d2eb7113">StatusCode</a> EventService::cancelTicketReservation </td> + <td>(</td> + <td class="paramtype">const char * </td> + <td class="paramname"><em>name</em>, </td> + </tr> + <tr> + <td class="paramkey"></td> + <td></td> + <td class="paramtype">const <a class="el" href="classDate.html">Date</a> & </td> + <td class="paramname"><em>date</em>, </td> + </tr> + <tr> + <td class="paramkey"></td> + <td></td> + <td class="paramtype">const <a class="el" href="classTicket.html">Ticket</a> & </td> + <td class="paramname"><em>ticket</em> </td> + </tr> + <tr> + <td></td> + <td>)</td> + <td></td><td></td> + </tr> + </table> +</div><div class="memdoc"> + +<p>Cancels a <a class="el" href="classReservation.html" title="Each Reservations contains a ticket, a password and a note.">Reservation</a> for a ticket. </p> +<p >Canceling a reservation doesn't require password and doesn't return the <a class="el" href="classReservation.html" title="Each Reservations contains a ticket, a password and a note.">Reservation</a>'s note</p> +<dl class="section return"><dt>Returns</dt><dd>E_EventDoesNotExist <b>if</b> No <a class="el" href="classEvent.html" title="Stores an event's hall, name, date, bought tickets and reservations.">Event</a> with the given name and date exists </dd> +<dd> +W_TicketHadNotBeenReserved <b><a class="el" href="classTicket.html" title="Each Ticket contains a row and a seat number.">Ticket</a></b> hadn't been reserved in the first place </dd> +<dd> +Success <b>otherwise</b> </dd></dl> + +</div> +</div> +<a id="a7a21a5909116215e402254510d6d81d6" name="a7a21a5909116215e402254510d6d81d6"></a> +<h2 class="memtitle"><span class="permalink"><a href="#a7a21a5909116215e402254510d6d81d6">◆ </a></span>createEvent()</h2> + +<div class="memitem"> +<div class="memproto"> + <table class="memname"> + <tr> + <td class="memname"><a class="el" href="StatusCode_8h.html#ae98a46f4ea1a43ca48acaf15d2eb7113">StatusCode</a> EventService::createEvent </td> + <td>(</td> + <td class="paramtype">int </td> + <td class="paramname"><em>hallNumber</em>, </td> + </tr> + <tr> + <td class="paramkey"></td> + <td></td> + <td class="paramtype">const <a class="el" href="classString.html">String</a> & </td> + <td class="paramname"><em>name</em>, </td> + </tr> + <tr> + <td class="paramkey"></td> + <td></td> + <td class="paramtype">const <a class="el" href="classDate.html">Date</a> & </td> + <td class="paramname"><em>date</em> </td> + </tr> + <tr> + <td></td> + <td>)</td> + <td></td><td></td> + </tr> + </table> +</div><div class="memdoc"> + +<p>Creates an <a class="el" href="classEvent.html" title="Stores an event's hall, name, date, bought tickets and reservations.">Event</a>, with the given hallNumber, name and date. </p> +<p >Uses <a class="el" href="classHallService.html" title="Each HallService stores all halls.">HallService</a> pointer to get <a class="el" href="classHall.html" title="Each hall contains a number, rows and seats per row.">Hall</a> from hallNumber </p><dl class="section return"><dt>Returns</dt><dd>E_HallDoesntExist <b>if</b> hallNumber doesn't correspond to any <a class="el" href="classHall.html" title="Each hall contains a number, rows and seats per row.">Hall</a>, saved in <a class="el" href="classHallService.html" title="Each HallService stores all halls.">HallService</a> </dd> +<dd> +E_EventWillOverlap <b>if</b> <a class="el" href="classEvent.html" title="Stores an event's hall, name, date, bought tickets and reservations.">Event</a>'s date overlaps with another event in the same <a class="el" href="classHall.html" title="Each hall contains a number, rows and seats per row.">Hall</a> </dd> +<dd> +Success <b>otherwise</b> </dd></dl> + +</div> +</div> +<a id="a7f4632e3beae5d24087047ab0223f85e" name="a7f4632e3beae5d24087047ab0223f85e"></a> +<h2 class="memtitle"><span class="permalink"><a href="#a7f4632e3beae5d24087047ab0223f85e">◆ </a></span>createSeatingString()</h2> + +<div class="memitem"> +<div class="memproto"> + <table class="memname"> + <tr> + <td class="memname"><a class="el" href="classString.html">String</a> EventService::createSeatingString </td> + <td>(</td> + <td class="paramtype">const char * </td> + <td class="paramname"><em>name</em>, </td> + </tr> + <tr> + <td class="paramkey"></td> + <td></td> + <td class="paramtype">const <a class="el" href="classDate.html">Date</a> & </td> + <td class="paramname"><em>date</em>, </td> + </tr> + <tr> + <td class="paramkey"></td> + <td></td> + <td class="paramtype">unsigned * </td> + <td class="paramname"><em>seatsPerRow</em> </td> + </tr> + <tr> + <td></td> + <td>)</td> + <td></td><td></td> + </tr> + </table> +</div><div class="memdoc"> + +<p>Creates a special <a class="el" href="classString.html">String</a> for status of all seats in given <a class="el" href="classEvent.html" title="Stores an event's hall, name, date, bought tickets and reservations.">Event</a> (by name and date) and returns seatsPerRow in given pointer. </p> +<p >Each seat in the <a class="el" href="classHall.html" title="Each hall contains a number, rows and seats per row.">Hall</a> of the <a class="el" href="classEvent.html" title="Stores an event's hall, name, date, bought tickets and reservations.">Event</a> is represented by a single character, where 'R' means the seat is reserved, 'B' means the seat is bought and ' ' if it's neither.</p> +<dl class="section return"><dt>Returns</dt><dd>Empty <a class="el" href="classString.html">String</a> <b>if</b> No <a class="el" href="classEvent.html" title="Stores an event's hall, name, date, bought tickets and reservations.">Event</a> with the given name and date exists </dd> +<dd> +Proper <a class="el" href="classString.html">String</a> <b>otherwise</b> </dd></dl> + +</div> +</div> +<a id="a1225c23dae83fa928da47113cd1c5617" name="a1225c23dae83fa928da47113cd1c5617"></a> +<h2 class="memtitle"><span class="permalink"><a href="#a1225c23dae83fa928da47113cd1c5617">◆ </a></span>load()</h2> + +<div class="memitem"> +<div class="memproto"> + <table class="memname"> + <tr> + <td class="memname"><a class="el" href="StatusCode_8h.html#ae98a46f4ea1a43ca48acaf15d2eb7113">StatusCode</a> EventService::load </td> + <td>(</td> + <td class="paramname"></td><td>)</td> + <td></td> + </tr> + </table> +</div><div class="memdoc"> + +<p>Loads Events from a database file. </p> +<p >Looks for file named "eventsDatabse.fmits", which is just a binary file, and then reads it with the "read" function in events <a class="el" href="classList.html" title="Templated class that stores an array of elements in dynamic memory.">List</a>.</p> +<dl class="section return"><dt>Returns</dt><dd>E_FileCouldNotBeOpened <b>if</b> The files couldn't be opened/Doesn't exist </dd> +<dd> +Success <b>otherwise</b> </dd></dl> + +</div> +</div> +<a id="a814de3510f72150f2e54d44f8c8948bb" name="a814de3510f72150f2e54d44f8c8948bb"></a> +<h2 class="memtitle"><span class="permalink"><a href="#a814de3510f72150f2e54d44f8c8948bb">◆ </a></span>queryInsufficientlyVisited()</h2> + +<div class="memitem"> +<div class="memproto"> + <table class="memname"> + <tr> + <td class="memname"><a class="el" href="classList.html">List</a>< <a class="el" href="classEvent.html">Event</a> > EventService::queryInsufficientlyVisited </td> + <td>(</td> + <td class="paramname"></td><td>)</td> + <td></td> + </tr> + </table> +</div><div class="memdoc"> +<dl class="section return"><dt>Returns</dt><dd>A <a class="el" href="classList.html" title="Templated class that stores an array of elements in dynamic memory.">List</a> of events which have attracted sales of less than 10% of the <a class="el" href="classHall.html" title="Each hall contains a number, rows and seats per row.">Hall</a>'s seat </dd></dl> + +</div> +</div> +<a id="a6700bd4f9da6d12a47812b9c8549556e" name="a6700bd4f9da6d12a47812b9c8549556e"></a> +<h2 class="memtitle"><span class="permalink"><a href="#a6700bd4f9da6d12a47812b9c8549556e">◆ </a></span>queryMostWatched()</h2> + +<div class="memitem"> +<div class="memproto"> + <table class="memname"> + <tr> + <td class="memname"><a class="el" href="classList.html">List</a>< <a class="el" href="classEvent.html">Event</a> > EventService::queryMostWatched </td> + <td>(</td> + <td class="paramtype">unsigned </td> + <td class="paramname"><em>topN</em></td><td>)</td> + <td></td> + </tr> + </table> +</div><div class="memdoc"> +<dl class="section return"><dt>Returns</dt><dd>A <a class="el" href="classList.html" title="Templated class that stores an array of elements in dynamic memory.">List</a> of topN most watched Events</dd></dl> +<p>Events are sorted from index 0 to last index decreasingly by number of watchers. Watchers count for an <a class="el" href="classEvent.html" title="Stores an event's hall, name, date, bought tickets and reservations.">Event</a> is the amount of bought tickets.</p> +<p >If there are less events than topN, all events are returned. </p> + +</div> +</div> +<a id="afc74fc6d44fca054bce8e54997c0cd3e" name="afc74fc6d44fca054bce8e54997c0cd3e"></a> +<h2 class="memtitle"><span class="permalink"><a href="#afc74fc6d44fca054bce8e54997c0cd3e">◆ </a></span>reportBoughtTickets()</h2> + +<div class="memitem"> +<div class="memproto"> + <table class="memname"> + <tr> + <td class="memname"><a class="el" href="StatusCode_8h.html#ae98a46f4ea1a43ca48acaf15d2eb7113">StatusCode</a> EventService::reportBoughtTickets </td> + <td>(</td> + <td class="paramtype">int </td> + <td class="paramname"><em>hallNumber</em>, </td> + </tr> + <tr> + <td class="paramkey"></td> + <td></td> + <td class="paramtype">const <a class="el" href="classDate.html">Date</a> & </td> + <td class="paramname"><em>start</em>, </td> + </tr> + <tr> + <td class="paramkey"></td> + <td></td> + <td class="paramtype">const <a class="el" href="classDate.html">Date</a> & </td> + <td class="paramname"><em>end</em>, </td> + </tr> + <tr> + <td class="paramkey"></td> + <td></td> + <td class="paramtype">bool </td> + <td class="paramname"><em>all</em> = <code>false</code> </td> + </tr> + <tr> + <td></td> + <td>)</td> + <td></td><td></td> + </tr> + </table> +</div><div class="memdoc"> + +<p>Creates a report that Lists all Events (with given name and date) and number of bought tickets. </p> +<dl class="params"><dt>Parameters</dt><dd> + <table class="params"> + <tr><td class="paramname">hallNumber</td><td>Number of the <a class="el" href="classEvent.html" title="Stores an event's hall, name, date, bought tickets and reservations.">Event</a>'s <a class="el" href="classHall.html" title="Each hall contains a number, rows and seats per row.">Hall</a> </td></tr> + <tr><td class="paramname">start</td><td>Starting <a class="el" href="classDate.html" title="Stores a day, month and year.">Date</a> from which to take Events </td></tr> + <tr><td class="paramname">end</td><td>Ending <a class="el" href="classDate.html" title="Stores a day, month and year.">Date</a> until which to take Evnets (including)</td></tr> + </table> + </dd> +</dl> +<p>Report is saved in a file named "boughtTickets.txt" in the current directory.</p> +<p >All Events are inserted into the file with the << operator and a setting of 0b01001.</p> +<dl class="section return"><dt>Returns</dt><dd>E_FileCouldNotBeOpened <b>if</b> Report file couldn't be created </dd> +<dd> +Success <b>otherwise</b> </dd></dl> + +</div> +</div> +<a id="a277194aea79a2c9bf955b7706a20c54c" name="a277194aea79a2c9bf955b7706a20c54c"></a> +<h2 class="memtitle"><span class="permalink"><a href="#a277194aea79a2c9bf955b7706a20c54c">◆ </a></span>reportReservations()</h2> + +<div class="memitem"> +<div class="memproto"> + <table class="memname"> + <tr> + <td class="memname"><a class="el" href="StatusCode_8h.html#ae98a46f4ea1a43ca48acaf15d2eb7113">StatusCode</a> EventService::reportReservations </td> + <td>(</td> + <td class="paramtype">const char * </td> + <td class="paramname"><em>name</em>, </td> + </tr> + <tr> + <td class="paramkey"></td> + <td></td> + <td class="paramtype">const <a class="el" href="classDate.html">Date</a> & </td> + <td class="paramname"><em>date</em> </td> + </tr> + <tr> + <td></td> + <td>)</td> + <td></td><td></td> + </tr> + </table> +</div><div class="memdoc"> + +<p>Creates a report that lists all Events (with given name and date) and their reserved tickets. </p> +<dl class="params"><dt>Parameters</dt><dd> + <table class="params"> + <tr><td class="paramname">name</td><td>C-style string, if it is equal to "ALL", reservations from all Events on the given date will be reported </td></tr> + <tr><td class="paramname">date</td><td>If day, month and year are equal to 0, reservations from all dates will be reported</td></tr> + </table> + </dd> +</dl> +<p>Report is saved in a file in the current directory, named "report-NAME-DATE.txt", where NAME is the given name, and DATE is the given date or "ALL" if the date is 0/0/0</p> +<p >All Events are inserted into the file with the << operator and a setting of 0b00101.</p> +<dl class="section return"><dt>Returns</dt><dd>E_FileCouldNotBeOpened <b>if</b> Report file couldn't be created </dd> +<dd> +Success <b>otherwise</b> </dd></dl> + +</div> +</div> +<a id="a3c0d2a05e2a3026044b9e13e6802fbdb" name="a3c0d2a05e2a3026044b9e13e6802fbdb"></a> +<h2 class="memtitle"><span class="permalink"><a href="#a3c0d2a05e2a3026044b9e13e6802fbdb">◆ </a></span>reserveTicket()</h2> + +<div class="memitem"> +<div class="memproto"> + <table class="memname"> + <tr> + <td class="memname"><a class="el" href="StatusCode_8h.html#ae98a46f4ea1a43ca48acaf15d2eb7113">StatusCode</a> EventService::reserveTicket </td> + <td>(</td> + <td class="paramtype">const char * </td> + <td class="paramname"><em>name</em>, </td> + </tr> + <tr> + <td class="paramkey"></td> + <td></td> + <td class="paramtype">const <a class="el" href="classDate.html">Date</a> & </td> + <td class="paramname"><em>date</em>, </td> + </tr> + <tr> + <td class="paramkey"></td> + <td></td> + <td class="paramtype">const char * </td> + <td class="paramname"><em>password</em>, </td> + </tr> + <tr> + <td class="paramkey"></td> + <td></td> + <td class="paramtype">const char * </td> + <td class="paramname"><em>note</em>, </td> + </tr> + <tr> + <td class="paramkey"></td> + <td></td> + <td class="paramtype">const <a class="el" href="classTicket.html">Ticket</a> & </td> + <td class="paramname"><em>ticket</em> </td> + </tr> + <tr> + <td></td> + <td>)</td> + <td></td><td></td> + </tr> + </table> +</div><div class="memdoc"> + +<p>Creates a <a class="el" href="classReservation.html" title="Each Reservations contains a ticket, a password and a note.">Reservation</a> for an <a class="el" href="classEvent.html" title="Stores an event's hall, name, date, bought tickets and reservations.">Event</a> by name and date. </p> +<dl class="section return"><dt>Returns</dt><dd>E_EventDoesNotExist <b>if</b> No <a class="el" href="classEvent.html" title="Stores an event's hall, name, date, bought tickets and reservations.">Event</a> with the given name and date exists </dd> +<dd> +E_TicketAlreadyBought <b>if</b> A ticket for the given row and seat has already been bought </dd> +<dd> +E_TicketAlreadyReserved <b>if</b> A reservation has already been placed on the given row and seat </dd> +<dd> +Success <b>otherwise</b> </dd></dl> + +</div> +</div> +<a id="a5aac3df17ef30f84c1c28277c256ec32" name="a5aac3df17ef30f84c1c28277c256ec32"></a> +<h2 class="memtitle"><span class="permalink"><a href="#a5aac3df17ef30f84c1c28277c256ec32">◆ </a></span>save()</h2> + +<div class="memitem"> +<div class="memproto"> + <table class="memname"> + <tr> + <td class="memname"><a class="el" href="StatusCode_8h.html#ae98a46f4ea1a43ca48acaf15d2eb7113">StatusCode</a> EventService::save </td> + <td>(</td> + <td class="paramname"></td><td>)</td> + <td></td> + </tr> + </table> +</div><div class="memdoc"> + +<p>Saves Events to a database file. </p> +<p >Looks for file named "eventsDatabse.fmits", which is just a binary file, and then writes to it with the "write" function in events <a class="el" href="classList.html" title="Templated class that stores an array of elements in dynamic memory.">List</a>.</p> +<dl class="section return"><dt>Returns</dt><dd>E_FileCouldNotBeOpened <b>if</b> The files couldn't be opened </dd> +<dd> +Success <b>otherwise</b> </dd></dl> + +</div> +</div> +<a id="ad1efbed6111da8e755d86b5bc9ada806" name="ad1efbed6111da8e755d86b5bc9ada806"></a> +<h2 class="memtitle"><span class="permalink"><a href="#ad1efbed6111da8e755d86b5bc9ada806">◆ </a></span>ticketIsReserved()</h2> + +<div class="memitem"> +<div class="memproto"> + <table class="memname"> + <tr> + <td class="memname"><a class="el" href="StatusCode_8h.html#ae98a46f4ea1a43ca48acaf15d2eb7113">StatusCode</a> EventService::ticketIsReserved </td> + <td>(</td> + <td class="paramtype">const char * </td> + <td class="paramname"><em>name</em>, </td> + </tr> + <tr> + <td class="paramkey"></td> + <td></td> + <td class="paramtype">const <a class="el" href="classDate.html">Date</a> & </td> + <td class="paramname"><em>date</em>, </td> + </tr> + <tr> + <td class="paramkey"></td> + <td></td> + <td class="paramtype">const <a class="el" href="classTicket.html">Ticket</a> & </td> + <td class="paramname"><em>ticket</em> </td> + </tr> + <tr> + <td></td> + <td>)</td> + <td></td><td></td> + </tr> + </table> +</div><div class="memdoc"> + +<p>Whether a ticket is a reserved or not. </p> +<dl class="section return"><dt>Returns</dt><dd>E_EventDoesNotExist <b>if</b> No <a class="el" href="classEvent.html" title="Stores an event's hall, name, date, bought tickets and reservations.">Event</a> with the given name and date exists </dd> +<dd> +W_TicketHadNotBeenReserved <b><a class="el" href="classTicket.html" title="Each Ticket contains a row and a seat number.">Ticket</a></b> hadn't been reserved in the first place </dd> +<dd> +Success <b>otherwise</b> </dd></dl> + +</div> +</div> +<hr/>The documentation for this class was generated from the following files:<ul> +<li>src/Services/<a class="el" href="EventService_8h_source.html">EventService.h</a></li> +<li>src/Services/EventService.cpp</li> +</ul> +</div><!-- contents --> +<!-- start footer part --> +<hr class="footer"/><address class="footer"><small> +Generated by <a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.9.3 +</small></address> +</body> +</html> |
