Leosac  0.8.0
Open Source Access Control
Leosac::ThreadLocalRegistry Class Reference

A simple, thread-local container to share various type of objects. More...

#include <ThreadLocalRegistry.hpp>

+ Collaboration diagram for Leosac::ThreadLocalRegistry:

Public Types

enum  KeyType { DATABASE }
 
using UnderlyingRegistry = Registry< KeyType >
 

Static Public Member Functions

template<typename T >
static T get (const KeyType &key)
 
template<typename T >
static void set (const KeyType &key, const T &obj)
 
template<typename T >
static void set (const KeyType &key, const T &obj, const UnderlyingRegistry::Clock::time_point &expire_at)
 
static void erase (const KeyType &key)
 
static bool has (const KeyType &key)
 
static void purge ()
 

Static Private Attributes

static thread_local UnderlyingRegistry registry_
 

Detailed Description

A simple, thread-local container to share various type of objects.

Note
It uses an internal enumeration as a key type.

Definition at line 35 of file ThreadLocalRegistry.hpp.

Member Typedef Documentation

◆ UnderlyingRegistry

Member Enumeration Documentation

◆ KeyType

Enumerator
DATABASE 

Definition at line 38 of file ThreadLocalRegistry.hpp.

Member Function Documentation

◆ erase()

static void Leosac::ThreadLocalRegistry::erase ( const KeyType key)
inlinestatic

Definition at line 64 of file ThreadLocalRegistry.hpp.

◆ get()

template<typename T >
static T Leosac::ThreadLocalRegistry::get ( const KeyType key)
inlinestatic

Definition at line 46 of file ThreadLocalRegistry.hpp.

◆ has()

static bool Leosac::ThreadLocalRegistry::has ( const KeyType key)
inlinestatic

Definition at line 69 of file ThreadLocalRegistry.hpp.

◆ purge()

static void Leosac::ThreadLocalRegistry::purge ( )
inlinestatic

Definition at line 74 of file ThreadLocalRegistry.hpp.

◆ set() [1/2]

template<typename T >
static void Leosac::ThreadLocalRegistry::set ( const KeyType key,
const T &  obj 
)
inlinestatic

Definition at line 52 of file ThreadLocalRegistry.hpp.

◆ set() [2/2]

template<typename T >
static void Leosac::ThreadLocalRegistry::set ( const KeyType key,
const T &  obj,
const UnderlyingRegistry::Clock::time_point &  expire_at 
)
inlinestatic

Definition at line 58 of file ThreadLocalRegistry.hpp.

Member Data Documentation

◆ registry_

thread_local Leosac::ThreadLocalRegistry::UnderlyingRegistry Leosac::ThreadLocalRegistry::registry_
staticprivate

Definition at line 80 of file ThreadLocalRegistry.hpp.


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