forked from Streptoco/EmbeddedProgrammingInLinux
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathnode.h
More file actions
40 lines (36 loc) · 1.33 KB
/
node.h
File metadata and controls
40 lines (36 loc) · 1.33 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
#ifndef NODE_H
#define NODE_H
#include <fstream>
#include <string>
using namespace std;
class Node
{
private:
int firstSeen, lastSeen;
string icao24, estDepartureAirport, estArrivalAirport, callSign;
public:
int getFirstSeen() const {return firstSeen;}
int getLastSeen() const {return lastSeen;}
string& getIcao24() {return icao24;}
string& getEstDepartureAirport() {return estDepartureAirport;}
string& getEstArrivalAirport() {return estArrivalAirport;}
string& getCallSign() {return callSign;}
void setIcao24(string icao) {this->icao24 = icao;}
void setFirstSeen(int firstSeen) {this->firstSeen = firstSeen;}
void setLastSeen(int lastSeen) {this->lastSeen = lastSeen;}
void setEstDepartureAirport(string departueAirport) {this->estDepartureAirport = departueAirport;}
void setEstArrivalAirport(string arrivalAirport) {this->estArrivalAirport = arrivalAirport;}
void setCallSign(string callSign) {this->callSign = callSign;}
friend istream& operator>>(istream& in, Node& node)
{
char d; // delimiter
getline(in, node.icao24, ',');
in >> node.firstSeen >> d;
getline(in, node.estDepartureAirport, ',');
in >> node.lastSeen >> d;
getline(in, node.estArrivalAirport, ',');
getline(in, node.callSign, '\n');
return in;
}
};
#endif