作者投稿和查稿 主编审稿 专家审稿 编委审稿 远程编辑

计算机工程 ›› 2006, Vol. 32 ›› Issue (16): 95-96,9. doi: 10.3969/j.issn.1000-3428.2006.16.035

• 软件技术与数据库 • 上一篇    下一篇

C++反射机制的一种简单实现

鲍 亮;陈 平   

  1. 西安电子科技大学软件工程研究所,西安 710071
  • 收稿日期:1900-01-01 修回日期:1900-01-01 出版日期:2006-08-20 发布日期:2006-08-20

A Simple Implementation of C++ Reflection

BAO Liang;CHEN Ping   

  1. Software Engineering Institute, Xidian University, Xi’an 710071
  • Received:1900-01-01 Revised:1900-01-01 Online:2006-08-20 Published:2006-08-20

摘要: 讨论了C++反射机制的实现问题,介绍了反射机制的概念和分类,比较了向C++添加反射机制的可能性和方式,提出并分析了一种基于宏定义、模板和泛型机制的C++反射机制实现手段——“简单C++反射机制(Simple C++ Reflection SCR)”。

关键词: 反射, 宏定义, 模板, 简单C++反射

Abstract: This paper is focus on the implementation of C++ reflection mechanism. The definition and classification of reflection is simply introduced first. Then, the possibility and methods on how to add reflection mechanism to C++ programming language are discussed. Finally, simple C++ reflection (SCR), a macro definition, template and generic programming based solution, is discussed.

Key words: Reflection, Marco definition, Template, Simple C++ reflection(SCR)

中图分类号: