SDRAngel  4.11.5
Developer docs for <a href="https://github.com/f4exb/sdrangel">SDRangel<\a>, an Open Source Qt5 / OpenGL 3.0+ SDR and signal analyzer frontend to various hardware.
httpsession.h
Go to the documentation of this file.
1 
6 #ifndef HTTPSESSION_H
7 #define HTTPSESSION_H
8 
9 #include <QByteArray>
10 #include <QVariant>
11 #include <QReadWriteLock>
12 #include "httpglobal.h"
13 
14 #include "export.h"
15 
16 namespace qtwebapp {
17 
26 
27 public:
28 
34  HttpSession(bool canStore=false);
35 
40  HttpSession(const HttpSession& other);
41 
46  HttpSession& operator= (const HttpSession& other);
47 
48 
52  virtual ~HttpSession();
53 
55  QByteArray getId() const;
56 
61  bool isNull() const;
62 
64  void set(const QByteArray& key, const QVariant& value);
65 
67  void remove(const QByteArray& key);
68 
70  QVariant get(const QByteArray& key) const;
71 
73  bool contains(const QByteArray& key) const;
74 
80  QMap<QByteArray,QVariant> getAll() const;
81 
87  qint64 getLastAccess() const;
88 
94  void setLastAccess();
95 
96 private:
97 
98  struct HttpSessionData {
99 
101  QByteArray id;
102 
104  qint64 lastAccess;
105 
107  int refCount;
108 
110  QReadWriteLock lock;
111 
113  QMap<QByteArray,QVariant> values;
114 
115  };
116 
119 
120 };
121 
122 } // end of namespace
123 
124 #endif // HTTPSESSION_H
#define HTTPSERVER_API
Definition: export.h:88
QMap< QByteArray, QVariant > values
Definition: httpsession.h:113
HttpSessionData * dataPtr
Definition: httpsession.h:118