TreeFrogFramework: TSession Class Reference

#include <tsession.h>

Public Member Functions

 TSession (const QByteArray &id=QByteArray())
 
 TSession (const TSession &other)
 
TSessionoperator= (const TSession &other)
 
QByteArray id () const
 
void reset ()
 
iterator insert (const QString &key, const QVariant &value)
 
int remove (const QString &key)
 
QVariant take (const QString &key)
 
const QVariant value (const QString &key) const
 
const QVariant value (const QString &key, const QVariant &defaultValue) const
 

Static Public Member Functions

static QByteArray sessionName ()
 

The TSession class holds information associated with individual visitors.

This class inherits QVariantMap class.

See also
http://doc.qt.io/qt-5/qvariant.html#QVariantMap-typedef

◆ TSession() [1/2]

TSession::TSession ( const QByteArray &  id = QByteArray())
inline

Constructs a empty session with the ID id.

◆ TSession() [2/2]

TSession::TSession ( const TSession other)
inline

Copy constructor.

◆ id()

QByteArray TSession::id ( ) const
inline

Returns the ID.

◆ insert()

TSession::iterator TSession::insert ( const QString &  key,
const QVariant &  value 
)
inline

Inserts a new item with the key and a value of value.

If there is already an item with the key, that item's value is replaced with value.

◆ operator=()

◆ remove()

int TSession::remove ( const QString &  key)
inline

◆ reset()

◆ sessionName()

QByteArray TSession::sessionName ( )
static

Returns the session name specified by the application.ini file.

◆ take()

QVariant TSession::take ( const QString &  key)
inline

◆ value() [1/2]

const QVariant TSession::value ( const QString &  key) const
inline

Returns the value associated with the key.

◆ value() [2/2]

const QVariant TSession::value ( const QString &  key,
const QVariant &  defaultValue 
) const
inline

This is an overloaded function.

If the session contains no item with the given key, the function returns defaultValue.

◆ TActionContext

friend class TActionContext

friend

◆ TSessionCookieStore

friend class TSessionCookieStore

friend

The documentation for this class was generated from the following files: