arXivDaily arXiv每日学术速递 周一至周五更新
arXiv周末暂无论文更新,休息一下吧,周末愉快~~
arXiv cs/0401024cs.PL
收藏

C++中的反射系统

A system for reflection in C++

Duraid Madina, Russell K. Standish

摘要:

面向对象的程序设计语言,如Java和Objective C,在实现基于代理和其他基于对象的模拟方面已经变得流行,因为这些语言中的对象可以{ \em reflect}(即,对对象的结构进行运行时查询)。例如,这允许编写相当简单的{ \em序列化}例程(将对象转换为可以存储或通过网络传递的二进制表示)。然而C++不提供这种能力,因为类型信息在编译时就被丢弃了。然而,C++通常是首选的开发环境,无论是出于性能方面的原因,还是因为它的表达功能(如运算符重载)。在本文中,我们提出了{ \em Classdesc}系统,该系统为C++带来了对象反射的许多好处。

英文摘要:

Object-oriented programming languages such as Java and Objective C have become popular for implementing agent-based and other object-based simulations since objects in those languages can {\em reflect} (i.e. make runtime queries of an object's structure). This allows, for example, a fairly trivial {\em serialisation} routine (conversion of an object into a binary representation that can be stored or passed over a network) to be written. However C++ does not offer this ability, as type information is thrown away at compile time. Yet C++ is often a preferred development environment, whether for performance reasons or for its expressive features such as operator overloading. In this paper, we present the {\em Classdesc} system which brings many of the benefits of object reflection to C++.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑