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

An application wide registry that can store objects of any type. More...

#include <GlobalRegistry.hpp>

+ Collaboration diagram for Leosac::GlobalRegistry:

Public Types

using KeyType = std::string
 
using UnderlyingRegistry = Registry< KeyType >
 
using Clock = UnderlyingRegistry::Clock
 

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 std::chrono::steady_clock::time_point &expire_at)
 
static void erase (const KeyType &key)
 
static bool has (const KeyType &key)
 

Static Private Attributes

static std::mutex mutex_
 
static UnderlyingRegistry registry_
 

Detailed Description

An application wide registry that can store objects of any type.

Definition at line 33 of file GlobalRegistry.hpp.

Member Typedef Documentation

◆ Clock

◆ KeyType

using Leosac::GlobalRegistry::KeyType = std::string

Definition at line 36 of file GlobalRegistry.hpp.

◆ UnderlyingRegistry

Member Function Documentation

◆ erase()

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

Definition at line 61 of file GlobalRegistry.hpp.

◆ get()

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

Definition at line 41 of file GlobalRegistry.hpp.

◆ has()

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

Definition at line 66 of file GlobalRegistry.hpp.

◆ set() [1/2]

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

Definition at line 48 of file GlobalRegistry.hpp.

◆ set() [2/2]

template<typename T >
static void Leosac::GlobalRegistry::set ( const KeyType key,
const T &  obj,
const std::chrono::steady_clock::time_point &  expire_at 
)
inlinestatic

Definition at line 55 of file GlobalRegistry.hpp.

Member Data Documentation

◆ mutex_

std::mutex Leosac::GlobalRegistry::mutex_
staticprivate

Definition at line 72 of file GlobalRegistry.hpp.

◆ registry_

Leosac::GlobalRegistry::UnderlyingRegistry Leosac::GlobalRegistry::registry_
staticprivate

Definition at line 73 of file GlobalRegistry.hpp.


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