LLDB  mainline
Classes | Public Member Functions | Private Types | Private Member Functions | Private Attributes | List of all members
lldb_private::FormatCache Class Reference

#include <FormatCache.h>

Collaboration diagram for lldb_private::FormatCache:
Collaboration graph
[legend]

Classes

struct  Entry
 

Public Member Functions

 FormatCache ()=default
 
template<typename ImplSP >
bool Get (ConstString type, ImplSP &format_impl_sp)
 
void Set (ConstString type, lldb::TypeFormatImplSP &format_sp)
 
void Set (ConstString type, lldb::TypeSummaryImplSP &summary_sp)
 
void Set (ConstString type, lldb::SyntheticChildrenSP &synthetic_sp)
 
void Clear ()
 
uint64_t GetCacheHits ()
 
uint64_t GetCacheMisses ()
 

Private Types

typedef std::map< ConstString, EntryCacheMap
 

Private Member Functions

EntryGetEntry (ConstString type)
 

Private Attributes

CacheMap m_map
 
std::recursive_mutex m_mutex
 
uint64_t m_cache_hits = 0
 
uint64_t m_cache_misses = 0
 

Detailed Description

Definition at line 20 of file FormatCache.h.

Member Typedef Documentation

◆ CacheMap

Definition at line 48 of file FormatCache.h.

Constructor & Destructor Documentation

◆ FormatCache()

lldb_private::FormatCache::FormatCache ( )
default

Member Function Documentation

◆ Clear()

void FormatCache::Clear ( )

Definition at line 118 of file FormatCache.cpp.

References m_map, and m_mutex.

◆ Get()

template<typename ImplSP >
bool FormatCache::Get ( ConstString  type,
ImplSP &  format_impl_sp 
)

Definition at line 77 of file FormatCache.cpp.

References GetEntry(), m_cache_hits, m_cache_misses, and m_mutex.

Referenced by lldb_private::LanguageCategory::Get().

◆ GetCacheHits()

uint64_t lldb_private::FormatCache::GetCacheHits ( )
inline

Definition at line 67 of file FormatCache.h.

References m_cache_hits.

◆ GetCacheMisses()

uint64_t lldb_private::FormatCache::GetCacheMisses ( )
inline

Definition at line 69 of file FormatCache.h.

References m_cache_misses.

◆ GetEntry()

FormatCache::Entry & FormatCache::GetEntry ( ConstString  type)
private

Definition at line 54 of file FormatCache.cpp.

References m_map.

Referenced by Get(), and Set().

◆ Set() [1/3]

void FormatCache::Set ( ConstString  type,
lldb::TypeFormatImplSP &  format_sp 
)

◆ Set() [2/3]

void FormatCache::Set ( ConstString  type,
lldb::TypeSummaryImplSP &  summary_sp 
)

Definition at line 107 of file FormatCache.cpp.

References GetEntry(), m_mutex, and lldb_private::FormatCache::Entry::Set().

◆ Set() [3/3]

void FormatCache::Set ( ConstString  type,
lldb::SyntheticChildrenSP &  synthetic_sp 
)

Definition at line 112 of file FormatCache.cpp.

References GetEntry(), m_mutex, and lldb_private::FormatCache::Entry::Set().

Member Data Documentation

◆ m_cache_hits

uint64_t lldb_private::FormatCache::m_cache_hits = 0
private

Definition at line 52 of file FormatCache.h.

Referenced by Get(), and GetCacheHits().

◆ m_cache_misses

uint64_t lldb_private::FormatCache::m_cache_misses = 0
private

Definition at line 53 of file FormatCache.h.

Referenced by Get(), and GetCacheMisses().

◆ m_map

CacheMap lldb_private::FormatCache::m_map
private

Definition at line 49 of file FormatCache.h.

Referenced by Clear(), and GetEntry().

◆ m_mutex

std::recursive_mutex lldb_private::FormatCache::m_mutex
private

Definition at line 50 of file FormatCache.h.

Referenced by Clear(), Get(), and Set().


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