Bump version to 0.2.2
[harbour-pedalo.git] / src / journey.h
1 #ifndef JOURNEY_H
2 #define JOURNEY_H
3
4 #include <QObject>
5 #include <QTime>
6 #include <QDate>
7
8 class Journey
9 {
10 public:
11 friend class JourneyTimeDescending;
12 friend class JourneyTimeAscending;
13
14 Journey();
15 Journey(quint64 start, quint32 duration, quint32 overtook, quint32 overtakenby);
16
17 quint64 getStart () const;
18 QDate getStartDate() const;
19 QTime getStartTime() const;
20 QTime getEndTime() const;
21 qint32 getDuration () const;
22 qint32 getOvertook () const;
23 qint32 getOvertakenBy () const;
24
25 void setStart (const quint64 value);
26 void setStartDate (const QDate &value);
27 void setStartTime (const QTime &value);
28 void setEndTime(const QTime &value);
29 void setDuration (qint32 value);
30 void setOvertook (qint32 value);
31 void setOvertakenBy (qint32 value);
32
33 private:
34 quint64 start;
35 quint32 duration;
36 quint32 overtook;
37 quint32 overtakenby;
38 };
39
40 class JourneyTimeAscending : std::binary_function<Journey,Journey, bool> {
41 public:
42 bool operator() (Journey const &lhs, Journey const &rhs) const {
43 return lhs.start < rhs.start;
44 }
45 };
46
47 class JourneyTimeDescending : std::binary_function<Journey,Journey, bool> {
48 public:
49 bool operator() (Journey const &lhs, Journey const &rhs) const {
50 return lhs.start > rhs.start;
51 }
52 };
53
54 #endif // JOURNEY_H