Hourglass Interfaces for C++ APIs
summary
Explains the concrete hourglass pattern: rich C++ API and implementation separated by a thin C89 ABI layer, with code for C++98 and C++11. Shows exact techniques: opaque C structs and extern "C" entry points, error T double‑pointer plus a throw_on_error RAII shim and translate_exceptions wrapper, callback trampolines from capturing lambdas to C function pointers, and visibility macros for exports. Demonstrates with a small hairpoll example and supplies slides and source at the GitHub link so you can build and test it yourself.
AI-written summary · about
chapters (6)
- 0:00Start
- 0:49Hourglass Interfaces for C++ APIs
- 1:32Motivation and Introduction
- 17:40Best Practices
- 56:15Interfacing with those "other" languages
- 57:01Languages with support for calling functions in shared libraries include . Common Lisp. Java. JavaScript. Matlab.NET
related talks
58mA Case-study in Rewriting a Legacy GUI Library for Real-time Audio Software in Modern C++
05mC Pointers
01h 03mWhat I Talk About When I Talk About Cross Platform Development
01h 02mThe Observer Design Pattern in Cpp
49mApplied Modern C++: beyond type erasure and visitor pattern
05mLightning Talk: Effective APIs in Practice in C++
31mFunctional Shell and Reusable Components for Easy GUIs
58mApplied Modern C++: The problem of messages versioning in API
