userver
C++ Async Framework
Toggle main menu visibility
Documentation
API Groups
Namespaces
Reference
Class List
Class Index
File List
Macros
All
e
i
l
r
t
u
Functions
Macros
e
i
l
r
t
u
Examples
•
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Modules
Pages
Concepts
Loading...
Searching...
No Matches
lru_cache_config.hpp
1
#
pragma
once
2
3
#
include
<
chrono
>
4
#
include
<
cstddef
>
5
#
include
<
optional
>
6
#
include
<
unordered_map
>
7
8
#
include
<
userver
/
components
/
component_fwd
.
hpp
>
9
#
include
<
userver
/
dynamic_config
/
snapshot
.
hpp
>
10
#
include
<
userver
/
formats
/
json_fwd
.
hpp
>
11
#
include
<
userver
/
yaml_config
/
fwd
.
hpp
>
12
13
USERVER_NAMESPACE_BEGIN
14
15
namespace
cache
{
16
17
enum
class
BackgroundUpdateMode {
18
kEnabled,
19
kDisabled,
20
};
21
22
struct
LruCacheConfig
final
{
23
explicit
LruCacheConfig(
const
yaml_config
::
YamlConfig
& config);
24
explicit
LruCacheConfig(
const
components
::ComponentConfig& config);
25
26
explicit
LruCacheConfig(
const
formats
::
json
::Value& value);
27
28
std::size_t GetWaySize(std::size_t ways)
const
;
29
30
std::size_t size;
31
std::chrono::milliseconds lifetime;
32
BackgroundUpdateMode background_update;
33
};
22
struct
LruCacheConfig
final
{
…
};
34
35
LruCacheConfig Parse(
const
formats
::
json
::Value& value,
formats
::
parse
::
To
<LruCacheConfig>);
36
37
struct
LruCacheConfigStatic
final
{
38
explicit
LruCacheConfigStatic(
const
yaml_config
::
YamlConfig
& config);
39
explicit
LruCacheConfigStatic(
const
components
::ComponentConfig& config);
40
41
std::size_t GetWaySize()
const
;
42
43
LruCacheConfig config;
44
std::size_t ways;
45
bool
use_dynamic_config;
46
};
37
struct
LruCacheConfigStatic
final
{
…
};
47
48
extern
const
dynamic_config::Key<std::unordered_map<std::string, LruCacheConfig>> kLruCacheConfigSet;
49
50
std::optional<LruCacheConfig> GetLruConfig(
const
dynamic_config::Snapshot& config,
const
std::string& cache_name);
51
52
}
// namespace cache
53
54
USERVER_NAMESPACE_END
userver
cache
lru_cache_config.hpp
Generated on Wed Apr 30 2025 15:50:38 for userver by
Doxygen
1.13.2