TreeFrogFramework 2.10
Loading...
Searching...
No Matches
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() [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.

Member Function Documentation

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

TSession & TSession::operator= ( const TSession other)
inline

◆ remove()

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

◆ reset()

void TSession::reset ( )

Resets the session.

◆ 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.

Friends And Related Symbol Documentation

◆ TActionContext

friend class TActionContext
friend

◆ TSessionCookieStore

friend class TSessionCookieStore
friend

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