Home

About

Advanced Search

Browse by Discipline

Scientific Societies

E-print Alerts

Add E-prints

E-print Network
FAQHELPSITE MAPCONTACT US


  Advanced Search  

 
Reflection support by means of template metaprogramming
 

Summary: Reflection support by means of template
metaprogramming
Giuseppe Attardi, Antonio Cisternino
Dipartimento di Informatica, corso Italia 40, I-56125 Pisa, Italy
{attardi,cisterni}@di.unipi.it
Abstract. The C++ language has only a limited runtime type information sys-
tem, which doesn't provide full reflection capabilities. We present a general
mechanism to support reflection, exploiting template metaprogramming tech-
niques. Two solutions are presented: a static one where metaclass information is
only available at compile time to produce class specific code; and a dynamic
one where metaclass objects exist at runtime. As a case study of technique we
show how to build an object interface to relational database tables. By just an-
notating a class definition with meta information, such as storage attributes or
index properties of fields, a programmer can define objects that can be stored,
fetched or searched in a database table. This approach has been used in building
a high-performance, full text search engine.
1 Introduction
When building generic components, capable of handling a variety of object types, not
yet known, the programmer is faced by a number of possibilities:
1. produce a library totally unaware of the specific kind of objects used by applica-

  

Source: Attardi, Giuseppe - Dipartimento di Informatica, UniversitÓ di Pisa

 

Collections: Computer Technologies and Information Sciences