TreeFrogFramework  1.18
twebsocketsession.h
Go to the documentation of this file.
1 #ifndef TWEBSOCKETSESSION_H
2 #define TWEBSOCKETSESSION_H
3 
4 #include <QVariant>
5 #include <TGlobal>
6 
7 class TSession;
8 
9 
10 class T_CORE_EXPORT TWebSocketSession : public QVariantMap
11 {
12 public:
15  TWebSocketSession &operator=(const TWebSocketSession &);
16 
17  iterator insert(const QString &key, const QVariant &value);
18  const QVariant value(const QString &key) const;
19  const QVariant value(const QString &key, const QVariant &defaultValue) const;
20  TWebSocketSession &unite(const TSession &session);
21  void reset();
22 
23 private:
24  void clear() {} // disabled
25 };
26 
27 
28 
30  : QVariantMap()
31 { }
32 
34  : QVariantMap(*static_cast<const QVariantMap *>(&other))
35 { }
36 
38 {
39  QVariantMap::operator=(*static_cast<const QVariantMap *>(&other));
40  return *this;
41 }
42 
43 inline TWebSocketSession::iterator TWebSocketSession::insert(const QString &key, const QVariant &value)
44 {
45  return QVariantMap::insert(key, value);
46 }
47 
48 inline const QVariant TWebSocketSession::value(const QString &key) const
49 {
50  return QVariantMap::value(key);
51 }
52 
53 inline const QVariant TWebSocketSession::value(const QString &key, const QVariant &defaultValue) const
54 {
55  return QVariantMap::value(key, defaultValue);
56 }
57 
59 {
60  QVariantMap::clear();
61 }
62 
63 #endif // TWEBSOCKETSESSION_H
#define T_CORE_EXPORT
Definition: tglobal.h:81
The TWebSocketSession class holds information associated with individual visitors for WebSocket conne...
Definition: twebsocketsession.h:10
iterator insert(const QString &key, const QVariant &value)
Inserts a new item with the key and a value of value.
Definition: twebsocketsession.h:43
TWebSocketSession()
Constructor.
Definition: twebsocketsession.h:29
The TSession class holds information associated with individual visitors.
Definition: tsession.h:9
void reset()
Resets the session.
Definition: twebsocketsession.h:58
TWebSocketSession & operator=(const TWebSocketSession &)
Definition: twebsocketsession.h:37
const QVariant value(const QString &key) const
Returns the value associated with the key.
Definition: twebsocketsession.h:48