Skip to content
This repository was archived by the owner on Nov 15, 2022. It is now read-only.

class memory_session_storage

5cript edited this page Apr 25, 2021 · 6 revisions

class memory_session_storage

class memory_session_storage
  : public attender::session_storage_interface

Summary

Members Descriptions
public inline virtual void clear() Clears all sessions from the storage.
public inline virtual uint64_t size() Returns the amount of session in the session storage.
public inline virtual std::string create_session() Create a session and return the id.
public inline virtual void delete_session(std::string const & id) Used to kill a specific session.
public inline virtual bool get_session(std::string const & id,session * session) Get a session from the storage.
public inline virtual bool set_session(std::string const & id,session const & session) Get a session from the storage.

Members


public inline virtual void clear()

Clears all sessions from the storage.


public inline virtual uint64_t size()

Returns the amount of session in the session storage.

Imlementation might be slow! Do not abuse.


public inline virtual std::string create_session()

Create a session and return the id.

DO NOT USE AUTOINCREMENT IDs.


public inline virtual void delete_session(std::string const & id)

Used to kill a specific session.


public inline virtual bool get_session(std::string const & id,session * session)

Get a session from the storage.

Parameters

  • id The session id.

  • session [out] Some sort of session. Is ignored if session is nullptr

Returns: Returns whether the session exists or not.


public inline virtual bool set_session(std::string const & id,session const & session)

Get a session from the storage.

Parameters

  • id The session id.

  • data Some sort of session.

Returns: Returns whether the session exists or not.

Clone this wiki locally