-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathActivity.h
65 lines (52 loc) · 1.79 KB
/
Activity.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
//
// Created by Daniel on 11/10/2022.
//
#ifndef PROJECT_OOP_ACTIVITY_H
#define PROJECT_OOP_ACTIVITY_H
#include <ostream>
#include "string"
#include "DateTime.h"
#include "Location.h"
#include "People.cpp"
#include "Base.h"
class Activity: Base {
DateTime start_date;
DateTime end_date;
std::string name;
People *participants{};
unsigned participants_nr{};
unsigned id=0;
public:
void setId();
static string file_path;
Activity(const std::string &input_start_date, const std::string &input_end_date, const std::string &input_name,
unsigned *participants_id, unsigned input_participants_number);
Activity()= default;
~Activity(){
delete []this->participants;
};
Activity(Activity &activity);
Activity(unsigned input_id);
DateTime getStarDate() const;
DateTime getEndDate() const;
std::string getName() const;
People *getParticipants() const;
void setStarDate(const std::string &starDate);
void setEndDate(const std::string &endDate);
void setName(const std::string &input_name);
unsigned int getId() const;
void setParticipants(unsigned *participants_id, unsigned participants_number);
// Operators
friend ostream &operator<<(ostream &os, Activity &activity);
friend istream &operator>>(istream &os, Activity &activity);
virtual Activity &operator+(const People& p1);
Activity &operator-(unsigned part_nr);
Activity &operator=(const Activity& a);
bool operator==(const Activity& a) const;
explicit operator int() const; // returneaza nr de participanti
unsigned operator%(const std::string& pass_type); //returneaza nr de participanti cu biletul de tipul
// Methods
void update_in_file();
string return_file_path() override;
};
#endif //PROJECT_OOP_ACTIVITY_H