• Main Page
  • Classes
  • Files
  • File List
  • File Members

lib/bfHttpServer/src/httpsession.h

Go to the documentation of this file.
00001 
00006 #ifndef HTTPSESSION_H
00007 #define HTTPSESSION_H
00008 
00009 #include <QByteArray>
00010 #include <QVariant>
00011 #include <QReadWriteLock>
00012 
00013 
00021 class HttpSession {
00022 
00023 public:
00024 
00030     HttpSession(bool canStore=false);
00031 
00036     HttpSession(const HttpSession& other);
00037 
00042     HttpSession& operator= (const HttpSession& other);
00043 
00044 
00048     virtual ~HttpSession();
00049 
00051     QByteArray getId() const;
00052 
00057     bool isNull() const;
00058 
00060     void set(const QByteArray& key, const QVariant& value);
00061 
00063     void remove(const QByteArray& key);
00064 
00066     QVariant get(const QByteArray& key) const;
00067 
00069     bool contains(const QByteArray& key) const;
00070 
00076     QMap<QByteArray,QVariant> getAll() const;
00077 
00083     qint64 getLastAccess() const;
00084 
00090     void setLastAccess();
00091 
00092 private:
00093 
00094     struct HttpSessionData {
00095 
00097         QByteArray id;
00098 
00100         qint64 lastAccess;
00101 
00103         int refCount;
00104 
00106         QReadWriteLock lock;
00107 
00109         QMap<QByteArray,QVariant> values;
00110 
00111     };
00112 
00114     HttpSessionData* dataPtr;
00115 
00116 };
00117 
00118 #endif // HTTPSESSION_H

Generated on Mon Dec 26 2011 12:09:22 for QtWebApp by  doxygen 1.7.1