Skip to content

Commit 4bf6fe7

Browse files
committed
organizing fptr metadata, simplified hierarchy.
1 parent 5c7ed65 commit 4bf6fe7

File tree

6 files changed

+114
-17
lines changed

6 files changed

+114
-17
lines changed

ReflectionTemplateLib/rtl/dispatch/CMakeLists.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@
44
set(LOCAL_HEADERS
55

66
"${CMAKE_CURRENT_SOURCE_DIR}/functor.h"
7+
"${CMAKE_CURRENT_SOURCE_DIR}/fn_meta.h"
8+
"${CMAKE_CURRENT_SOURCE_DIR}/fn_signature.h"
9+
"${CMAKE_CURRENT_SOURCE_DIR}/fn_signature_rec.h"
710

811
"${CMAKE_CURRENT_SOURCE_DIR}/method_ptr.h"
912
"${CMAKE_CURRENT_SOURCE_DIR}/function_ptr.h"
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
/*************************************************************************
2+
* *
3+
* Reflection Template Library (RTL) - Modern C++ Reflection Framework *
4+
* https://github.com/ReflectCxx/ReflectionTemplateLibrary-CPP *
5+
* *
6+
* Copyright (c) 2025 Neeraj Singh <[email protected]> *
7+
* SPDX-License-Identifier: MIT *
8+
* *
9+
*************************************************************************/
10+
11+
12+
#pragma once
13+
14+
#include "rtl_traits.h"
15+
16+
namespace rtl::dispatch
17+
{
18+
struct fn_meta
19+
{
20+
constexpr bool is_void() const {
21+
return m_is_void;
22+
}
23+
24+
protected:
25+
26+
std::string m_record_str;
27+
std::string m_return_str;
28+
std::string m_signature_str;
29+
30+
traits::uid_t m_record_id = traits::uid<>::none;
31+
traits::uid_t m_return_id = traits::uid<>::none;
32+
33+
traits::uid_t m_normal_args_id = traits::uid<>::none;
34+
traits::uid_t m_strict_args_id = traits::uid<>::none;
35+
36+
bool m_is_void = false;
37+
bool m_is_any_arg_ncref = false;
38+
std::vector<std::size_t> m_args_type_ids = {};
39+
40+
detail::member m_member_kind = detail::member::None;
41+
};
42+
}
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
/*************************************************************************
2+
* *
3+
* Reflection Template Library (RTL) - Modern C++ Reflection Framework *
4+
* https://github.com/ReflectCxx/ReflectionTemplateLibrary-CPP *
5+
* *
6+
* Copyright (c) 2025 Neeraj Singh <[email protected]> *
7+
* SPDX-License-Identifier: MIT *
8+
* *
9+
*************************************************************************/
10+
11+
12+
#pragma once
13+
14+
#include "fn_meta.h"
15+
16+
namespace rtl::dispatch
17+
{
18+
template<class...args_t>
19+
struct fn_signature : fn_meta
20+
{
21+
22+
};
23+
}
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
/*************************************************************************
2+
* *
3+
* Reflection Template Library (RTL) - Modern C++ Reflection Framework *
4+
* https://github.com/ReflectCxx/ReflectionTemplateLibrary-CPP *
5+
* *
6+
* Copyright (c) 2025 Neeraj Singh <[email protected]> *
7+
* SPDX-License-Identifier: MIT *
8+
* *
9+
*************************************************************************/
10+
11+
12+
#pragma once
13+
14+
#include "fn_signature.h"
15+
16+
namespace rtl::dispatch
17+
{
18+
template<class record_t, class...args_t>
19+
struct fn_signature_rec : fn_signature<args_t...>
20+
{
21+
22+
};
23+
}

ReflectionTemplateLib/rtl/dispatch/functor.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,6 @@
1212
#pragma once
1313

1414
#include "rtl_traits.h"
15-
#include "rtl_constants.h"
16-
#include "rtl_forward_decls.h"
1715

1816
namespace rtl::dispatch
1917
{

ReflectionTemplateLib/rtl/rtl_forward_decls.h

Lines changed: 23 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -75,33 +75,22 @@ namespace rtl
7575

7676
namespace dispatch
7777
{
78-
struct functor;
79-
80-
struct lambda_base;
81-
82-
struct erasure_base;
83-
78+
//--- These can be removed.
8479
template<class ...signature_t>
8580
struct lambda_function;
8681

8782
template<class record_t, class ...signature_t>
8883
struct lambda_method;
8984

90-
template<class return_t, class ...signature_t>
91-
struct function_ptr;
85+
struct functor;
9286

93-
template<class record_t, class return_t, class ...signature_t>
94-
struct method_ptr;
87+
struct lambda_base;
9588

96-
template<class record_t, class return_t, class ...signature_t>
97-
struct const_method_ptr;
89+
struct erasure_base;
9890

9991
template<class ...signature_t>
10092
struct erase_return;
10193

102-
template<class return_t, class ...signature_t>
103-
struct aware_return;
104-
10594
template<class ...signature_t>
10695
struct erase_return_n_target;
10796

@@ -111,6 +100,25 @@ namespace rtl
111100
template<class return_t, class ...signature_t>
112101
struct erase_target_aware_return;
113102

103+
104+
//--- These should be enough for replacement.
105+
struct fn_meta;
106+
107+
template<class...args_t>
108+
struct fn_signature;
109+
110+
template<class record_t, class...args_t>
111+
struct fn_signature_rec;
112+
113+
template<class return_t, class ...signature_t>
114+
struct function_ptr;
115+
116+
template<class record_t, class return_t, class ...signature_t>
117+
struct method_ptr;
118+
119+
template<class return_t, class ...signature_t>
120+
struct aware_return;
121+
114122
template<class record_t, class return_t, class ...signature_t>
115123
struct aware_return_n_target;
116124

0 commit comments

Comments
 (0)