From 58927d21440833d3123a6bb8b96a53a4fd13e021 Mon Sep 17 00:00:00 2001 From: Neeraj Date: Mon, 1 Sep 2025 10:28:30 +0530 Subject: [PATCH 01/46] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index dc0f8b34..8a6c687c 100644 --- a/README.md +++ b/README.md @@ -129,7 +129,7 @@ RTL doesn’t invent a new paradigm β€” it extends C++ itself. You create object * βœ… **Reflected Returns** πŸ” – Access return values whose types are unknown at compile time. Validate against the expected type and use them as if the type was known all along. * βœ… **Smart Pointer Reflection** πŸ”— – Reflect `std::shared_ptr` and `std::unique_ptr`, transparently access the underlying type, and benefit from automatic lifetime management with full sharing and cloning semantics. * βœ… **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. -* βœ… **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)* +* 🟨 **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)* * 🚧 **STL Wrapper Support** πŸ“¦ – Extended support for wrappers like `std::optional` and `std::reference_wrapper`. Return them, forward them as parameters, and handle them seamlessly. *(In Progress)* * 🚧 **Relaxed Argument Matching** βš™οΈ – Flexible parameter matching for reflective calls, enabling intuitive conversions and overload resolution. *(In Progress)* * ❌ **Property Reflection**: Planned. From 917e140c251e426e37900faadf9e1fb63529972e Mon Sep 17 00:00:00 2001 From: Neeraj Date: Mon, 1 Sep 2025 10:29:33 +0530 Subject: [PATCH 02/46] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 8a6c687c..f3fbedf6 100644 --- a/README.md +++ b/README.md @@ -128,7 +128,7 @@ RTL doesn’t invent a new paradigm β€” it extends C++ itself. You create object * βœ… **Namespace Support** πŸ—‚οΈ – Group and reflect under namespaces. * βœ… **Reflected Returns** πŸ” – Access return values whose types are unknown at compile time. Validate against the expected type and use them as if the type was known all along. * βœ… **Smart Pointer Reflection** πŸ”— – Reflect `std::shared_ptr` and `std::unique_ptr`, transparently access the underlying type, and benefit from automatic lifetime management with full sharing and cloning semantics. -* βœ… **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. +* 🟨 **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)* * 🟨 **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)* * 🚧 **STL Wrapper Support** πŸ“¦ – Extended support for wrappers like `std::optional` and `std::reference_wrapper`. Return them, forward them as parameters, and handle them seamlessly. *(In Progress)* * 🚧 **Relaxed Argument Matching** βš™οΈ – Flexible parameter matching for reflective calls, enabling intuitive conversions and overload resolution. *(In Progress)* From 40ceea7647d86432eb59d312c97deea947e2b439 Mon Sep 17 00:00:00 2001 From: Neeraj Date: Mon, 1 Sep 2025 10:30:11 +0530 Subject: [PATCH 03/46] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index f3fbedf6..ac739839 100644 --- a/README.md +++ b/README.md @@ -128,7 +128,7 @@ RTL doesn’t invent a new paradigm β€” it extends C++ itself. You create object * βœ… **Namespace Support** πŸ—‚οΈ – Group and reflect under namespaces. * βœ… **Reflected Returns** πŸ” – Access return values whose types are unknown at compile time. Validate against the expected type and use them as if the type was known all along. * βœ… **Smart Pointer Reflection** πŸ”— – Reflect `std::shared_ptr` and `std::unique_ptr`, transparently access the underlying type, and benefit from automatic lifetime management with full sharing and cloning semantics. -* 🟨 **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)* +* 🟨 **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)* * 🟨 **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)* * 🚧 **STL Wrapper Support** πŸ“¦ – Extended support for wrappers like `std::optional` and `std::reference_wrapper`. Return them, forward them as parameters, and handle them seamlessly. *(In Progress)* * 🚧 **Relaxed Argument Matching** βš™οΈ – Flexible parameter matching for reflective calls, enabling intuitive conversions and overload resolution. *(In Progress)* From 0769a13af7643601dfb49fd801fd1af5f903d6a2 Mon Sep 17 00:00:00 2001 From: Neeraj Date: Mon, 1 Sep 2025 11:13:04 +0530 Subject: [PATCH 04/46] Update README.md --- README.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index ac739839..4026d1af 100644 --- a/README.md +++ b/README.md @@ -9,8 +9,6 @@ RTL is implemented as a static library that organizes type-safe function pointer [![License: MIT](https://img.shields.io/badge/License-MIT-green)](LICENSE) ## What RTL Brings to Your Code -[![Design Principles & Features](https://img.shields.io/badge/Doc-Design%20Principles%20%26%20Features-blue)](./Design-Docs/DESIGN_PRINCIPLES_AND_FEATURES.md) -[![RTL Syntax & Semantics](https://img.shields.io/badge/Doc-RTL_at_a_Glance:_Syntax_&_Semantics-blueviolet)](./Design-Docs/RTL_SYNTAX_AND_SEMANTICS.md) * **Runtime Reflection for C++** – Introspect and manipulate objects dynamically, similar to Java or .NET, but with modern C++ idioms. @@ -28,6 +26,9 @@ RTL is implemented as a static library that organizes type-safe function pointer * **Tooling-Friendly Architecture** – Reflection data is encapsulated in a single immutable, lazily-initialized object that can be shared with tools and frameworks without compile-time type knowledge β€” ideal for serializers, debuggers, test frameworks, scripting engines, and editors. +[![Design Principles & Features](https://img.shields.io/badge/Doc-Design%20Principles%20%26%20Features-blue)](./Design-Docs/DESIGN_PRINCIPLES_AND_FEATURES.md) +[![RTL Syntax & Semantics](https://img.shields.io/badge/Doc-RTL_at_a_Glance:_Syntax_&_Semantics-blueviolet)](./Design-Docs/RTL_SYNTAX_AND_SEMANTICS.md) +--- ## A Quick Preview: Reflection That Looks and Feels Like C++ ```c++ From 54a845a67121087a13900a08482cdb9c384dc15b Mon Sep 17 00:00:00 2001 From: Neeraj Date: Mon, 1 Sep 2025 11:35:15 +0530 Subject: [PATCH 05/46] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 4026d1af..f1fd4c2e 100644 --- a/README.md +++ b/README.md @@ -27,7 +27,7 @@ RTL is implemented as a static library that organizes type-safe function pointer * **Tooling-Friendly Architecture** – Reflection data is encapsulated in a single immutable, lazily-initialized object that can be shared with tools and frameworks without compile-time type knowledge β€” ideal for serializers, debuggers, test frameworks, scripting engines, and editors. [![Design Principles & Features](https://img.shields.io/badge/Doc-Design%20Principles%20%26%20Features-blue)](./Design-Docs/DESIGN_PRINCIPLES_AND_FEATURES.md) -[![RTL Syntax & Semantics](https://img.shields.io/badge/Doc-RTL_at_a_Glance:_Syntax_&_Semantics-blueviolet)](./Design-Docs/RTL_SYNTAX_AND_SEMANTICS.md) +[![RTL Syntax & Semantics](https://img.shields.io/badge/Doc-Syntax_&_Semantics-blueviolet)](./Design-Docs/RTL_SYNTAX_AND_SEMANTICS.md) --- ## A Quick Preview: Reflection That Looks and Feels Like C++ From 94a16ac297ba12ac5198524aa16e3148affdfbe3 Mon Sep 17 00:00:00 2001 From: Neeraj Date: Mon, 1 Sep 2025 14:09:10 +0530 Subject: [PATCH 06/46] Update README.md --- README.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/README.md b/README.md index f1fd4c2e..0a58c7bf 100644 --- a/README.md +++ b/README.md @@ -25,8 +25,7 @@ RTL is implemented as a static library that organizes type-safe function pointer * **Cross-Compiler Consistency** – Pure standard C++20, with no compiler extensions or conditional branching on compiler differences. * **Tooling-Friendly Architecture** – Reflection data is encapsulated in a single immutable, lazily-initialized object that can be shared with tools and frameworks without compile-time type knowledge β€” ideal for serializers, debuggers, test frameworks, scripting engines, and editors. - -[![Design Principles & Features](https://img.shields.io/badge/Doc-Design%20Principles%20%26%20Features-blue)](./Design-Docs/DESIGN_PRINCIPLES_AND_FEATURES.md) +[![Design Features](https://img.shields.io/badge/Doc-Design%20Features-blue)](./Design-Docs/DESIGN_PRINCIPLES_AND_FEATURES.md) [![RTL Syntax & Semantics](https://img.shields.io/badge/Doc-Syntax_&_Semantics-blueviolet)](./Design-Docs/RTL_SYNTAX_AND_SEMANTICS.md) --- ## A Quick Preview: Reflection That Looks and Feels Like C++ From fe620392e26cfb08a9af4ea65e834914bd9ae6e8 Mon Sep 17 00:00:00 2001 From: Neeraj Date: Mon, 1 Sep 2025 14:09:40 +0530 Subject: [PATCH 07/46] Update README.md --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index 0a58c7bf..7edbbc27 100644 --- a/README.md +++ b/README.md @@ -25,8 +25,10 @@ RTL is implemented as a static library that organizes type-safe function pointer * **Cross-Compiler Consistency** – Pure standard C++20, with no compiler extensions or conditional branching on compiler differences. * **Tooling-Friendly Architecture** – Reflection data is encapsulated in a single immutable, lazily-initialized object that can be shared with tools and frameworks without compile-time type knowledge β€” ideal for serializers, debuggers, test frameworks, scripting engines, and editors. + [![Design Features](https://img.shields.io/badge/Doc-Design%20Features-blue)](./Design-Docs/DESIGN_PRINCIPLES_AND_FEATURES.md) [![RTL Syntax & Semantics](https://img.shields.io/badge/Doc-Syntax_&_Semantics-blueviolet)](./Design-Docs/RTL_SYNTAX_AND_SEMANTICS.md) + --- ## A Quick Preview: Reflection That Looks and Feels Like C++ From f59c35397dfda85e2ba5329fbf6543474e6e2dce Mon Sep 17 00:00:00 2001 From: Neeraj Date: Mon, 1 Sep 2025 14:11:37 +0530 Subject: [PATCH 08/46] Update DESIGN_PRINCIPLES_AND_FEATURES.md --- Design-Docs/DESIGN_PRINCIPLES_AND_FEATURES.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Design-Docs/DESIGN_PRINCIPLES_AND_FEATURES.md b/Design-Docs/DESIGN_PRINCIPLES_AND_FEATURES.md index 80f110d0..c98d67bf 100644 --- a/Design-Docs/DESIGN_PRINCIPLES_AND_FEATURES.md +++ b/Design-Docs/DESIGN_PRINCIPLES_AND_FEATURES.md @@ -10,8 +10,8 @@ Instead, registration is explicit and lazy. For each registered type, RTL contributes **two lightweight entries** into its process-local tables: -* A **lambda wrapper** placed in a `static` `std::vector`, responsible for calling the actual function or constructor with perfect forwarding. -* A **raw function pointer** stored in a parallel `static` `std::vector`, used to detect and prevent redundant registrations. +* A **lambda wrapper** placed in a scoped `static` `std::vector`, responsible for calling the actual function or constructor with perfect forwarding. +* A **raw function pointer** stored in a parallel scoped `static` `std::vector`, used to detect and prevent redundant registrations. From there, `rtl::CxxMirror` does not hold onto heavyweight state. It is **as ordinary as any local variable** β€” you can construct one, keep it alive for the entire application, or discard it after a short-lived query. The same `rtl::CxxMirror` can be materialized again with the same or different set of types. RTL guarantees that **materializing the same registration sequence multiple times** (for example): From 2f332890ec4e9d3c305b18da8bcaa99c7bb8410a Mon Sep 17 00:00:00 2001 From: Neeraj Date: Mon, 1 Sep 2025 14:12:29 +0530 Subject: [PATCH 09/46] Update DESIGN_PRINCIPLES_AND_FEATURES.md --- Design-Docs/DESIGN_PRINCIPLES_AND_FEATURES.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Design-Docs/DESIGN_PRINCIPLES_AND_FEATURES.md b/Design-Docs/DESIGN_PRINCIPLES_AND_FEATURES.md index c98d67bf..019f8d10 100644 --- a/Design-Docs/DESIGN_PRINCIPLES_AND_FEATURES.md +++ b/Design-Docs/DESIGN_PRINCIPLES_AND_FEATURES.md @@ -10,7 +10,7 @@ Instead, registration is explicit and lazy. For each registered type, RTL contributes **two lightweight entries** into its process-local tables: -* A **lambda wrapper** placed in a scoped `static` `std::vector`, responsible for calling the actual function or constructor with perfect forwarding. +* A **lambda wrapper** placed in a scoped `static` `std::vector`, responsible for calling the actual function pointer or constructor with perfect forwarding. * A **raw function pointer** stored in a parallel scoped `static` `std::vector`, used to detect and prevent redundant registrations. From there, `rtl::CxxMirror` does not hold onto heavyweight state. It is **as ordinary as any local variable** β€” you can construct one, keep it alive for the entire application, or discard it after a short-lived query. The same `rtl::CxxMirror` can be materialized again with the same or different set of types. RTL guarantees that **materializing the same registration sequence multiple times** (for example): From 4f06a05c6288dd92c88b69be527f0fb7e6b63d8d Mon Sep 17 00:00:00 2001 From: Neeraj Date: Mon, 1 Sep 2025 14:41:07 +0530 Subject: [PATCH 10/46] Update DESIGN_PRINCIPLES_AND_FEATURES.md --- Design-Docs/DESIGN_PRINCIPLES_AND_FEATURES.md | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/Design-Docs/DESIGN_PRINCIPLES_AND_FEATURES.md b/Design-Docs/DESIGN_PRINCIPLES_AND_FEATURES.md index 019f8d10..a42cea6f 100644 --- a/Design-Docs/DESIGN_PRINCIPLES_AND_FEATURES.md +++ b/Design-Docs/DESIGN_PRINCIPLES_AND_FEATURES.md @@ -53,16 +53,11 @@ RTL validates all critical assumptions before proceeding, ensuring predictable b ### πŸ”’ Const-By-Default Discipline -RTL enforces a *const-by-default* discipline. -All objects **created by RTL through reflection** are treated as immutable unless the caller explicitly requests mutation. - -This means: - -* **No accidental state changes** β€” reflected objects default to safe, immutable views. -* **Immediate clarity** β€” mutable access is visually deliberate in the code. -* **Defensive by design** β€” the default assumption is safety; mutation is always an opt-in. - -At the same time, RTL **respects the declared constness of external objects** (e.g., return values or user-provided instances). If an object is handed to RTL as `const` *(true-const)*, RTL will not attempt to override that contract. Only RTL-created objects guarantee that a logical `const_cast` is always safe. +RTL enforces a *const-by-default* discipline. All objects **created through reflection** start as *logically-const* β€” they default to immutability. If no const overload exists, RTL will **automatically fall back** to the non-const overload, since these objects were never originally declared `const`. Explicit `rtl::constCast()` is only required when both const and non-const overloads are present. + +The guiding principle is simple: reflective objects are safe by default, and any mutation must be a conscious, visible decision by the caller. + +At the same time, RTL strictly respects **true-const** objects (e.g., declared-`const` instances or const return values). Such objects remain immutable inside RTL β€” any attempt to force mutation results in predictable error code (`rtl::error::IllegalConstCast`). > *"RTL never mutates true-const objects, and for RTL-created ones it defaults to const, falling back only if needed β€” explicit rtl::constCast() is required when both overloads exist."* From b6ab8d63c56882e317b9b8cbe7d6b85b2c7e7cde Mon Sep 17 00:00:00 2001 From: Neeraj Date: Mon, 1 Sep 2025 17:18:23 +0530 Subject: [PATCH 11/46] Update DESIGN_PRINCIPLES_AND_FEATURES.md --- Design-Docs/DESIGN_PRINCIPLES_AND_FEATURES.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Design-Docs/DESIGN_PRINCIPLES_AND_FEATURES.md b/Design-Docs/DESIGN_PRINCIPLES_AND_FEATURES.md index a42cea6f..42eeb052 100644 --- a/Design-Docs/DESIGN_PRINCIPLES_AND_FEATURES.md +++ b/Design-Docs/DESIGN_PRINCIPLES_AND_FEATURES.md @@ -10,7 +10,7 @@ Instead, registration is explicit and lazy. For each registered type, RTL contributes **two lightweight entries** into its process-local tables: -* A **lambda wrapper** placed in a scoped `static` `std::vector`, responsible for calling the actual function pointer or constructor with perfect forwarding. +* A **lambda wrapper** placed in a scoped `static` `std::vector` and is responsible for making the final call using the actual function pointer with perfect forwarding. * A **raw function pointer** stored in a parallel scoped `static` `std::vector`, used to detect and prevent redundant registrations. From there, `rtl::CxxMirror` does not hold onto heavyweight state. It is **as ordinary as any local variable** β€” you can construct one, keep it alive for the entire application, or discard it after a short-lived query. The same `rtl::CxxMirror` can be materialized again with the same or different set of types. RTL guarantees that **materializing the same registration sequence multiple times** (for example): From 07c47b3ad1980b6646cb9dd8174c5adb57601c01 Mon Sep 17 00:00:00 2001 From: Neeraj Date: Mon, 1 Sep 2025 17:20:40 +0530 Subject: [PATCH 12/46] Update DESIGN_PRINCIPLES_AND_FEATURES.md --- Design-Docs/DESIGN_PRINCIPLES_AND_FEATURES.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Design-Docs/DESIGN_PRINCIPLES_AND_FEATURES.md b/Design-Docs/DESIGN_PRINCIPLES_AND_FEATURES.md index 42eeb052..f7efa6fc 100644 --- a/Design-Docs/DESIGN_PRINCIPLES_AND_FEATURES.md +++ b/Design-Docs/DESIGN_PRINCIPLES_AND_FEATURES.md @@ -16,7 +16,7 @@ For each registered type, RTL contributes **two lightweight entries** into its p From there, `rtl::CxxMirror` does not hold onto heavyweight state. It is **as ordinary as any local variable** β€” you can construct one, keep it alive for the entire application, or discard it after a short-lived query. The same `rtl::CxxMirror` can be materialized again with the same or different set of types. RTL guarantees that **materializing the same registration sequence multiple times** (for example): ```cpp -rtl::type().member().method("getName").build(Person::getName); +rtl::type().member().method("getName").build(&Person::getName); ``` will always yield **exactly the same metadata**, without ever admitting redundant lambdas or function pointers into the static tables. From dbf042b71f0dd565a378190ecc57ef182c434490 Mon Sep 17 00:00:00 2001 From: Neeraj Date: Tue, 2 Sep 2025 07:48:53 +0530 Subject: [PATCH 13/46] Update DESIGN_PRINCIPLES_AND_FEATURES.md --- Design-Docs/DESIGN_PRINCIPLES_AND_FEATURES.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Design-Docs/DESIGN_PRINCIPLES_AND_FEATURES.md b/Design-Docs/DESIGN_PRINCIPLES_AND_FEATURES.md index f7efa6fc..3e65923c 100644 --- a/Design-Docs/DESIGN_PRINCIPLES_AND_FEATURES.md +++ b/Design-Docs/DESIGN_PRINCIPLES_AND_FEATURES.md @@ -95,7 +95,7 @@ The key idea is that RTL doesn’t force you into a wrapper-first mindset. Inste #### ✨ The Mirror & The Reflection -> A client system hands off a `CxxMirror` to RTL β€” and RTL sees its reflection. +> *A client system hands off a `CxxMirror` to RTL β€” and RTL sees its reflection.* That’s it. The mirror is a **single object**, typically returned from a function like: From 861925954d230bd12bfef4ec7027aa706748dea3 Mon Sep 17 00:00:00 2001 From: Neeraj Date: Tue, 2 Sep 2025 07:59:16 +0530 Subject: [PATCH 14/46] Update RTL_SYNTAX_AND_SEMANTICS.md --- Design-Docs/RTL_SYNTAX_AND_SEMANTICS.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Design-Docs/RTL_SYNTAX_AND_SEMANTICS.md b/Design-Docs/RTL_SYNTAX_AND_SEMANTICS.md index ad21568d..ba2b1e13 100644 --- a/Design-Docs/RTL_SYNTAX_AND_SEMANTICS.md +++ b/Design-Docs/RTL_SYNTAX_AND_SEMANTICS.md @@ -38,7 +38,7 @@ Every registration you make using the builder pattern is collected into the `rtl * **Dispensable by design** β†’ The `rtl::CxxMirror` itself carries no hidden global state. You can define one central mirror, create multiple mirrors in different scopes, or even rebuild mirrors on demand. RTL imposes no restriction on how you manage its lifetime. -* **Duplicate registration is harmless** β†’ Identical registrations always materialize the same metadata. If a canonical function pointer or constructor is already registered, it is not added again to the pointer/lambda table β€” the metadata simply refers back to the existing entry. +* **Duplicate registration is harmless** β†’ Identical registrations always materialize the same metadata. If a canonical function pointer is already registered, it is not added again to the pointer/lambda table β€” the metadata simply refers back to the existing entry. * **Thread-safety guaranteed by RTL** β†’ No matter how you choose to manage mirrors (singleton, multiple, or transient), RTL itself guarantees synchronized, race-free registration and access across threads. @@ -47,7 +47,7 @@ Every registration you make using the builder pattern is collected into the `rtl You are free to manage mirrors however your design requires: one mirror for the whole program, multiple mirrors for modularity, or transient mirrors in local scopes. RTL is designed to work correctly in all cases, while keeping its small, deliberate overhead in mind to ensure safety and efficiency. πŸ‘‰ **Tip** -> ***When many types need registering for the full application lifetime, a singleton `rtl::CxxMirror` is your safest and simplest choice β€” one instance, zero surprises.*** +> *You are free to manage `rtl::CxxMirror` however your design demands β€” but remember that each registration carries a small overhead, negligible in isolation yet significant when compounded across many types.* --- From cb96675f48b364a556885438230426b0bccdf1bf Mon Sep 17 00:00:00 2001 From: Neeraj Date: Tue, 2 Sep 2025 08:00:26 +0530 Subject: [PATCH 15/46] Update RTL_SYNTAX_AND_SEMANTICS.md --- Design-Docs/RTL_SYNTAX_AND_SEMANTICS.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Design-Docs/RTL_SYNTAX_AND_SEMANTICS.md b/Design-Docs/RTL_SYNTAX_AND_SEMANTICS.md index ba2b1e13..d28af959 100644 --- a/Design-Docs/RTL_SYNTAX_AND_SEMANTICS.md +++ b/Design-Docs/RTL_SYNTAX_AND_SEMANTICS.md @@ -46,7 +46,7 @@ Every registration you make using the builder pattern is collected into the `rtl You are free to manage mirrors however your design requires: one mirror for the whole program, multiple mirrors for modularity, or transient mirrors in local scopes. RTL is designed to work correctly in all cases, while keeping its small, deliberate overhead in mind to ensure safety and efficiency. -πŸ‘‰ **Tip** +πŸ‘‰ **Bottom line** > *You are free to manage `rtl::CxxMirror` however your design demands β€” but remember that each registration carries a small overhead, negligible in isolation yet significant when compounded across many types.* --- From 0aaa60e12e4bd57ccefd796d87bb503c692368f1 Mon Sep 17 00:00:00 2001 From: Neeraj Date: Tue, 2 Sep 2025 09:41:08 +0530 Subject: [PATCH 16/46] Update CxxMirrorObjectTest.cpp --- .../src/CxxMirrorTests/CxxMirrorObjectTest.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CxxRTLTestApplication/src/CxxMirrorTests/CxxMirrorObjectTest.cpp b/CxxRTLTestApplication/src/CxxMirrorTests/CxxMirrorObjectTest.cpp index 067ee245..570a8d33 100644 --- a/CxxRTLTestApplication/src/CxxMirrorTests/CxxMirrorObjectTest.cpp +++ b/CxxRTLTestApplication/src/CxxMirrorTests/CxxMirrorObjectTest.cpp @@ -362,4 +362,4 @@ namespace rtl_tests EXPECT_EQ(cfunctorIds, stdfunctorIds); } -} \ No newline at end of file +} From be2f89b1468be8c432ef1d97af228aaabd54cd5d Mon Sep 17 00:00:00 2001 From: Neeraj Date: Tue, 2 Sep 2025 12:17:49 +0530 Subject: [PATCH 17/46] Update README.md --- README.md | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 7edbbc27..c872faf0 100644 --- a/README.md +++ b/README.md @@ -10,21 +10,21 @@ RTL is implemented as a static library that organizes type-safe function pointer ## What RTL Brings to Your Code -* **Runtime Reflection for C++** – Introspect and manipulate objects dynamically, similar to Java or .NET, but with modern C++ idioms. +* ***Runtime Reflection for C++*** – Introspect and manipulate objects dynamically, similar to Java or .NET, but with modern C++ idioms. * **Single Source of Truth** – All metadata lives in one immutable `rtl::CxxMirror`, ensuring a consistent, thread-safe, duplication-free, and deterministic view of reflection data. -* **Non-Intrusive & Macro-Free** – Register reflection metadata externally via a clean builder pattern; no macros, base classes, or global registries. +* ***Non-Intrusive & Macro-Free*** – Register reflection metadata externally via a clean builder pattern; no macros, base classes, or global registries. -* **Const-By-Default Safety** – Everything is immutable unless explicitly mutable, preventing unintended side-effects in reflective code. +* ***Zero-Overhead by Design*** – Metadata is registered and resolved only when used. Reflection introduces no cost beyond the features you explicitly employ. -* **Exception-Free Surface** – All predictable failures return error codes; no hidden throws. +* ***Exception-Free Surface*** – All predictable failures return error codes; no hidden throws. -* **Deterministic Lifetimes** – Automatic ownership tracking of `Heap` and `Stack` instances with zero hidden deep copies. +* ***Deterministic Lifetimes*** – Automatic ownership tracking of `Heap` and `Stack` instances with zero hidden deep copies. -* **Cross-Compiler Consistency** – Pure standard C++20, with no compiler extensions or conditional branching on compiler differences. +* ***Cross-Compiler Consistency*** – Pure standard C++20, with no compiler extensions or conditional branching on compiler differences. -* **Tooling-Friendly Architecture** – Reflection data is encapsulated in a single immutable, lazily-initialized object that can be shared with tools and frameworks without compile-time type knowledge β€” ideal for serializers, debuggers, test frameworks, scripting engines, and editors. +* ***Tooling-Friendly Architecture*** – Reflection data is encapsulated in a single immutable, lazily-initialized object that can be shared with tools and frameworks without compile-time type knowledge β€” ideal for serializers, debuggers, test frameworks, scripting engines, and editors. [![Design Features](https://img.shields.io/badge/Doc-Design%20Features-blue)](./Design-Docs/DESIGN_PRINCIPLES_AND_FEATURES.md) [![RTL Syntax & Semantics](https://img.shields.io/badge/Doc-Syntax_&_Semantics-blueviolet)](./Design-Docs/RTL_SYNTAX_AND_SEMANTICS.md) From 0ade581e48623fd580dbfea315f4d50eaef36e97 Mon Sep 17 00:00:00 2001 From: Neeraj Date: Tue, 2 Sep 2025 12:20:54 +0530 Subject: [PATCH 18/46] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index c872faf0..cb249841 100644 --- a/README.md +++ b/README.md @@ -12,7 +12,7 @@ RTL is implemented as a static library that organizes type-safe function pointer * ***Runtime Reflection for C++*** – Introspect and manipulate objects dynamically, similar to Java or .NET, but with modern C++ idioms. -* **Single Source of Truth** – All metadata lives in one immutable `rtl::CxxMirror`, ensuring a consistent, thread-safe, duplication-free, and deterministic view of reflection data. +* ***Single Source of Truth*** – All metadata lives in one immutable `rtl::CxxMirror`, ensuring a consistent, thread-safe, duplication-free, and deterministic view of reflection data. * ***Non-Intrusive & Macro-Free*** – Register reflection metadata externally via a clean builder pattern; no macros, base classes, or global registries. From e6c3270d6f20eedd437bffaeb09d7e2526c60af6 Mon Sep 17 00:00:00 2001 From: Neeraj Date: Tue, 2 Sep 2025 12:21:26 +0530 Subject: [PATCH 19/46] Update README.md --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index cb249841..453eadc3 100644 --- a/README.md +++ b/README.md @@ -26,6 +26,7 @@ RTL is implemented as a static library that organizes type-safe function pointer * ***Tooling-Friendly Architecture*** – Reflection data is encapsulated in a single immutable, lazily-initialized object that can be shared with tools and frameworks without compile-time type knowledge β€” ideal for serializers, debuggers, test frameworks, scripting engines, and editors. + [![Design Features](https://img.shields.io/badge/Doc-Design%20Features-blue)](./Design-Docs/DESIGN_PRINCIPLES_AND_FEATURES.md) [![RTL Syntax & Semantics](https://img.shields.io/badge/Doc-Syntax_&_Semantics-blueviolet)](./Design-Docs/RTL_SYNTAX_AND_SEMANTICS.md) From 92a9c63da7439599094f41a96871f9273e35bd70 Mon Sep 17 00:00:00 2001 From: Neeraj Date: Tue, 2 Sep 2025 12:46:23 +0530 Subject: [PATCH 20/46] Update LICENSE --- LICENSE | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/LICENSE b/LICENSE index 313073f0..7dc0e44c 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ The MIT License (MIT) -Copyright (c) 2025 Neeraj Singh (reflectcxx@outlook.com) +Copyright (c) 2025 Neeraj Singh Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal From 28f768771958f92ed7cfe71d406ffb861ea68d42 Mon Sep 17 00:00:00 2001 From: Neeraj Date: Tue, 2 Sep 2025 16:56:57 +0530 Subject: [PATCH 21/46] Update README.md --- README.md | 1 - 1 file changed, 1 deletion(-) diff --git a/README.md b/README.md index 453eadc3..4b66e041 100644 --- a/README.md +++ b/README.md @@ -30,7 +30,6 @@ RTL is implemented as a static library that organizes type-safe function pointer [![Design Features](https://img.shields.io/badge/Doc-Design%20Features-blue)](./Design-Docs/DESIGN_PRINCIPLES_AND_FEATURES.md) [![RTL Syntax & Semantics](https://img.shields.io/badge/Doc-Syntax_&_Semantics-blueviolet)](./Design-Docs/RTL_SYNTAX_AND_SEMANTICS.md) ---- ## A Quick Preview: Reflection That Looks and Feels Like C++ ```c++ From 062cc88cb86303544b30d75695e3fd711c58f926 Mon Sep 17 00:00:00 2001 From: Neeraj Date: Tue, 2 Sep 2025 19:44:16 +0530 Subject: [PATCH 22/46] Update DESIGN_PRINCIPLES_AND_FEATURES.md --- Design-Docs/DESIGN_PRINCIPLES_AND_FEATURES.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Design-Docs/DESIGN_PRINCIPLES_AND_FEATURES.md b/Design-Docs/DESIGN_PRINCIPLES_AND_FEATURES.md index 3e65923c..5d760f09 100644 --- a/Design-Docs/DESIGN_PRINCIPLES_AND_FEATURES.md +++ b/Design-Docs/DESIGN_PRINCIPLES_AND_FEATURES.md @@ -10,7 +10,7 @@ Instead, registration is explicit and lazy. For each registered type, RTL contributes **two lightweight entries** into its process-local tables: -* A **lambda wrapper** placed in a scoped `static` `std::vector` and is responsible for making the final call using the actual function pointer with perfect forwarding. +* A **lambda wrapper** placed in a scoped `static` `std::vector` and is responsible for making the final call using the actual functor. * A **raw function pointer** stored in a parallel scoped `static` `std::vector`, used to detect and prevent redundant registrations. From there, `rtl::CxxMirror` does not hold onto heavyweight state. It is **as ordinary as any local variable** β€” you can construct one, keep it alive for the entire application, or discard it after a short-lived query. The same `rtl::CxxMirror` can be materialized again with the same or different set of types. RTL guarantees that **materializing the same registration sequence multiple times** (for example): @@ -49,6 +49,8 @@ This is extremely unlikely, but not absolutely impossible β€” no system is perfe For every predictable failure case, RTL returns explicit error codes instead of throwing. RTL validates all critical assumptions before proceeding, ensuring predictable behavior and eliminating mid-operation surprises. +> *"Exceptions should never surprise you β€” in RTL, failures are explicit, validated, and reported as error codes, not as hidden runtime traps."* + --- ### πŸ”’ Const-By-Default Discipline From 6f06ba87a68d3c0be4ec9b9b295437f2d9f574bd Mon Sep 17 00:00:00 2001 From: Neeraj Date: Tue, 2 Sep 2025 19:47:06 +0530 Subject: [PATCH 23/46] Update DESIGN_PRINCIPLES_AND_FEATURES.md --- Design-Docs/DESIGN_PRINCIPLES_AND_FEATURES.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Design-Docs/DESIGN_PRINCIPLES_AND_FEATURES.md b/Design-Docs/DESIGN_PRINCIPLES_AND_FEATURES.md index 5d760f09..9a151dee 100644 --- a/Design-Docs/DESIGN_PRINCIPLES_AND_FEATURES.md +++ b/Design-Docs/DESIGN_PRINCIPLES_AND_FEATURES.md @@ -13,7 +13,7 @@ For each registered type, RTL contributes **two lightweight entries** into its p * A **lambda wrapper** placed in a scoped `static` `std::vector` and is responsible for making the final call using the actual functor. * A **raw function pointer** stored in a parallel scoped `static` `std::vector`, used to detect and prevent redundant registrations. -From there, `rtl::CxxMirror` does not hold onto heavyweight state. It is **as ordinary as any local variable** β€” you can construct one, keep it alive for the entire application, or discard it after a short-lived query. The same `rtl::CxxMirror` can be materialized again with the same or different set of types. RTL guarantees that **materializing the same registration sequence multiple times** (for example): +From there, `rtl::CxxMirror` does not hold onto heavyweight state. It is **as ordinary as any local variable** β€” you can construct one, keep it alive for the entire application, or discard it after a short-lived query. The `CxxMirror` can be materialized again with the same or different set of types. RTL guarantees that **materializing the same registration sequence multiple times** (for example): ```cpp rtl::type().member().method("getName").build(&Person::getName); From 0526e9a6ed877d93ec403d364677c2a2ad5b4599 Mon Sep 17 00:00:00 2001 From: Neeraj Date: Tue, 2 Sep 2025 19:48:42 +0530 Subject: [PATCH 24/46] Update DESIGN_PRINCIPLES_AND_FEATURES.md --- Design-Docs/DESIGN_PRINCIPLES_AND_FEATURES.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Design-Docs/DESIGN_PRINCIPLES_AND_FEATURES.md b/Design-Docs/DESIGN_PRINCIPLES_AND_FEATURES.md index 9a151dee..a15e3e8f 100644 --- a/Design-Docs/DESIGN_PRINCIPLES_AND_FEATURES.md +++ b/Design-Docs/DESIGN_PRINCIPLES_AND_FEATURES.md @@ -19,7 +19,7 @@ From there, `rtl::CxxMirror` does not hold onto heavyweight state. It is **as or rtl::type().member().method("getName").build(&Person::getName); ``` -will always yield **exactly the same metadata**, without ever admitting redundant lambdas or function pointers into the static tables. +will always yield **exactly the same metadata**, without ever admitting redundant lambdas or functors into the static tables. > *"Mirrors are **cheap and repeatable**: the metadata is stable, redundant entries are never entertained, and the user remains in full control of a mirror’s lifetime."* From 6efb0ec56a8c76334723d536dd822f10d66e75ee Mon Sep 17 00:00:00 2001 From: Neeraj Date: Tue, 2 Sep 2025 19:56:29 +0530 Subject: [PATCH 25/46] Update RTL_SYNTAX_AND_SEMANTICS.md --- Design-Docs/RTL_SYNTAX_AND_SEMANTICS.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Design-Docs/RTL_SYNTAX_AND_SEMANTICS.md b/Design-Docs/RTL_SYNTAX_AND_SEMANTICS.md index d28af959..c8e8e71d 100644 --- a/Design-Docs/RTL_SYNTAX_AND_SEMANTICS.md +++ b/Design-Docs/RTL_SYNTAX_AND_SEMANTICS.md @@ -38,7 +38,7 @@ Every registration you make using the builder pattern is collected into the `rtl * **Dispensable by design** β†’ The `rtl::CxxMirror` itself carries no hidden global state. You can define one central mirror, create multiple mirrors in different scopes, or even rebuild mirrors on demand. RTL imposes no restriction on how you manage its lifetime. -* **Duplicate registration is harmless** β†’ Identical registrations always materialize the same metadata. If a canonical function pointer is already registered, it is not added again to the pointer/lambda table β€” the metadata simply refers back to the existing entry. +* **Duplicate registration is harmless** β†’ Identical registrations always materialize the same metadata. If a canonical function pointer is already registered, it is not added again to the lambda/functor table β€” the metadata simply refers back to the existing entry. * **Thread-safety guaranteed by RTL** β†’ No matter how you choose to manage mirrors (singleton, multiple, or transient), RTL itself guarantees synchronized, race-free registration and access across threads. From 20d09499d7bdb61b6f53a6661e8cd20cf5525140 Mon Sep 17 00:00:00 2001 From: Neeraj Date: Tue, 2 Sep 2025 20:10:17 +0530 Subject: [PATCH 26/46] Update RTL_SYNTAX_AND_SEMANTICS.md --- Design-Docs/RTL_SYNTAX_AND_SEMANTICS.md | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/Design-Docs/RTL_SYNTAX_AND_SEMANTICS.md b/Design-Docs/RTL_SYNTAX_AND_SEMANTICS.md index c8e8e71d..3fba10ef 100644 --- a/Design-Docs/RTL_SYNTAX_AND_SEMANTICS.md +++ b/Design-Docs/RTL_SYNTAX_AND_SEMANTICS.md @@ -42,12 +42,15 @@ Every registration you make using the builder pattern is collected into the `rtl * **Thread-safety guaranteed by RTL** β†’ No matter how you choose to manage mirrors (singleton, multiple, or transient), RTL itself guarantees synchronized, race-free registration and access across threads. -* **Overhead is deliberate** β†’ Each registration carries a small cost in memory and initialization time. This overhead exists to provide thread-safety, robustness, and avoidance of redundant registration, and should be considered when creating many mirrors or registering large numbers of types. - -You are free to manage mirrors however your design requires: one mirror for the whole program, multiple mirrors for modularity, or transient mirrors in local scopes. RTL is designed to work correctly in all cases, while keeping its small, deliberate overhead in mind to ensure safety and efficiency. - -πŸ‘‰ **Bottom line** -> *You are free to manage `rtl::CxxMirror` however your design demands β€” but remember that each registration carries a small overhead, negligible in isolation yet significant when compounded across many types.* +* **Overhead is deliberate** β†’ Each registration carries a small cost in memory and initialization time. Concretely: +* Every registration statement acquires a lock on the functor table. +* It checks whether the function or lambda is already present. +* If not, it adds the new entry to the lambda table and updates the functor table. + +This ensures thread-safety and prevents redundant entries. While negligible for isolated registrations, this cost can accumulate when creating many mirrors or registering large numbers of types. + +πŸ‘‰ Bottom Line +> *"Manage rtl::CxxMirror however your design requires β€” singleton, multiple, or transient. Each registration incurs a lock and table lookup, but the cost is negligible in normal use and only noticeable when scaling to very large numbers of types."* --- From 383657db561e68c8c998b3fa147e964a4e3f8ecc Mon Sep 17 00:00:00 2001 From: Neeraj Date: Tue, 2 Sep 2025 20:13:32 +0530 Subject: [PATCH 27/46] Update RTL_SYNTAX_AND_SEMANTICS.md --- Design-Docs/RTL_SYNTAX_AND_SEMANTICS.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Design-Docs/RTL_SYNTAX_AND_SEMANTICS.md b/Design-Docs/RTL_SYNTAX_AND_SEMANTICS.md index 3fba10ef..5357e458 100644 --- a/Design-Docs/RTL_SYNTAX_AND_SEMANTICS.md +++ b/Design-Docs/RTL_SYNTAX_AND_SEMANTICS.md @@ -43,9 +43,9 @@ Every registration you make using the builder pattern is collected into the `rtl * **Thread-safety guaranteed by RTL** β†’ No matter how you choose to manage mirrors (singleton, multiple, or transient), RTL itself guarantees synchronized, race-free registration and access across threads. * **Overhead is deliberate** β†’ Each registration carries a small cost in memory and initialization time. Concretely: -* Every registration statement acquires a lock on the functor table. -* It checks whether the function or lambda is already present. -* If not, it adds the new entry to the lambda table and updates the functor table. + * Every registration statement acquires a lock on the functor table. + * It checks whether the function or lambda is already present. + * If not, it adds the new entry to the lambda table and updates the functor table. This ensures thread-safety and prevents redundant entries. While negligible for isolated registrations, this cost can accumulate when creating many mirrors or registering large numbers of types. From 666097f802f537aba2d6f78da643b7d8a2f2f5b9 Mon Sep 17 00:00:00 2001 From: Neeraj Date: Tue, 2 Sep 2025 20:30:32 +0530 Subject: [PATCH 28/46] Update RTL_SYNTAX_AND_SEMANTICS.md --- Design-Docs/RTL_SYNTAX_AND_SEMANTICS.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Design-Docs/RTL_SYNTAX_AND_SEMANTICS.md b/Design-Docs/RTL_SYNTAX_AND_SEMANTICS.md index 5357e458..c06864af 100644 --- a/Design-Docs/RTL_SYNTAX_AND_SEMANTICS.md +++ b/Design-Docs/RTL_SYNTAX_AND_SEMANTICS.md @@ -36,7 +36,7 @@ Every registration you make using the builder pattern is collected into the `rtl ### A few key points about managing this object -* **Dispensable by design** β†’ The `rtl::CxxMirror` itself carries no hidden global state. You can define one central mirror, create multiple mirrors in different scopes, or even rebuild mirrors on demand. RTL imposes no restriction on how you manage its lifetime. +* **Dispensable by design** β†’ The `CxxMirror` itself carries no hidden global state. You can define one central mirror, create multiple mirrors in different scopes, or even rebuild mirrors on demand. RTL imposes no restriction on how you manage its lifetime. * **Duplicate registration is harmless** β†’ Identical registrations always materialize the same metadata. If a canonical function pointer is already registered, it is not added again to the lambda/functor table β€” the metadata simply refers back to the existing entry. @@ -50,7 +50,7 @@ Every registration you make using the builder pattern is collected into the `rtl This ensures thread-safety and prevents redundant entries. While negligible for isolated registrations, this cost can accumulate when creating many mirrors or registering large numbers of types. πŸ‘‰ Bottom Line -> *"Manage rtl::CxxMirror however your design requires β€” singleton, multiple, or transient. Each registration incurs a lock and table lookup, but the cost is negligible in normal use and only noticeable when scaling to very large numbers of types."* +> *"Manage `CxxMirror` however your design requires β€” singleton, multiple, or transient. Each registration incurs a lock and table lookup, but the cost is negligible in normal use and only noticeable when scaling to very large numbers of types."* --- From 6e45c43349a4111d28ae812bb899a9c290263748 Mon Sep 17 00:00:00 2001 From: Neeraj Date: Tue, 2 Sep 2025 20:31:46 +0530 Subject: [PATCH 29/46] Update RTL_SYNTAX_AND_SEMANTICS.md --- Design-Docs/RTL_SYNTAX_AND_SEMANTICS.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Design-Docs/RTL_SYNTAX_AND_SEMANTICS.md b/Design-Docs/RTL_SYNTAX_AND_SEMANTICS.md index c06864af..ad754ebe 100644 --- a/Design-Docs/RTL_SYNTAX_AND_SEMANTICS.md +++ b/Design-Docs/RTL_SYNTAX_AND_SEMANTICS.md @@ -36,13 +36,13 @@ Every registration you make using the builder pattern is collected into the `rtl ### A few key points about managing this object -* **Dispensable by design** β†’ The `CxxMirror` itself carries no hidden global state. You can define one central mirror, create multiple mirrors in different scopes, or even rebuild mirrors on demand. RTL imposes no restriction on how you manage its lifetime. +* ***Dispensable by design*** β†’ The `CxxMirror` itself carries no hidden global state. You can define one central mirror, create multiple mirrors in different scopes, or even rebuild mirrors on demand. RTL imposes no restriction on how you manage its lifetime. -* **Duplicate registration is harmless** β†’ Identical registrations always materialize the same metadata. If a canonical function pointer is already registered, it is not added again to the lambda/functor table β€” the metadata simply refers back to the existing entry. +* ***Duplicate registration is harmless*** β†’ Identical registrations always materialize the same metadata. If a canonical function pointer is already registered, it is not added again to the lambda/functor table β€” the metadata simply refers back to the existing entry. -* **Thread-safety guaranteed by RTL** β†’ No matter how you choose to manage mirrors (singleton, multiple, or transient), RTL itself guarantees synchronized, race-free registration and access across threads. +* ***Thread-safety guaranteed by RTL*** β†’ No matter how you choose to manage mirrors (singleton, multiple, or transient), RTL itself guarantees synchronized, race-free registration and access across threads. -* **Overhead is deliberate** β†’ Each registration carries a small cost in memory and initialization time. Concretely: +* ***Overhead is deliberate*** β†’ Each registration carries a small cost in memory and initialization time. Concretely: * Every registration statement acquires a lock on the functor table. * It checks whether the function or lambda is already present. * If not, it adds the new entry to the lambda table and updates the functor table. From 78d236d3bf8121ca2a14fc0de1316a69a28c1f24 Mon Sep 17 00:00:00 2001 From: Neeraj Date: Tue, 2 Sep 2025 22:42:17 +0530 Subject: [PATCH 30/46] Update README.md --- README.md | 2 -- 1 file changed, 2 deletions(-) diff --git a/README.md b/README.md index 4b66e041..83b6f60e 100644 --- a/README.md +++ b/README.md @@ -48,8 +48,6 @@ auto cxx_mirror = rtl::CxxMirror({ With just this much, you’ve registered your types and unlocked full runtime reflection. The `cxx_mirror` object is your gateway to query, introspect, and instantiate types at runtime β€” all without compile-time knowledge of those types, without strict static coupling. -RTL’s API is deliberately minimal and mirrors C++ syntax, but with strict runtime validation. Each reflective operation checks types, ownership, and errors, ensuring semantics that follow C++ rules while preventing undefined behavior through explicit error codes. - ***Without reflection:*** ```c++ From dabc31c2b344ff3f18e2fc3fada6bef19433f0d3 Mon Sep 17 00:00:00 2001 From: Neeraj Date: Tue, 2 Sep 2025 22:55:08 +0530 Subject: [PATCH 31/46] Update DESIGN_PRINCIPLES_AND_FEATURES.md --- Design-Docs/DESIGN_PRINCIPLES_AND_FEATURES.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Design-Docs/DESIGN_PRINCIPLES_AND_FEATURES.md b/Design-Docs/DESIGN_PRINCIPLES_AND_FEATURES.md index a15e3e8f..a6702599 100644 --- a/Design-Docs/DESIGN_PRINCIPLES_AND_FEATURES.md +++ b/Design-Docs/DESIGN_PRINCIPLES_AND_FEATURES.md @@ -13,7 +13,7 @@ For each registered type, RTL contributes **two lightweight entries** into its p * A **lambda wrapper** placed in a scoped `static` `std::vector` and is responsible for making the final call using the actual functor. * A **raw function pointer** stored in a parallel scoped `static` `std::vector`, used to detect and prevent redundant registrations. -From there, `rtl::CxxMirror` does not hold onto heavyweight state. It is **as ordinary as any local variable** β€” you can construct one, keep it alive for the entire application, or discard it after a short-lived query. The `CxxMirror` can be materialized again with the same or different set of types. RTL guarantees that **materializing the same registration sequence multiple times** (for example): +From there, `rtl::CxxMirror` does not hold onto heavyweight state. It is **as ordinary as any local variable** β€” you can construct one, keep it alive for the entire application, or discard it after a short-lived query. The `CxxMirror` can be materialized again with the same or different set of types. RTL guarantees that **materializing the same registration statement multiple times** (for example): ```cpp rtl::type().member().method("getName").build(&Person::getName); From dfc78d21418719636e6e41ede83b2f40820091ec Mon Sep 17 00:00:00 2001 From: Neeraj Date: Wed, 3 Sep 2025 10:33:46 +0530 Subject: [PATCH 32/46] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 83b6f60e..2cfd8723 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# Reflection Template Library (RTL) - Modern C++ Reflection Framework +# Reflection Template Library - Modern C++ Reflection Framework **Reflection Template Library (RTL)** is a lightweight C++ runtime reflection library that enables introspection and dynamic manipulation of types *(not limited to user-defined)* β€” allowing you to access, modify, and invoke objects at runtime without compile-time type knowledge. From f1300b728b27659f486ed2c73c1b09fd3b3e1ad8 Mon Sep 17 00:00:00 2001 From: Neeraj Date: Wed, 3 Sep 2025 10:43:17 +0530 Subject: [PATCH 33/46] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 2cfd8723..4cbb7c15 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # Reflection Template Library - Modern C++ Reflection Framework -**Reflection Template Library (RTL)** is a lightweight C++ runtime reflection library that enables introspection and dynamic manipulation of types *(not limited to user-defined)* β€” allowing you to access, modify, and invoke objects at runtime without compile-time type knowledge. +**Reflection Template Library (RTL)** is a lightweight C++ runtime reflection library that enables introspection and dynamic manipulation of types β€” allowing you to access, modify, and invoke objects at runtime without compile-time type knowledge. RTL is implemented as a static library that organizes type-safe function pointers into tables `(std::vector)`, with each pointer wrapped in a lambda. This design enables constant-time `O(1)` lookup and efficient runtime access. From 5c750a3c4d3d3221b64185abb5933a8ff846ac5a Mon Sep 17 00:00:00 2001 From: Neeraj Date: Wed, 3 Sep 2025 10:44:02 +0530 Subject: [PATCH 34/46] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 4cbb7c15..de230d21 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # Reflection Template Library - Modern C++ Reflection Framework -**Reflection Template Library (RTL)** is a lightweight C++ runtime reflection library that enables introspection and dynamic manipulation of types β€” allowing you to access, modify, and invoke objects at runtime without compile-time type knowledge. +**Reflection Template Library (RTL)** is a lightweight C++ runtime reflection library that enables introspection and dynamic manipulation of ***Types*** β€” allowing you to access, modify, and invoke objects at runtime without compile-time type knowledge. RTL is implemented as a static library that organizes type-safe function pointers into tables `(std::vector)`, with each pointer wrapped in a lambda. This design enables constant-time `O(1)` lookup and efficient runtime access. From 1d9aef24d22f146ff20410edf1e9d611f93ff393 Mon Sep 17 00:00:00 2001 From: Neeraj Date: Wed, 3 Sep 2025 10:51:18 +0530 Subject: [PATCH 35/46] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index de230d21..d5839bd5 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # Reflection Template Library - Modern C++ Reflection Framework -**Reflection Template Library (RTL)** is a lightweight C++ runtime reflection library that enables introspection and dynamic manipulation of ***Types*** β€” allowing you to access, modify, and invoke objects at runtime without compile-time type knowledge. +*Reflection Template Library (RTL)* is a lightweight C++ runtime reflection library that enables introspection and dynamic manipulation of ***Types*** β€” allowing you to access, modify, and invoke objects at runtime without compile-time type knowledge. RTL is implemented as a static library that organizes type-safe function pointers into tables `(std::vector)`, with each pointer wrapped in a lambda. This design enables constant-time `O(1)` lookup and efficient runtime access. From 04672fae9eba9a1bccf50cba59dba470e97cc735 Mon Sep 17 00:00:00 2001 From: Neeraj Date: Wed, 3 Sep 2025 11:19:14 +0530 Subject: [PATCH 36/46] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index d5839bd5..b18044bd 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ *Reflection Template Library (RTL)* is a lightweight C++ runtime reflection library that enables introspection and dynamic manipulation of ***Types*** β€” allowing you to access, modify, and invoke objects at runtime without compile-time type knowledge. -RTL is implemented as a static library that organizes type-safe function pointers into tables `(std::vector)`, with each pointer wrapped in a lambda. This design enables constant-time `O(1)` lookup and efficient runtime access. +RTL is implemented as a *static library* that organizes function pointers into `std::vector` tables, with each functor wrapped in a lambda. This design enables constant-time (`O(1)`) lookups while ensuring type-safe and efficient runtime access. [![CMake](https://img.shields.io/badge/CMake-Enabled-brightgreen)](https://cmake.org) [![C++20](https://img.shields.io/badge/C++-20-blue)](https://isocpp.org) From b71188581cf1a2d9a01436a2c7ba50be57a65011 Mon Sep 17 00:00:00 2001 From: Neeraj Date: Wed, 3 Sep 2025 11:19:39 +0530 Subject: [PATCH 37/46] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index b18044bd..fad013c1 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ *Reflection Template Library (RTL)* is a lightweight C++ runtime reflection library that enables introspection and dynamic manipulation of ***Types*** β€” allowing you to access, modify, and invoke objects at runtime without compile-time type knowledge. -RTL is implemented as a *static library* that organizes function pointers into `std::vector` tables, with each functor wrapped in a lambda. This design enables constant-time (`O(1)`) lookups while ensuring type-safe and efficient runtime access. +RTL is implemented as a *static library* that organizes function pointers into `std::vector` tables, with each functor wrapped in a lambda. This design enables constant-time `O(1)` lookups while ensuring type-safe and efficient runtime access. [![CMake](https://img.shields.io/badge/CMake-Enabled-brightgreen)](https://cmake.org) [![C++20](https://img.shields.io/badge/C++-20-blue)](https://isocpp.org) From 423aa25eb915143a8d908fdafc58d22e7fcbe212 Mon Sep 17 00:00:00 2001 From: Neeraj Date: Wed, 3 Sep 2025 19:15:44 +0530 Subject: [PATCH 38/46] Update README.md --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index fad013c1..f905480b 100644 --- a/README.md +++ b/README.md @@ -6,6 +6,7 @@ RTL is implemented as a *static library* that organizes function pointers into ` [![CMake](https://img.shields.io/badge/CMake-Enabled-brightgreen)](https://cmake.org) [![C++20](https://img.shields.io/badge/C++-20-blue)](https://isocpp.org) +[![RTL Build](https://github.com/neeraj31285/ReflectionTemplateLibrary-CPP/actions/workflows/build.yml/badge.svg?branch=release)](https://github.com/NeerajSingh/ReflectionTemplateLib/actions/workflows/build.yml?query=branch%3Arelease) [![License: MIT](https://img.shields.io/badge/License-MIT-green)](LICENSE) ## What RTL Brings to Your Code From 487429079e7ac992de2be00742dc01b31a88b274 Mon Sep 17 00:00:00 2001 From: Neeraj Date: Wed, 3 Sep 2025 19:18:36 +0530 Subject: [PATCH 39/46] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index f905480b..4fb359c2 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,7 @@ RTL is implemented as a *static library* that organizes function pointers into ` [![CMake](https://img.shields.io/badge/CMake-Enabled-brightgreen)](https://cmake.org) [![C++20](https://img.shields.io/badge/C++-20-blue)](https://isocpp.org) -[![RTL Build](https://github.com/neeraj31285/ReflectionTemplateLibrary-CPP/actions/workflows/build.yml/badge.svg?branch=release)](https://github.com/NeerajSingh/ReflectionTemplateLib/actions/workflows/build.yml?query=branch%3Arelease) +[![RTL Build](https://github.com/ReflectCxx/ReflectionTemplateLibrary-CPP/actions/workflows/build.yml/badge.svg?branch=release)](https://github.com/ReflectCxx/ReflectionTemplateLibrary-CPP/actions/workflows/build.yml?query=branch%3Arelease) [![License: MIT](https://img.shields.io/badge/License-MIT-green)](LICENSE) ## What RTL Brings to Your Code From f58f2c90cbd743035382f077a3bc56ca007e33aa Mon Sep 17 00:00:00 2001 From: Neeraj Singh Date: Wed, 3 Sep 2025 13:59:17 +0000 Subject: [PATCH 40/46] github action fix --- {.ygithub => .github}/workflows/build.yml | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename {.ygithub => .github}/workflows/build.yml (100%) diff --git a/.ygithub/workflows/build.yml b/.github/workflows/build.yml similarity index 100% rename from .ygithub/workflows/build.yml rename to .github/workflows/build.yml From ae6a0c06e4af9140b19073fc13f3d21b6252fa67 Mon Sep 17 00:00:00 2001 From: Neeraj Singh Date: Wed, 3 Sep 2025 14:29:21 +0000 Subject: [PATCH 41/46] artifacts upload. --- .github/workflows/build.yml | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index a05d639e..8679d29d 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -51,4 +51,11 @@ jobs: # Build - name: Build - run: cmake --build build --config Release --parallel \ No newline at end of file + run: cmake --build build --config Release --parallel + + # Upload artifacts per compiler + - name: Upload build artifacts + uses: actions/upload-artifact@v4 + with: + name: rtl-test-binaries-${{ matrix.compiler }} + path: build/ # adjust if your test binaries go to a different folder \ No newline at end of file From 584357d2b62c4d1c002d1db2efc3fdd7c97d9959 Mon Sep 17 00:00:00 2001 From: Neeraj Date: Wed, 3 Sep 2025 20:09:22 +0530 Subject: [PATCH 42/46] Update README.md --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 4fb359c2..a9cb2a88 100644 --- a/README.md +++ b/README.md @@ -5,8 +5,8 @@ RTL is implemented as a *static library* that organizes function pointers into `std::vector` tables, with each functor wrapped in a lambda. This design enables constant-time `O(1)` lookups while ensuring type-safe and efficient runtime access. [![CMake](https://img.shields.io/badge/CMake-Enabled-brightgreen)](https://cmake.org) -[![C++20](https://img.shields.io/badge/C++-20-blue)](https://isocpp.org) -[![RTL Build](https://github.com/ReflectCxx/ReflectionTemplateLibrary-CPP/actions/workflows/build.yml/badge.svg?branch=release)](https://github.com/ReflectCxx/ReflectionTemplateLibrary-CPP/actions/workflows/build.yml?query=branch%3Arelease) +[![C++20](https://img.shields.io/badge/C++-20-blue)](https://isocpp.org) +[![RTL Build](https://github.com/ReflectCxx/ReflectionTemplateLibrary-CPP/actions/workflows/build.yml/badge.svg?branch=release)](https://github.com/ReflectCxx/ReflectionTemplateLibrary-CPP/actions/workflows/build.yml?query=branch%3Arelease) [![License: MIT](https://img.shields.io/badge/License-MIT-green)](LICENSE) ## What RTL Brings to Your Code From db6c4b3c75898c257c30d33a555d1e6187cf80fd Mon Sep 17 00:00:00 2001 From: Neeraj Date: Wed, 3 Sep 2025 20:11:56 +0530 Subject: [PATCH 43/46] Update README.md --- README.md | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index a9cb2a88..24e877d4 100644 --- a/README.md +++ b/README.md @@ -4,10 +4,8 @@ RTL is implemented as a *static library* that organizes function pointers into `std::vector` tables, with each functor wrapped in a lambda. This design enables constant-time `O(1)` lookups while ensuring type-safe and efficient runtime access. -[![CMake](https://img.shields.io/badge/CMake-Enabled-brightgreen)](https://cmake.org) -[![C++20](https://img.shields.io/badge/C++-20-blue)](https://isocpp.org) -[![RTL Build](https://github.com/ReflectCxx/ReflectionTemplateLibrary-CPP/actions/workflows/build.yml/badge.svg?branch=release)](https://github.com/ReflectCxx/ReflectionTemplateLibrary-CPP/actions/workflows/build.yml?query=branch%3Arelease) -[![License: MIT](https://img.shields.io/badge/License-MIT-green)](LICENSE) +[![CMake](https://img.shields.io/badge/CMake-Enabled-brightgreen)](https://cmake.org) [![C++20](https://img.shields.io/badge/C++-20-blue)](https://isocpp.org) [![RTL Build](https://github.com/ReflectCxx/ReflectionTemplateLibrary-CPP/actions/workflows/build.yml/badge.svg?branch=release)](https://github.com/ReflectCxx/ReflectionTemplateLibrary-CPP/actions/workflows/build.yml?query=branch%3Arelease) [![License: MIT](https://img.shields.io/badge/License-MIT-green)](LICENSE) + ## What RTL Brings to Your Code From a00446589bf37a39826ed22a45f6e6d6990b5148 Mon Sep 17 00:00:00 2001 From: Neeraj Date: Wed, 3 Sep 2025 20:19:14 +0530 Subject: [PATCH 44/46] Update RTL_SYNTAX_AND_SEMANTICS.md --- Design-Docs/RTL_SYNTAX_AND_SEMANTICS.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Design-Docs/RTL_SYNTAX_AND_SEMANTICS.md b/Design-Docs/RTL_SYNTAX_AND_SEMANTICS.md index ad754ebe..b1487991 100644 --- a/Design-Docs/RTL_SYNTAX_AND_SEMANTICS.md +++ b/Design-Docs/RTL_SYNTAX_AND_SEMANTICS.md @@ -32,7 +32,7 @@ Before registering anything, you need a central place to hold all reflection met }); ``` -Every registration you make using the builder pattern is collected into the `rtl::CxxMirror` as an `rtl::Function` object. The `CxxMirror` forms the backbone of RTL. Every type, function, or method you register ultimately gets encapsulated into this single object, serving as the gateway to query, introspect, and instantiate all registered types at runtime. +Every registration statement you add here is collected into the `rtl::CxxMirror` as an `rtl::Function` object. The `CxxMirror` forms the backbone of RTL. Every type, function, or method you register ultimately gets encapsulated into this single object, serving as the gateway to query, introspect, and instantiate all registered types at runtime. ### A few key points about managing this object From a274309173e3241a29c86ac4df27e2f94f44025a Mon Sep 17 00:00:00 2001 From: Neeraj Singh Date: Wed, 3 Sep 2025 15:09:39 +0000 Subject: [PATCH 45/46] fixed artifact upload. --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 8679d29d..a1933059 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -58,4 +58,4 @@ jobs: uses: actions/upload-artifact@v4 with: name: rtl-test-binaries-${{ matrix.compiler }} - path: build/ # adjust if your test binaries go to a different folder \ No newline at end of file + path: bin/ \ No newline at end of file From 580a2aacdee15222b3172c1e9c99ec6311ea14a1 Mon Sep 17 00:00:00 2001 From: Neeraj Singh Date: Wed, 3 Sep 2025 17:15:33 +0000 Subject: [PATCH 46/46] updated build action, ignore md --- .github/workflows/build.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index a1933059..68304f36 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -3,15 +3,18 @@ name: RTL Build on: push: branches: [ release ] + paths-ignore: + - '**/*.md' pull_request: branches: [ release ] + paths-ignore: + - '**/*.md' workflow_dispatch: jobs: build: name: Build (${{ matrix.os }} / ${{ matrix.compiler }}) runs-on: ${{ matrix.os }} - strategy: matrix: os: [ubuntu-latest, windows-latest] @@ -23,7 +26,6 @@ jobs: compiler: clang - os: ubuntu-latest compiler: msvc - steps: - name: Checkout source uses: actions/checkout@v4