Skip to content

Commit 2128a0f

Browse files
authored
minor Readme refinement.
Clarified descriptions of reflection metadata features and callable entities in the documentation.
1 parent c24a951 commit 2128a0f

File tree

1 file changed

+13
-15
lines changed

1 file changed

+13
-15
lines changed

README.md

Lines changed: 13 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -44,9 +44,7 @@ if(cToStr) { // Function materialized?
4444

4545
* ***Non-Intrusive & Macro-Free*** – Reflection metadata is registered externally via a builder-style API, with no macros, base classes, or intrusive annotations required on user types.
4646

47-
* ***Zero-Overhead by Design*** – Metadata is registered and resolved lazily. Reflection introduces no runtime cost beyond the features explicitly exercised by the user.
48-
49-
* ***Deterministic Lifetimes*** – Automatic ownership tracking of `Heap` and `Stack` instances with zero hidden deep copies.
47+
* ***Zero-Overhead by Design*** – Metadata can be registered and resolved lazily. Reflection introduces no runtime cost beyond the features explicitly exercised by the user.
5048

5149
* ***Cross-Compiler Consistency*** – Implemented entirely in standard C++20, with no compiler extensions or compiler-specific conditional behavior.
5250

@@ -97,7 +95,7 @@ Lookup the `Person` class by its registered name –
9795
std::optional<rtl::Record> classPerson = cxx::mirror().getRecord("Person");
9896
if (!classPerson) { /* Class not registered. */ }
9997
```
100-
`rtl::CxxMirror` provides two lookup APIs that return reflection metadata objects: `rtl::Record` for class/struct, and `rtl::Function` for non-member functions.
98+
`rtl::CxxMirror` provides two lookup APIs that return reflection metadata objects: `rtl::Record` for any registered type (class, struct or pod), and `rtl::Function` for non-member functions.
10199
102100
From `rtl::Record`, registered member functions can be queried as `rtl::Method`. These are metadata descriptors (not callables) and are returned as `std::optional`, which will be empty if the requested entity is not found.
103101
@@ -150,17 +148,17 @@ If the return type is also not known at compile time,`rtl::Return` can be used
150148
```c++
151149
rtl::method<rtl::RObject, rtl::Return()> getName = oGetName->targetT()
152150
.argsT().returnT();
153-
auto [err, ret] = getName(robj)(); // Invoke and receive return value std::string wrapped in rtl::RObject.
151+
auto [err, ret] = getName(robj)(); // Invoke and receive rtl::RObject as return, wrapping std::string underneath.
154152
if (err == rtl::error::None && ret.canViewAs<std::string>()) {
155153
const std::string& name = ret.view<std::string>()->get();
156154
std::cout << name; // Safely view the returned std::string.
157155
}
158156
```
159157
### How RTL Fits Together
160158

161-
At a high level, every registered C++ type is encapsulated as an `rtl::Record`. Callable entities (constructors, free functions, and member functions) are materialized through `rtl::Function` and `rtl::Method`, all of which are discoverable via `rtl::CxxMirror`.
159+
At a high level, every registered C++ type is encapsulated as an `rtl::Record`. Callable entities (functions, member functions and constructors) are materialized through `rtl::Function`, `rtl::Method` and `rtl::Record`, all of which are discoverable via `rtl::CxxMirror`.
162160

163-
RTL provides the following callable wrappers, designed to be as lightweight and performant as `std::function` (and in many micro-benchmarks, faster when fully type-aware):
161+
RTL provides the following callable entities, designed to be as lightweight and performant as `std::function` (and in many micro-benchmarks, faster when fully type-aware):
164162

165163
`rtl::function<>` – Free (non-member) functions
166164

@@ -174,7 +172,7 @@ RTL provides the following callable wrappers, designed to be as lightweight and
174172

175173
These callable types are regular value types: they can be copied, moved, stored in standard containers, and passed around like any other lightweight object.
176174

177-
When invoked, only type-erased callables return an `rtl::error`, with results provided as `rtl::RObject` when both the return and target types are erased or as `std::optional<T>` when only the target type is erased, while fully type-aware callables return `T` directly with no error wrapper.
175+
When invoked, only type-erased callables return an `rtl::error`, with results provided as `rtl::RObject` when both the return and target types are erased or as `std::optional<T>` when only the target type is erased, while fully type-aware callables return `T` directly with no error (by design).
178176

179177
### How to Build (Windows / Linux)
180178
```sh
@@ -189,8 +187,8 @@ Run the generated binaries from `bin/`:
189187

190188
Additional resources:
191189

192-
* `CxxTestRegistration/src/MyReflectionTests/` – Tutorial examples
193190
* `RTLTestRunApp/src` – Detailed test cases
191+
* `RTLTestRunApp/src/MyReflectionTests/` – Tutorial example
194192
* `RTLBenchmarkApp/src` – Benchmark implementations
195193
* `run_benchmarks.sh` – Automated benchmark runs
196194

@@ -228,18 +226,18 @@ If you’re interested in advancing practical runtime reflection in C++ and supp
228226
* Any overloaded method, Const/Non-Const based as well.
229227

230228
***Perfect Forwarding** – Binds LValue/RValue to correct overload.
231-
***Zero Overhead Forwarding** – No temporaries or copies during method forwarding.
229+
***Zero Overhead Forwarding** – No temporaries or copies during dispatch and arguments forwarding.
232230
***Failure Semantics** – Explicit `rtl::error` diagnostics for all reflection operations (no exceptions, no silent failures).
233231
***Smart Pointer Reflection** – Reflect `std::shared_ptr` and `std::unique_ptr`, transparently access the underlying type, with full sharing and cloning semantics.
234232
* 🟨 **Conservative Conversions** – Safely reinterpret reflected values without hidden costs. For example: treat an `int` as a `char`, or a `std::string` as a `std::string_view` / `const char*` — with no hidden copies and only safe, non-widening POD conversions. *(In Progress)*
235-
* 🟨 **Materialize New Types** – Convert a reflected type `A` into type `B` if they are implicitly convertible. Define custom conversions at registration to make them available automatically. *(In Progress)*
236233
* 🚧 **STL Wrapper Support** – Extended support for wrappers like `std::optional` and `std::reference_wrapper`. Return them, forward them as parameters, and access wrapped entities transparently. *(In Progress)*
237-
* 🚧 **Relaxed Argument Matching** – Flexible parameter matching for reflective calls, enabling intuitive conversions and overload resolution. *(In Progress)*
234+
* 🚧 **Relaxed Argument Matching** – Flexible parameter matching for reflective calls, enabling safe conversions (ex- base/derived) and overload resolution. *(In Progress)*
235+
***Inheritance Support**: Next in line.
236+
***Composition Support**: Planned.
238237
***Property Reflection**: Planned.
239238
***Enum Reflection**: Planned.
240-
***Composite Type Reflection**: Planned.
241-
***Inheritance Support**: Planned.
239+
***Metadata iterators**: Planned.
242240

243241
##
244242

245-
***C++ joins the reflection party! – why should Java have all the fun?***
243+
***C++ joins the reflection party! – why should Java have all the fun?***

0 commit comments

Comments
 (0)