-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathEvent.h
More file actions
117 lines (99 loc) · 2.65 KB
/
Event.h
File metadata and controls
117 lines (99 loc) · 2.65 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
/**
* @file Event.h
* @brief The header for the Event Class.
*/
#ifndef EVENT_H
#define EVENT_H
#include <string>
#include <crow.h>
#include "Artist.h"
#include "Venue.h"
/**
* @class Event
* @brief A class that represents an Event.
*
* Has basic functionality to get and set artist, date and time, costs for an event.
*/
class Event
{
protected:
std::string id;
Artist artist;
Venue location;
std::string date;
std::string time;
public:
Event() {}
/**
* @brief Constructor for the Event class.
* @param string id : Initial id of the event
* @param Artist artist : artist of the event
* @param Venue location : location where the event is going to be held
* @param string date : date of the event
* @param string time : time of the event
*/
Event(std::string id, Artist artist, Venue location, std::string date, std::string time);
Event(crow::json::rvalue readValueJson);
/**
* @brief Getting id of the event
* @return string id of the event
*/
std::string getId();
/**
* @brief Update id of the event
* @param string id : new id of the event
*/
void setId(std::string id);
/**
* @brief Getting artist of the event
* @return Artist artist of the event
*/
Artist getArtist();
/**
* @brief Update artist of the event
* @param Artist artist : new artist for the event
*/
void setArtist(Artist artist);
/**
* @brief Getting cost of the event ticket
* @return T cost of the event
*/
double getCost();
/**
* @brief Getting date of the event
* @return string representation of date
*/
std::string getDate();
/**
* @brief Getting time of the event
* @return string representation of time
*/
std::string getTime();
/**
* @brief Update date and time of the event
* @param string date : new date of the event
* @param string time : new time of the event
*/
void setWhen(std::string date, std::string time);
/**
* @brief Getting location of the event in string form
* @return Venue type location of the event
*/
Venue getWhere();
/**
* @brief Update location of the event
* @param Venue location : new location of the event
*/
void setWhere(Venue location);
/**
* @brief Converts the Event instance into json
* @return The json form of the event
*/
crow::json::wvalue convertToJson();
/**
* @brief Updates an event instance from given json
* @param rvalue readValueJson : the json to be read
*/
void updateFromJson(crow::json::rvalue readValueJson);
};
#endif