userver
C++ Async Framework
Loading...
Searching...
No Matches
data_provider.hpp
Go to the documentation of this file.
1
#
pragma
once
2
3
/// @file userver/cache/data_provider.hpp
4
/// @brief A simple interface for hiding implementation and making mocks easy to implement
5
6
#
include
<
userver
/
utils
/
shared_readable_ptr
.
hpp
>
7
8
USERVER_NAMESPACE_BEGIN
9
10
namespace
cache
{
11
12
/// @brief Interface for providing cached data of type T
13
/// @tparam T The type of data being provided
14
///
15
/// DataProvider is a simple interface that allows hiding implementation
16
/// details and making mocks easy to implement. It provides a way to
17
/// retrieve shared readable pointers to cached data.
18
19
template
<
typename
T>
20
class
DataProvider
{
21
public
:
22
using
DataType = T;
23
24
virtual
~DataProvider() =
default
;
25
26
virtual
utils::SharedReadablePtr<DataType> Get()
const
= 0;
27
};
28
29
}
// namespace cache
30
31
USERVER_NAMESPACE_END
userver
cache
data_provider.hpp
Generated on Fri Dec 5 2025 12:19:26 for userver by
Doxygen
1.13.2