-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathVenue.h
105 lines (91 loc) · 2.7 KB
/
Venue.h
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
/**
* @file Venue.h
* @brief The header for the Venue Class.
*/
#ifndef VENUE_H
#define VENUE_H
#include <crow.h>
#include <string>
/**
* @class Venue
* @brief A class that represents a Venue.
*
* Has basic functionality to get and set member variables.
*/
class Venue
{
private:
std::string city;
std::string address;
double cost;
public:
Venue() {}
/**
* @brief The construtor for direct parameters.
* @param initialCity The string of the city.
* @param initialAdress The string of the adress.
* @param initialSize The size.
* @param initialCost The float for the cost.
* @exception invalid_argument If the city is blank.
* @exception invalid_argument If the address is blank.
* @exception invalid_argument If the cost is negative.
*/
Venue(std::string initialCity, std::string initialAddress, double initialCost);
/**
* @brief The constructor for json.
* @param readValueJson The json form of the venue
* @exception invalid_argument If the city is blank.
* @exception invalid_argument If the address is blank.
* @exception invalid_argument If the cost is negative.
*/
Venue(crow::json::rvalue readValueJson);
/**
* @brief Shows the city of the venue.
* @return The string city.
*/
std::string getCity();
/**
* @brief Changes the city of the Venue.
* @param newCity The new city.
* @return The new city.
* @exception invalid_argument If the new city is blank.
*/
std::string setCity(std::string newCity);
/**
* @brief Shows the address of the venue.
* @return The string address.
*/
std::string getAddress();
/**
* @brief Changes the address of the venue.
* @param newAddress The new address.
* @return The new address.
* @exception invalid_argument If the new address is blank.
*/
std::string setAddress(std::string newAddress);
/**
* @brief Shows the cost of the venue.
* @return The cost.
*/
double getCost();
/**
* @brief Changes the cost of the venue.
* @return The new cost.
*/
double setCost(double newCost);
/**
* @brief Coverts the Venue instance into json.
* @return The json form of the venue.
*/
crow::json::wvalue convertToJson();
/**
* @brief Updates an venue instance from given json.
* @param readValueJson The json to be read.
* @exception invalid_argument If the city is blank.
* @exception invalid_argument If the address is blank.
* @exception invalid_argument If the cost is negative.
*/
void updateFromJson(crow::json::rvalue readValueJson);
std::string getId() {return city;}
};
#endif