Institute of Computer Science III
University of Bonn
Databases * Information Systems * Software Engineering * Pattern Recognition * Image Processing * Artificial Intelligence * Robotics


Runtime Type for Class Hierarchies

Martin Fischer

In object oriented languages like C++ [ES90, Str91] pointers to base classes are used to pass instances of derived classes to functions. These pointers only permit the usage of functions defined in the base class (though the functions can be virtual and therefore the functionality can be enhanced). To access the complete functionality of a derived class, the pointer must be converted to a derived class pointer. This can be done in two ways: either by explicitly coding a cast and implicitly trusting that the passed pointer really is a pointer to the derived class or by using runtime type information to check the class type and afterwards casting the pointer. This paper describes an implementation of runtime type information for class hierarchies that can easily be added to any existing hierarchy.

Click here to obtain the full paper (PS, gzip, 13626 bytes, 5 pages)


webmaster@www.informatik.uni-bonn.de - 16.12.05