qxLib
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 © 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 **/
26 {
27  static constexpr string_view get_name(string_view) noexcept
28  {
29  return QX_TEXT("");
30  }
31 };
32 
33 /**
34  @struct rtti_naming_strategy_class_name
35  @brief Returns class name string_view in get_name
36  @author Khrapov
37  @date 10.09.2021
38 **/
40 {
41  static constexpr string_view get_name(string_view svName) noexcept
42  {
43  return svName;
44  }
45 };
46 
47 } // namespace qx
Returns class name string_view in get_name.
Returns empty string_view in get_name: { '\0' }.