You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat: add template class support to Concerto Reflection
Implement template class reflection with:
- Template class declaration and specialization parsing via ClangParser
- TemplateClass runtime representation with specialization lookup
- Code generation for template classes and their specializations
- Header generation for template class declarations
- Documentation and test coverage
Copy file name to clipboardExpand all lines: README.md
+105Lines changed: 105 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -202,6 +202,111 @@ Concerto Reflection exposes a rich runtime API. Here are some of the key capab
202
202
* All reflection entities (packages, classes, enums, methods, members) can carry key–value attributes. Use `HasAttribute` and `GetAttribute` to inspect them.
203
203
* Built‑in types such as `Int32` are also registered with the reflection system, allowing you to treat fundamental types like any other class.
204
204
205
+
206
+
### Template class support
207
+
208
+
Concerto Reflection supports C++ template classes with full reflection metadata for each specialization.
209
+
210
+
#### Annotating template classes
211
+
212
+
Mark template classes with the standard reflection macros:
213
+
214
+
```cpp
215
+
template<typename T>
216
+
classCCT_CLASS() Container : public cct::refl::Object
217
+
{
218
+
public:
219
+
Container() : m_value() {}
220
+
221
+
CCT_MEMBER()
222
+
T m_value;
223
+
224
+
CCT_METHOD()
225
+
void SetValue(T val) { m_value = val; }
226
+
227
+
CCT_METHOD()
228
+
T GetValue() const { return m_value; }
229
+
230
+
CCT_OBJECT(Container);
231
+
};
232
+
233
+
// Explicitly instantiate the specializations you want to reflect
234
+
template classContainer<int>;
235
+
template class Container<double>;
236
+
```
237
+
238
+
#### Accessing template specializations at runtime
239
+
240
+
Once loaded, you can retrieve specializations in two ways:
0 commit comments