Torc  0.1
torciotlogger.h
Go to the documentation of this file.
1 #ifndef TORCIOTLOGGER_H
2 #define TORCIOTLOGGER_H
3 
4 // Qt
5 #include <QObject>
6 #include <QTimer>
7 #include <QDateTime>
8 
9 // Torc
10 #include "torcnotifier.h"
11 
12 class TorcNetworkRequest;
13 
15 {
16  Q_OBJECT
17 
18  public:
19  explicit TorcIOTLogger(const QVariantMap &Details);
20  virtual ~TorcIOTLogger();
21 
22  QStringList GetDescription(void) override final;
23 
24  public slots:
25  void Notify (const QVariantMap &Notification) override;
26  void DoNotify (void);
27  void RequestReady (TorcNetworkRequest* Request);
28 
29  signals:
30  void StartTimer (int Milliseconds);
31  void TryNotify (void);
32 
33  protected:
34  virtual bool Initialise (const QVariantMap &Details);
35  virtual void ProcessRequest(TorcNetworkRequest* Request) = 0;
36  virtual TorcNetworkRequest* CreateRequest(void) = 0;
37 
38  protected:
39  QString m_description;
40  QTimer m_timer;
42  QString m_apiKey;
46  QDateTime m_lastUpdate;
47  QList<TorcNetworkRequest*> m_requests;
49  QMap<QString,int> m_fields;
50  QMap<int,QString> m_reverseFields;
51  QString m_fieldValues[32];
52 };
53 
54 #endif // TORCIOTLOGGER_H
virtual bool Initialise(const QVariantMap &Details)
int m_maxUpdateInterval
Definition: torciotlogger.h:45
virtual ~TorcIOTLogger()
void RequestReady(TorcNetworkRequest *Request)
QStringList GetDescription(void) overridefinal
A wrapper around QNetworkRequest.
QMap< QString, int > m_fields
Definition: torciotlogger.h:49
QDateTime m_lastUpdate
Definition: torciotlogger.h:46
QMap< int, QString > m_reverseFields
Definition: torciotlogger.h:50
void DoNotify(void)
TorcIOTLogger(const QVariantMap &Details)
virtual void ProcessRequest(TorcNetworkRequest *Request)=0
void Notify(const QVariantMap &Notification) override
virtual TorcNetworkRequest * CreateRequest(void)=0
QList< TorcNetworkRequest * > m_requests
Definition: torciotlogger.h:47
QString m_fieldValues[32]
Definition: torciotlogger.h:51
QString m_apiKey
Definition: torciotlogger.h:42
void TryNotify(void)
void StartTimer(int Milliseconds)
QString m_description
Definition: torciotlogger.h:39