Chapter 5

Styles

Publisher Summary

This chapter covers the topic of API style. Style in this context means how it is decided to represent the capabilities of API. API may provide access to internal state and routines to perform required functionality. However, there are other styles that one could adopt, and the object-oriented style may not be the best fit all the time. This chapter presents four very different API styles that are flat C APIs, object-oriented C++ APIs, template-based APIs, and data-driven APIs. Throughout the chapter, the examples are used from the FMOD API to illustrate three of the aforementioned styles. FMOD is a commercial library for creating and playing back interactive audio that is used by many games companies, such as ...

Get API Design for C++ now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.