Classes | Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes | List of all members
tsi::SslSessionLRUCache Class Reference

#include <ssl_session_cache.h>

Inheritance diagram for tsi::SslSessionLRUCache:
Inheritance graph
[legend]

Classes

class  Node
 Node for single cached session. More...
 

Public Member Functions

SslSessionPtr Get (const char *key)
 
SslSessionLRUCacheoperator= (const SslSessionLRUCache &)=delete
 
void Put (const char *key, SslSessionPtr session)
 
size_t Size ()
 Returns current number of sessions in the cache. More...
 
 SslSessionLRUCache (const SslSessionLRUCache &)=delete
 
 SslSessionLRUCache (size_t capacity)
 
 ~SslSessionLRUCache () override
 
- Public Member Functions inherited from grpc_core::RefCounted< SslSessionLRUCache >
RefCountedoperator= (const RefCounted &)=delete
 
RefCountedPtr< SslSessionLRUCache > Ref () GRPC_MUST_USE_RESULT
 
RefCountedPtr< SslSessionLRUCache > Ref (const DebugLocation &location, const char *reason) GRPC_MUST_USE_RESULT
 
 RefCounted (const RefCounted &)=delete
 
RefCountedPtr< SslSessionLRUCache > RefIfNonZero () GRPC_MUST_USE_RESULT
 
RefCountedPtr< SslSessionLRUCache > RefIfNonZero (const DebugLocation &location, const char *reason) GRPC_MUST_USE_RESULT
 
void Unref ()
 
void Unref (const DebugLocation &location, const char *reason)
 
 ~RefCounted ()=default
 
- Public Member Functions inherited from grpc_core::PolymorphicRefCount
virtual ~PolymorphicRefCount ()=default
 

Static Public Member Functions

static grpc_core::RefCountedPtr< SslSessionLRUCacheCreate (size_t capacity)
 Create new LRU cache with the given capacity. More...
 

Private Member Functions

void AssertInvariants ()
 
NodeFindLocked (const std::string &key)
 
void PushFront (Node *node)
 
void Remove (Node *node)
 

Private Attributes

size_t capacity_
 
std::map< std::string, Node * > entry_by_key_
 
grpc_core::Mutex lock_
 
Nodeuse_order_list_head_ = nullptr
 
size_t use_order_list_size_ = 0
 
Nodeuse_order_list_tail_ = nullptr
 

Additional Inherited Members

- Public Types inherited from grpc_core::RefCounted< SslSessionLRUCache >
using RefCountedChildType = SslSessionLRUCache
 
- Protected Member Functions inherited from grpc_core::RefCounted< SslSessionLRUCache >
 RefCounted (const char *trace=nullptr, intptr_t initial_refcount=1)
 

Detailed Description

Definition at line 47 of file ssl_session_cache.h.

Constructor & Destructor Documentation

◆ SslSessionLRUCache() [1/2]

tsi::SslSessionLRUCache::SslSessionLRUCache ( size_t  capacity)
explicit

Definition at line 63 of file ssl_session_cache.cc.

◆ ~SslSessionLRUCache()

tsi::SslSessionLRUCache::~SslSessionLRUCache ( )
override

Definition at line 67 of file ssl_session_cache.cc.

◆ SslSessionLRUCache() [2/2]

tsi::SslSessionLRUCache::SslSessionLRUCache ( const SslSessionLRUCache )
delete

Member Function Documentation

◆ AssertInvariants()

void tsi::SslSessionLRUCache::AssertInvariants ( )
private

Definition at line 158 of file ssl_session_cache.cc.

◆ Create()

static grpc_core::RefCountedPtr<SslSessionLRUCache> tsi::SslSessionLRUCache::Create ( size_t  capacity)
inlinestatic

Create new LRU cache with the given capacity.

Definition at line 50 of file ssl_session_cache.h.

◆ FindLocked()

SslSessionLRUCache::Node * tsi::SslSessionLRUCache::FindLocked ( const std::string &  key)
private

Definition at line 81 of file ssl_session_cache.cc.

◆ Get()

SslSessionPtr tsi::SslSessionLRUCache::Get ( const char *  key)

Returns the session from the cache associated with key or null if not found.

Definition at line 117 of file ssl_session_cache.cc.

◆ operator=()

SslSessionLRUCache& tsi::SslSessionLRUCache::operator= ( const SslSessionLRUCache )
delete

◆ PushFront()

void tsi::SslSessionLRUCache::PushFront ( SslSessionLRUCache::Node node)
private

Definition at line 142 of file ssl_session_cache.cc.

◆ Put()

void tsi::SslSessionLRUCache::Put ( const char *  key,
SslSessionPtr  session 
)

Add session in the cache using key. This operation may discard older sessions.

Definition at line 95 of file ssl_session_cache.cc.

◆ Remove()

void tsi::SslSessionLRUCache::Remove ( SslSessionLRUCache::Node node)
private

Definition at line 127 of file ssl_session_cache.cc.

◆ Size()

size_t tsi::SslSessionLRUCache::Size ( )

Returns current number of sessions in the cache.

Definition at line 76 of file ssl_session_cache.cc.

Member Data Documentation

◆ capacity_

size_t tsi::SslSessionLRUCache::capacity_
private

Definition at line 80 of file ssl_session_cache.h.

◆ entry_by_key_

std::map<std::string, Node*> tsi::SslSessionLRUCache::entry_by_key_
private

Definition at line 85 of file ssl_session_cache.h.

◆ lock_

grpc_core::Mutex tsi::SslSessionLRUCache::lock_
private

Definition at line 79 of file ssl_session_cache.h.

◆ use_order_list_head_

Node* tsi::SslSessionLRUCache::use_order_list_head_ = nullptr
private

Definition at line 82 of file ssl_session_cache.h.

◆ use_order_list_size_

size_t tsi::SslSessionLRUCache::use_order_list_size_ = 0
private

Definition at line 84 of file ssl_session_cache.h.

◆ use_order_list_tail_

Node* tsi::SslSessionLRUCache::use_order_list_tail_ = nullptr
private

Definition at line 83 of file ssl_session_cache.h.


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


grpc
Author(s):
autogenerated on Fri May 16 2025 03:03:53