Prev Up Next
Go backward to Complete Traversals: Implementation and Generality
Arturo Sánchez-Ruíz

Go up to Programming Methodology
Go forward to An Overview of Generic Programming in RESOLVE
Bruce W. Weide


Template Support for Variation
Georg Trausmuth

Generic programming based on C++ templates can be used to model a generic framework for a family of software systems that share common structure. We developed an approach that uses templates and compile-time instantiation to configure the various members of a system family. We explored the technique in an industrial case study to adapt a generic configuration to meet specific functional requirements imposed by hardware variation. As the software was targeted for an embedded system, the resulting code size is of high interest. We could show that the code is highly optimized through the use of inlined template functions. Optimizations comparable to those achieved are not possible for similar C++ designs which are based on inheritance and virtual functions. A drawback of our technique is its current limitation to create executables that contain only one variant of the software at a time. As future work we will be testing advanced template techniques to overcome these difficulties for the next versions of the framework.


 

Prev Up Next