Attribute amp; Reflection libraries for C++?(属性与C++ 的反射库?)
问题描述
大多数成熟的 C++ 项目似乎都有自己的反射和属性系统,即用于定义可以通过字符串访问并自动序列化的属性.至少我参与的许多 C++ 项目似乎在重新发明轮子.
Most mature C++ projects seem to have an own reflection and attribute system, i.e for defining attributes which can be accessed by string and are automatically serializable. At least many C++ projects I participated in seemed to reinvent the wheel.
你知道任何支持反射和属性容器的优秀的 C++ 开源库吗,特别是:
Do you know any good open source libraries for C++ which support reflection and attribute containers, specifically:
- 通过宏定义 RTTI 和属性
- 通过代码访问 RTTI 和属性
- 属性的自动序列化
- 监听属性修改(例如 OnValueChanged)
推荐答案
你可以看看下面的两个工具.我从来没有使用过它们中的任何一个,所以我不能告诉你它们有多实用.
You could have a look at the two tools below. I've never used either of them, so I can't tell you how (im)practical they are.
XRTTI:
Xrtti 是一个工具和随附的 C++ 库,它扩展了 C++ 的标准运行时类型系统,以提供一组更丰富的关于类和方法的反射信息来操作这些类及其成员.
Xrtti is a tool and accompanying C++ library which extends the standard runtime type system of C++ to provide a much richer set of reflection information about classes and methods to manipulate these classes and their members.
OpenC++:
OpenC++ 是 C++ 前端库(lexer+parser+DOM/MOP)和源到源的翻译器.OpenC++ 支持开发 C++ 语言工具、扩展、特定领域的编译器优化和运行时元对象协议.
OpenC++ is C++ frontend library (lexer+parser+DOM/MOP) and source-to-source translator. OpenC++ enables development of C++ language tools, extensions, domain specific compiler optimizations and runtime metaobject protocols.
这篇关于属性与C++ 的反射库?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:属性与C++ 的反射库?


基础教程推荐
- 如何通过C程序打开命令提示符Cmd 2022-12-09
- 如何将 std::pair 的排序 std::list 转换为 std::map 2022-01-01
- 我有静态或动态 boost 库吗? 2021-01-01
- 如何在 C++ 中初始化静态常量成员? 2022-01-01
- C++结构和函数声明。为什么它不能编译? 2022-11-07
- 这个宏可以转换成函数吗? 2022-01-01
- 在 C++ 中计算滚动/移动平均值 2021-01-01
- 如何检查GTK+3.0中的小部件类型? 2022-11-30
- 静态库、静态链接动态库和动态链接动态库的 .lib 文件里面是什么? 2021-01-01
- 常量变量在标题中不起作用 2021-01-01