Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026 #ifndef EVENT_H
00027 #define EVENT_H
00028
00029 #include <QtCore>
00030
00031 #include "Station.h"
00032
00033 #define COMPARE_ITEMS \
00034 if(v1<v2) { \
00035 return trueValue; \
00036 } else if(v1>v2) { \
00037 return !trueValue; \
00038 } else { \
00039 return false; \
00040 }
00041
00042 class Event
00043 {
00044 public:
00045 Event();
00046 ~Event();
00047
00048 void setId(QDir d, const QString& id);
00049 QString id() const {return _id;}
00050
00051 double magnitude(bool& ok) const;
00052 Station::Status status() const;
00053
00054 int stationCount() const {return _stations.count();}
00055 Station * station(const QString& name) const;
00056 Station * station(int index) const {return _stations.at(index);}
00057 void sortStations();
00058 void save(QTextStream& s, const QString& eventId);
00059
00060 static void setSortIndex(int index) {_sortIndex=index;}
00061 static bool lessThan(const Event * e1, const Event * e2);
00062 private:
00063 QString _id;
00064 QList<Station *> _stations;
00065 static int _sortIndex;
00066 };
00067
00068 #endif // EVENT_H