Skip to content

Commit 3989a4e

Browse files
committed
all std::any_cast now by pointer.
1 parent 7105417 commit 3989a4e

21 files changed

+93
-88
lines changed

RTLBenchmarkApp/src/ReflectedCall.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ namespace
7474

7575

7676

77-
void ReflectedCall::noReturn(benchmark::State& state)
77+
void ReflectedCall::set(benchmark::State& state)
7878
{
7979
static auto _=_test0();
8080
for (auto _: state) {
@@ -85,7 +85,7 @@ void ReflectedCall::noReturn(benchmark::State& state)
8585
}
8686

8787

88-
void ReflectedCall::withReturn(benchmark::State& state)
88+
void ReflectedCall::get(benchmark::State& state)
8989
{
9090
static auto _=_test2();
9191
for (auto _: state)
@@ -96,7 +96,7 @@ void ReflectedCall::withReturn(benchmark::State& state)
9696
}
9797

9898

99-
void ReflectedMethodCall::noReturn(benchmark::State& state)
99+
void ReflectedMethodCall::set(benchmark::State& state)
100100
{
101101
static auto _=_test1();
102102
for (auto _: state)
@@ -107,7 +107,7 @@ void ReflectedMethodCall::noReturn(benchmark::State& state)
107107
}
108108

109109

110-
void ReflectedMethodCall::withReturn(benchmark::State& state)
110+
void ReflectedMethodCall::get(benchmark::State& state)
111111
{
112112
static auto _=_test3();
113113
for (auto _: state)

RTLBenchmarkApp/src/ReflectedCall.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,15 @@
44

55
struct ReflectedCall
66
{
7-
static void noReturn(benchmark::State& state);
7+
static void set(benchmark::State& state);
88

9-
static void withReturn(benchmark::State& state);
9+
static void get(benchmark::State& state);
1010
};
1111

1212

1313
struct ReflectedMethodCall
1414
{
15-
static void noReturn(benchmark::State& state);
15+
static void set(benchmark::State& state);
1616

17-
static void withReturn(benchmark::State& state);
17+
static void get(benchmark::State& state);
1818
};

RTLBenchmarkApp/src/StandardCall.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ namespace bm
3939
}
4040

4141

42-
void DirectCall::noReturn(benchmark::State& state)
42+
void NativeCall::set(benchmark::State& state)
4343
{
4444
for (auto _: state)
4545
{
@@ -49,7 +49,7 @@ void DirectCall::noReturn(benchmark::State& state)
4949
}
5050

5151

52-
void DirectCall::withReturn(benchmark::State& state)
52+
void NativeCall::get(benchmark::State& state)
5353
{
5454
static auto _=_put_line();
5555
for (auto _: state)
@@ -59,7 +59,7 @@ void DirectCall::withReturn(benchmark::State& state)
5959
}
6060

6161

62-
void StdFuncCall::noReturn(benchmark::State& state)
62+
void StdFuncCall::set(benchmark::State& state)
6363
{
6464
static auto _=_new_line();
6565
for (auto _: state)
@@ -70,7 +70,7 @@ void StdFuncCall::noReturn(benchmark::State& state)
7070
}
7171

7272

73-
void StdFuncMethodCall::noReturn(benchmark::State& state)
73+
void StdFuncMethodCall::set(benchmark::State& state)
7474
{
7575
static auto _=_new_line();
7676
for (auto _: state)
@@ -81,7 +81,7 @@ void StdFuncMethodCall::noReturn(benchmark::State& state)
8181
}
8282

8383

84-
void StdFuncCall::withReturn(benchmark::State& state)
84+
void StdFuncCall::get(benchmark::State& state)
8585
{
8686
static auto _=_new_line();
8787
for (auto _: state)
@@ -91,7 +91,7 @@ void StdFuncCall::withReturn(benchmark::State& state)
9191
}
9292

9393

94-
void StdFuncMethodCall::withReturn(benchmark::State& state)
94+
void StdFuncMethodCall::get(benchmark::State& state)
9595
{
9696
static auto _=_new_line();
9797
for (auto _: state)

RTLBenchmarkApp/src/StandardCall.h

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,25 +2,25 @@
22

33
#include <benchmark/benchmark.h>
44

5-
struct DirectCall
5+
struct NativeCall
66
{
7-
static void noReturn(benchmark::State& state);
7+
static void set(benchmark::State& state);
88

9-
static void withReturn(benchmark::State& state);
9+
static void get(benchmark::State& state);
1010
};
1111

1212

1313
struct StdFuncCall
1414
{
15-
static void noReturn(benchmark::State& state);
15+
static void set(benchmark::State& state);
1616

17-
static void withReturn(benchmark::State& state);
17+
static void get(benchmark::State& state);
1818
};
1919

2020

2121
struct StdFuncMethodCall
2222
{
23-
static void noReturn(benchmark::State& state);
23+
static void set(benchmark::State& state);
2424

25-
static void withReturn(benchmark::State& state);
25+
static void get(benchmark::State& state);
2626
};

RTLBenchmarkApp/src/main.cpp

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -6,21 +6,21 @@
66
#include "StandardCall.h"
77
#include "ReflectedCall.h"
88

9-
BENCHMARK(DirectCall::noReturn);
9+
BENCHMARK(NativeCall::set);
1010

11-
BENCHMARK(StdFuncCall::noReturn);
12-
BENCHMARK(ReflectedCall::noReturn);
11+
BENCHMARK(StdFuncCall::set);
12+
BENCHMARK(ReflectedCall::set);
1313

14-
BENCHMARK(StdFuncMethodCall::noReturn);
15-
BENCHMARK(ReflectedMethodCall::noReturn);
14+
BENCHMARK(StdFuncMethodCall::set);
15+
BENCHMARK(ReflectedMethodCall::set);
1616

17-
BENCHMARK(DirectCall::withReturn);
17+
BENCHMARK(NativeCall::get);
1818

19-
BENCHMARK(StdFuncCall::withReturn);
20-
BENCHMARK(ReflectedCall::withReturn);
19+
BENCHMARK(StdFuncCall::get);
20+
BENCHMARK(ReflectedCall::get);
2121

22-
BENCHMARK(StdFuncMethodCall::withReturn);
23-
BENCHMARK(ReflectedMethodCall::withReturn);
22+
BENCHMARK(StdFuncMethodCall::get);
23+
BENCHMARK(ReflectedMethodCall::get);
2424

2525
namespace bm
2626
{

RTLTestRunApp/src/FunctionalityTests/NameSpaceGlobalsTests.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,9 @@ namespace rtl_tests
5959
{
6060
//Now for cases, if you want to handle it type-erased and pass around.
6161
RObject reflChar = rtl::reflect('Q');
62-
error reterr = cxx::mirror().enableCloning(reflChar);
62+
63+
error reterr = cxx::mirror().setupCloning(reflChar);
64+
6365
ASSERT_TRUE(reterr == error::None);
6466
{
6567
//Internally calls the copy constructor.

RTLTestRunApp/src/FunctionalityTests/ReflectionOpErrorCodeTests.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ namespace rtl_tests
7070
char ch = 'R';
7171
RObject rCh = rtl::reflect(ch);
7272

73-
error reterr = cxx::mirror().enableCloning(rCh);
73+
error reterr = cxx::mirror().setupCloning(rCh);
7474
ASSERT_TRUE(reterr == error::None);
7575

7676
EXPECT_FALSE(rCh.isAllocatedByRtl());
@@ -114,7 +114,7 @@ namespace rtl_tests
114114
EXPECT_FALSE(rChptr.isAllocatedByRtl());
115115
ASSERT_TRUE(rtl::getRtlManagedHeapInstanceCount() == 1);
116116

117-
error reterr = cxx::mirror().enableCloning(rChptr);
117+
error reterr = cxx::mirror().setupCloning(rChptr);
118118
ASSERT_TRUE(reterr == error::None);
119119

120120
EXPECT_TRUE(rChptr.canViewAs<char>());
@@ -200,7 +200,7 @@ namespace rtl_tests
200200
EXPECT_TRUE(err2 == error::CloningDisabled);
201201
ASSERT_TRUE(eventCp0.isEmpty());
202202

203-
error reterr = cxx::mirror().enableCloning(event);
203+
error reterr = cxx::mirror().setupCloning(event);
204204
ASSERT_TRUE(reterr == error::None);
205205

206206
// Try to call copy-constructor of class Event.

RTLTestRunApp/src/FunctionalityTests/ReturnValueReflectionTest.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ namespace rtl_tests
5151
EXPECT_TRUE(err == rtl::error::CloningDisabled);
5252
}
5353

54-
rtl::error reterr = cxx::mirror().enableCloning(event);
54+
rtl::error reterr = cxx::mirror().setupCloning(event);
5555
ASSERT_TRUE(reterr == rtl::error::None);
5656

5757
{

RTLTestRunApp/src/RObjectTests/RObjectReflecting_stdSharedPtr.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ namespace rtl::unit_test
119119
constexpr const int NUM = -20438;
120120
RObject robj = reflect(std::make_shared<int>(NUM));
121121

122-
error reterr = cxx_mirror().enableCloning(robj);
122+
error reterr = cxx_mirror().setupCloning(robj);
123123
ASSERT_TRUE(reterr == error::None);
124124

125125
ASSERT_FALSE(robj.isEmpty());
@@ -214,7 +214,7 @@ namespace rtl::unit_test
214214
RObject robj = reflect(std::make_shared<int>(NUM));
215215
ASSERT_FALSE(robj.isEmpty());
216216

217-
error reterr = cxx_mirror().enableCloning(robj);
217+
error reterr = cxx_mirror().setupCloning(robj);
218218
ASSERT_TRUE(reterr == error::None);
219219

220220
// --- Step 1: Clone by default (entity::Auto semantics) ---
@@ -271,7 +271,7 @@ namespace rtl::unit_test
271271
ASSERT_FALSE(robj.isEmpty());
272272
ASSERT_TRUE(Node::instanceCount() == 1);
273273

274-
error reterr = cxx_mirror().enableCloning(robj);
274+
error reterr = cxx_mirror().setupCloning(robj);
275275
ASSERT_TRUE(reterr == error::None);
276276

277277
// --- Step 2: Clone by default (entity::Auto semantics) ---
@@ -354,7 +354,7 @@ namespace rtl::unit_test
354354
constexpr const int NUM = 241054;
355355
RObject robj = reflect(std::make_shared<Node>(NUM));
356356

357-
error reterr = cxx_mirror().enableCloning(robj);
357+
error reterr = cxx_mirror().setupCloning(robj);
358358
ASSERT_TRUE(reterr == error::None);
359359

360360
ASSERT_FALSE(robj.isEmpty());
@@ -599,7 +599,7 @@ namespace rtl::unit_test
599599
constexpr const int NUM = 10742;
600600
RObject robj = reflect(std::make_shared<Node>(NUM));
601601

602-
error reterr = cxx_mirror().enableCloning(robj);
602+
error reterr = cxx_mirror().setupCloning(robj);
603603
ASSERT_TRUE(reterr == error::None);
604604

605605
ASSERT_FALSE(robj.isEmpty());

ReflectionTemplateLib/access/inc/CxxMirror.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ namespace rtl
5050
// Constructs CxxMirror using a set of Function objects. All other constructors are disabled.
5151
explicit CxxMirror(const std::vector<Function>& pFunctions);
5252

53-
error enableCloning(const RObject& pTarget) const;
53+
error setupCloning(const RObject& pTarget) const;
5454

5555
// Returns a Record containing function hash-keys for the given record ID.
5656
std::optional<Record> getRecord(const std::size_t pRecordId) const;

0 commit comments

Comments
 (0)