属性&C++ 的反射库? [英] Attribute & Reflection libraries for C++?

查看:32
本文介绍了属性&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++ 前端库(词法分析器+解析器+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++ 的反射库?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆