Malloy
Loading...
Searching...
No Matches
Classes | Public Member Functions | List of all members
malloy::http::sessions::storage_memory Class Reference

#include <storage_memory.hpp>

Inheritance diagram for malloy::http::sessions::storage_memory:
Inheritance graph
[legend]
Collaboration diagram for malloy::http::sessions::storage_memory:
Collaboration graph
[legend]

Public Member Functions

std::shared_ptr< sessioncreate (id_type id) override
 
std::shared_ptr< sessionget (const id_type &id) override
 
void destroy (id_type id) override
 
std::size_t destroy_expired (const std::chrono::seconds &max_lifetime) override
 
virtual std::shared_ptr< sessioncreate (id_type id)=0
 
virtual std::shared_ptr< sessionget (const id_type &id)=0
 
virtual void destroy (id_type id)=0
 
virtual std::size_t destroy_expired (const std::chrono::seconds &max_lifetime)=0
 

Detailed Description

A simple in-memory storage manager.

Member Function Documentation

◆ create()

std::shared_ptr< session > malloy::http::sessions::storage_memory::create ( id_type  id)
inlineoverridevirtual

Create a new session.

Parameters
idThe session ID.
Returns
The created session.

Implements malloy::http::sessions::storage.

◆ destroy()

void malloy::http::sessions::storage_memory::destroy ( id_type  id)
inlineoverridevirtual

Destroy an existing session.

Parameters
idThe session ID.

Implements malloy::http::sessions::storage.

◆ destroy_expired()

std::size_t malloy::http::sessions::storage_memory::destroy_expired ( const std::chrono::seconds &  max_lifetime)
inlineoverridevirtual

Destroy any session older than a specified value. Sessions older than max_lifetime need to be destroyed.

Note
The session manager guarantees that max_lifetime is greater than zero.
Parameters
max_lifetimeThe maximum lifetime of a session.
Returns
The number of sessions that were expired/destroyed.

Implements malloy::http::sessions::storage.

◆ get()

std::shared_ptr< session > malloy::http::sessions::storage_memory::get ( const id_type &  id)
inlineoverridevirtual

Returns an existing session (if any)

Parameters
idThe session ID.
Returns
The session (if any).

Implements malloy::http::sessions::storage.


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