tufao
1.3.0
An asynchronous web framework for C++ built on top of Qt
|
This class provides easier access to the session's properties. More...
Classes | |
class | PropertyWrapper |
Provides a object that give less verbose access to a session property. More... | |
Public Member Functions | |
Session (SessionStore &store, const HttpServerRequest &request, HttpServerResponse &response) | |
Constructs a new Session object. More... | |
bool | hasValue (const QByteArray &key) const |
Returns true if the session has a property accessible through key . More... | |
QVariant | value (const QByteArray &key) const |
Returns the value of the property referenced by key , or a null QVariant if the property isn't found. More... | |
void | setValue (const QByteArray &key, const QVariant &value) |
Sets the property's value referenced by key to value . More... | |
PropertyWrapper | operator[] (const QByteArray &key) |
Returns a PropertyWrapper that will remember the key used to manipulate the session property. | |
Static Public Member Functions | |
template<class F > | |
static void | apply (SessionStore &store, const QByteArray &property, const HttpServerRequest &request, HttpServerResponse &response, F f) |
Takes a functor to access a session's property. More... | |
template<class F > | |
static void | apply (SessionStore &store, const HttpServerRequest &request, HttpServerResponse &response, F f) |
Takes a functor to access the session's properties. More... | |
This class provides easier access to the session's properties.
It uses C++ features used in containers to provide a familiar interface, such as overloading the operator [].
|
inline |
|
inlinestatic |
Takes a functor to access a session's property.
f | a functor that receives a QVariant object reference as an argument. |
|
inlinestatic |
Takes a functor to access the session's properties.
f | a functor that receives a QMap<QByteArray, QVariant> object reference as an argument. |
|
inline |
Returns true if the session has a property accessible through key
.
|
inline |
Sets the property's value referenced by key
to value
.
|
inline |
Returns the value of the property referenced by key
, or a null QVariant if the property isn't found.