Objects? No Thanks!

Micro-controller programming can benefit from compile-time polymorphism without paying a run-time price by using static class templates.

For small micro-controllers (kilobytes of memory) C++ run-time polymorphism (using objects and virtual methods) is often deemed too expensive in ROM, RAM, and run-time overhead. This talk shows how templates can be used to implement compile-time polymorphism, and static classes to avoid the need for run-time objects. This technique can produce highly modular and composable code that is still as efficient as dedicated C code, but offers better prospects for re-use. This approach is illustrated with an abstraction for GPIO (General Purpose Input Output) pins and ports, with an implementation on an LPC1114 microcontroller, and a number of decorators for pins and numbers.

Speaker: Wouter van Ooijen

Slides: Objects? No Thanks!


Go back