-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcontroller.h
More file actions
90 lines (73 loc) · 1.64 KB
/
Copy pathcontroller.h
File metadata and controls
90 lines (73 loc) · 1.64 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
/*
* controller.h
*
* Created on: Apr 5, 2015
* Author: Dutzi
*/
#ifndef CONTROLLER_H_
#define CONTROLLER_H_
#include <string>
#include <sstream>
#include <vector>
#include "repository.h"
#include "AbstractRepository.h"
#include <memory>
using namespace std;
class Controller
{
private:
shared_ptr<AbstractRepository<Offer>> repo;
public:
/*
* Default constructor
*/
//Controller();
/*
*Copy constructor
*/
Controller(shared_ptr<AbstractRepository<Offer>> repo);
/*
*Destructor
*/
~Controller();
/*
* Get all holiday offers
* returns: all offers
*/
vector<Offer> getOffers();
/*
* Add a holiday offer
* param: destination - a string with destination
* param: type - a string with offer type
* param: price - a float with price
*/
void addOffer(string destination, string type, float price);
/*
* Remove a holiday offer
* position: position of the offer in the list
*/
void removeOffer(int position);
/*
* Modify the offer
* position: position of the offer in the list
* destination, type, price: given info for a new offer
*/
void modifyOffer(int id, string destination, string type, float price );
/*
* Filter the list of offers by type
* type: given type for filtering
*/
vector<Offer> filterbyType(string type, vector<Offer> filtered = vector<Offer>());
/*
* Filter the list of offers by price
* type: given price for filtering
*/
vector<Offer> filterbyPrice(float price, vector<Offer> filtered = vector<Offer>());
/*
* Get the number of offers
*/
int getSizeof();
Offer getbyId(int id);
void printAll(vector<Offer> offers);
};
#endif /* CONTROLLER_H_ */