Malloy
|
#include <session.hpp>
Public Types | |
using | time_point_t = std::chrono::time_point< Clock > |
![]() | |
using | key_type = std::string |
using | value_type = std::string |
using | id_type = std::string |
Public Member Functions | |
session_chrono (id_type &&id) | |
time_point_t | access_time () const noexcept |
template<typename Rep , typename Period > | |
constexpr bool | access_time_older_than (const std::chrono::duration< Rep, Period > &max_lifetime) const |
![]() | |
session (id_type &&id) | |
virtual | ~session ()=default |
session (const session &other)=delete | |
session (session &&other) noexcept=delete | |
session & | operator= (const session &other)=delete |
session & | operator= (session &&other) noexcept=delete |
bool | set (const key_type &key, value_type value) |
std::optional< key_type > | get (const key_type &key) |
virtual bool | remove (const key_type &key) |
id_type | id () const noexcept |
cookie | generate_cookie (std::string cookie_name) const |
Protected Member Functions | |
void | update_access_time () override |
![]() | |
virtual bool | storage_set (const key_type &key, value_type value)=0 |
virtual std::optional< value_type > | storage_get (const key_type &key) const =0 |
virtual bool | storage_remove (const key_type &key)=0 |
virtual void | update_access_time ()=0 |
A session implementing the access time using std::chrono.
Clock | The clock type to use. |
|
inlineexplicit |
Constructor.
id | The session ID. |
|
inlinenoexcept |
Get the access time.
|
inlineconstexpr |
Checks whether this session's access time is older than a specified maximum lifetime.
Duration | The duration type. |
duration | The ma |
|
inlineoverrideprotectedvirtual |
Update the access time.
This should usually update the access time to the current time.
Implements malloy::http::sessions::session.