A system for runtime type introspection in c++

  • Authors:
  • Maximilien de Bayser;Renato Cerqueira

  • Affiliations:
  • Pontifcia Universidade Catlica do Rio de Janeiro, Brasil;Pontifcia Universidade Catlica do Rio de Janeiro, Brasil

  • Venue:
  • SBLP'12 Proceedings of the 16th Brazilian conference on Programming Languages
  • Year:
  • 2012

Quantified Score

Hi-index 0.00

Visualization

Abstract

Many object-oriented languages support some kind of runtime introspection that allows programmers to navigate through meta-data describing the available classes, their attributes and methods. In general, the meta-data can be used to instantiate new objects, manipulate their attributes and call their methods. The meta-programming enabled by this kind of reflection has proven itself useful in a variety of applications such as object-relational mappings and inversion-of-control containers and test automation Motivated by the need of programmatic support for composition and configuration of software components at runtime, in this work we show how to implement a runtime reflection support for C++11, using the available runtime type information, template metaprogramming and source code analysis. We will show the capabilities of the reflection API and the memory footprint for different kinds of meta-data. The API relies on a few features introduced by C++11, the new ISO standard for C++. Our reflection system is not invasive as it requires no modifications whatsoever of the application code.