FDL Core Library
ASC Framing Decision List — C/C++ Reference Implementation
Loading...
Searching...
No Matches
Public Member Functions
fdl::detail::TlStringCache< Key, Hash > Class Template Reference

Bounded thread-local string cache with auto-eviction. More...

#include <fdl_tl_cache.h>

Public Member Functions

std::string & get (const Key &key)
 Get or create a cached string entry for the given key.
 

Detailed Description

template<typename Key, typename Hash>
class fdl::detail::TlStringCache< Key, Hash >

Bounded thread-local string cache with auto-eviction.

When the number of cached entries reaches fdl::constants::kTlCacheMaxEntries, the cache is cleared entirely before the new entry is inserted.

Template Parameters
KeyCache key type (must be hashable and equality-comparable).
HashHash functor for Key.

Member Function Documentation

◆ get()

template<typename Key , typename Hash >
std::string & fdl::detail::TlStringCache< Key, Hash >::get ( const Key &  key)
inline

Get or create a cached string entry for the given key.

If the cache exceeds the size limit, it is cleared first. The returned reference is valid until the next call to get() that triggers eviction.

Parameters
keyThe cache key to look up.
Returns
Reference to the cached string (may be empty if newly created).

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