userver
C++ Async Framework
Toggle main menu visibility
Loading...
Searching...
No Matches
user_id.hpp
Go to the documentation of this file.
1
#pragma once
2
5
6
#include <cstdint>
7
#include <iosfwd>
8
#include <string>
9
#include <vector>
10
11
#include <
userver/formats/parse/to.hpp
>
12
13
USERVER_NAMESPACE_BEGIN
14
15
namespace
logging
{
16
class
LogHelper
;
17
}
18
19
namespace
server::auth {
20
26
enum class
UserId
: std::uint64_t {};
27
28
using
UserIds = std::vector<UserId>;
29
30
template
<
class
Value>
31
UserId Parse(
const
Value& v,
formats::parse::To<UserId>
) {
32
return
UserId{v.template As<std::uint64_t>()};
33
}
34
35
inline
std::uint64_t ToUInt64(
UserId
v)
noexcept
{
return
static_cast<
std::uint64_t
>
(v); }
36
37
std::string ToString(
UserId
v);
38
39
template
<
class
Char>
40
std::basic_ostream<Char>& operator<<(std::basic_ostream<Char>& os,
UserId
v) {
41
return
os << ToUInt64(v);
42
}
43
44
// Optimized output for LogHelper
45
logging::LogHelper& operator<<(logging::LogHelper& os,
UserId
v);
46
47
}
// namespace server::auth
48
49
USERVER_NAMESPACE_END
userver
server
auth
user_id.hpp
Generated on
for userver by
Doxygen
1.17.0