Configuration options for LruCache behavior.
More...
#include <nfx/cache/LruCache.h>
Configuration options for LruCache behavior.
Definition at line 47 of file LruCache.h.
◆ LruCacheOptions()
| nfx::cache::LruCacheOptions::LruCacheOptions |
( |
std::size_t | sizeLimit = 0, |
|
|
std::chrono::milliseconds | slidingExpiration = std::chrono::hours{ 1 }, |
|
|
std::chrono::milliseconds | backgroundCleanupInterval = std::chrono::milliseconds{ 0 } ) |
|
inline |
Construct LruCacheOptions with specified parameters.
- Parameters
-
| sizeLimit | Maximum number of entries (0 = unlimited) |
| slidingExpiration | Default expiration time after last access |
| backgroundCleanupInterval | Interval for automatic expired entry cleanup (0 = disabled) |
◆ backgroundCleanupInterval()
| std::chrono::milliseconds nfx::cache::LruCacheOptions::backgroundCleanupInterval |
( |
| ) |
const |
|
inlinenodiscard |
Get the background cleanup interval.
- Returns
- Cleanup interval (0 = disabled)
- Note
- This function is marked [[nodiscard]] - the return value should not be ignored
◆ sizeLimit()
| std::size_t nfx::cache::LruCacheOptions::sizeLimit |
( |
| ) |
const |
|
inlinenodiscard |
Get the maximum number of cache entries allowed.
- Returns
- Size limit (0 = unlimited)
- Note
- This function is marked [[nodiscard]] - the return value should not be ignored
◆ slidingExpiration()
| std::chrono::milliseconds nfx::cache::LruCacheOptions::slidingExpiration |
( |
| ) |
const |
|
inlinenodiscard |
Get the default sliding expiration time.
- Returns
- Sliding expiration duration after last access
- Note
- This function is marked [[nodiscard]] - the return value should not be ignored
The documentation for this struct was generated from the following file: