-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathEvent.h
54 lines (43 loc) · 1.08 KB
/
Event.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
/*
* Event.h
*
* Description: Models arrival and departure events.
*
* Class Invariant: Arrival events have type 'A'.
* Departure events have type 'D'.
*
* Author: AL
* Last Modified: Nov. 2023
*/
#ifndef EVENT_H
#define EVENT_H
class Event {
private:
char type;
int time = 0;
int length = 0; //only used for arrival events
public:
constexpr static char ARRIVAL = 'A';
constexpr static char DEPARTURE = 'D';
// Constructor
Event();
Event(char type, int time);
Event(char type, int time, int length);
// Getters
char getType() const;
int getTime() const;
int getLength() const;
// Setters
void setType( char aType );
void setTime( int aTime );
void setLength( int aLength );
// Description: Return true if this event is an arrival event, false otherwise.
bool isArrival();
// Overloaded Operators
// Description: Comparison <= operator.
bool operator<=(const Event& rhs);
// For Testing Purposes
// Description: Prints the content of "this".
void print() const;
};
#endif