qxLib
include
qx
rtti
rtti_naming_strategy.h
Go to the documentation of this file.
1
/**
2
3
@file rtti_naming_strategy.h
4
@brief Contains naming strategies for qx::rtti_root class
5
@details The naming strategy determines what will be returned
6
by get_class_id_static()
7
@author Khrapov
8
@date 9.09.2021
9
@copyright (c) Nick Khrapov, 2021. All right reserved.
10
11
**/
12
#pragma once
13
14
namespace
qx
15
{
16
17
/**
18
@struct rtti_naming_strategy_empty
19
@brief Returns empty string_view in get_name: { '\0' }
20
@details Does not lead to storing the string in static memory in the release build,
21
even if it is specified in the template argument
22
@author Khrapov
23
@date 10.09.2021
24
**/
25
struct
rtti_naming_strategy_empty
26
{
27
template
<
class
char
_t>
28
static
constexpr basic_string_view<char_t> get_name(basic_string_view<char_t>) noexcept
29
{
30
return
{};
31
}
32
};
33
34
/**
35
@struct rtti_naming_strategy_class_name
36
@brief Returns class name string_view in get_name
37
@author Khrapov
38
@date 10.09.2021
39
**/
40
struct
rtti_naming_strategy_class_name
41
{
42
template
<
class
char
_t>
43
static
constexpr basic_string_view<char_t> get_name(basic_string_view<char_t> svName) noexcept
44
{
45
return
svName;
46
}
47
};
48
49
}
// namespace qx
qx::rtti_naming_strategy_class_name
Returns class name string_view in get_name.
Definition:
rtti_naming_strategy.h:41
qx::rtti_naming_strategy_empty
Returns empty string_view in get_name: { '\0' }.
Definition:
rtti_naming_strategy.h:26
Generated by
1.9.1