Adapter
Convert the interface of a class into another interface that clients expect. Adapter lets classes work together that could not otherwise because of incompatible interfaces.
The Problem
You have a useful class (legacy C simulator) but its interface is incompatible with what the rest of your system expects (modern C++ Simulator interface). You cannot modify the legacy code — it is third-party, generated, or too risky to change.
Structure
Execution Walkthrough
Target interface
Define the interface your system expects: Simulator with start(), step(), stop().
Adaptee exists
Adapter wraps
Translation
Client unaware
Code Comparison
Full C++ Implementation
Participants
Where it is used
C++ STL
std::stack/std::queue adapt std::deque to LIFO/FIFO interfaces.
Hardware abstraction
A HAL adapter wraps a vendor FPGA SDK behind a uniform register-mapped interface.
Legacy EDA
A Tcl API adapter wraps a C simulation engine for modern C++ tooling to call uniformly.
Third-party SDKs
libcurl C API wrapped behind a modern C++ RAII interface with futures and std::error_code.