TreeFrogFramework  1.18
Public Member Functions | Static Public Member Functions | Friends | List of all members
TSession Class Reference

#include <tsession.h>

Inheritance diagram for TSession:
Inheritance graph
[legend]
Collaboration diagram for TSession:
Collaboration graph
[legend]

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 ()
 

Friends

class TSessionCookieStore
 
class TActionContext
 

Detailed Description

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

Constructor & Destructor Documentation

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

Constructs a empty session with the ID id.

TSession::TSession ( const TSession other)
inline

Copy constructor.

Member Function Documentation

QByteArray TSession::id ( ) const
inline

Returns the ID.

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.

TSession & TSession::operator= ( const TSession other)
inline
int TSession::remove ( const QString &  key)
inline
void TSession::reset ( )

Resets the session.

QByteArray TSession::sessionName ( )
static

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

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

Returns the value associated with the key.

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.

Friends And Related Function Documentation

friend class TActionContext
friend
friend class TSessionCookieStore
friend

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