00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023 #ifndef NETWORKDATAXMLHANDLER_H
00024 #define NETWORKDATAXMLHANDLER_H
00025
00026
00027 #include "NetworkMonitor.h"
00028 #include "ArchiveStatistic.h"
00029
00030
00031 #include <qxml.h>
00032 #include <qstring.h>
00033 #include <qwidget.h>
00034
00035
00036
00037
00038
00039
00040 class NetworkDataXmlHandler : public QObject, public QXmlDefaultHandler {
00041 Q_OBJECT
00042
00043 public:
00044 NetworkDataXmlHandler();
00045 ~NetworkDataXmlHandler();
00046 void addArchiveStatistics(ArchiveStatisticsHolder* archStatHold);
00047 void deleteArchiveStatistics(unsigned int statID);
00048 bool getParseError();
00049 QString getParseErrorString();
00050 void resetStatistics();
00051 void setNetworkMonitors(map<unsigned int, NetworkMonitor*>);
00052
00053
00054 signals:
00055 void spikeCountChanged(unsigned int neurSpikeCount);
00056 void spikeTotalChanged(unsigned int neurSpikeTotal);
00057 void statisticsChanged();
00058
00059
00060 protected:
00061
00062 bool characters ( const QString & ch );
00063 bool endElement( const QString&, const QString&, const QString& );
00064 bool startDocument();
00065 bool startElement( const QString&, const QString&, const QString& , const QXmlAttributes& );
00066
00067
00068 bool error ( const QXmlParseException & exception );
00069 QString errorString();
00070 bool fatalError ( const QXmlParseException & exception );
00071 bool warning ( const QXmlParseException & exception );
00072
00073
00074 private:
00075
00076
00077 unsigned int neurSpikeCount;
00078
00079
00080 unsigned int neurSpikeTotal;
00081
00082
00083 QString currentElement;
00084
00085
00086 map<unsigned int, NetworkMonitor*> networkMonitorMap;
00087
00088
00089 unsigned int neuronGrpID;
00090
00091
00092 bool parseError;
00093
00094
00095 QString parseErrorString;
00096
00097
00098
00099 dense_hash_map<unsigned int, bool, hash<unsigned int> > neuronIDHashMap;
00100
00101
00102
00103 map<unsigned int, vector<ArchiveStatistic*> > neuronGrpStatsMap;
00104
00105
00106
00107 vector<ArchiveStatistic*> otherArchStatsVector;
00108
00109
00110
00111
00112 NetworkDataXmlHandler (const NetworkDataXmlHandler&);
00113
00114
00115 NetworkDataXmlHandler operator = (const NetworkDataXmlHandler&);
00116
00117 void processStatistics();
00118
00119 };
00120
00121
00122 #endif //NETWORKDATAXMLHANDLER_H
00123
00124
00125