class session_storage_interface - 5cript/attender GitHub Wiki

class session_storage_interface

Summary

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

Members


public void clear()

Clears all sessions from the storage.


public uint64_t size()

Returns the amount of session in the session storage.

Imlementation might be slow! Do not abuse.


public std::string create_session()

Create a session and return the id.

DO NOT USE AUTOINCREMENT IDs.


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

Used to kill a specific session.


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


public virtual ~session_storage_interface() = default