Skip to content

C++ API

The engine's classes and functions, generated by Doxygen from the headers in src/:

Open the C++ API reference

The link works on the published site. Locally, build it with mkdir -p build/api && doxygen docs/api/Doxyfile from the repository root and open build/api/html/index.html.

How it is made

The headers document their declarations with ordinary // comments above them, as the code style asks. scripts/doxygen_filter.py turns those comments into Doxygen documentation when Doxygen reads a header, so the code keeps one comment style and needs no /// or @param markup:

In the header Doxygen reads it as
the comment block right after #pragma once the file's description
a // block directly above a declaration that declaration's documentation
a // block followed by a blank line a plain comment (a section heading in the file)
int x; // text the member's documentation

Undocumented declarations

scripts/check_api_docs.py counts the public declarations that have no comment, per header, and CI warns when a header has more than its count in docs/api/undocumented-baseline.txt. Old code does not have to catch up, but a new declaration should come with a comment that says what it is for. When a change documents old declarations, scripts/check_api_docs.py --update lowers the baseline.

Modules, one namespace each under tmk:

Namespace Folder What it is
tmk src/core units (tmk::Coord, integer nanometres), events, the seeded RNG, version
tmk::sexpr src/sexpr the S-expression reader and writer behind byte-for-byte round trips
tmk::model src/model the board: nets, footprints, pads, tracks, vias, zones, rules
tmk::geom src/geom points, shapes, exact predicates, polygon booleans
tmk::index src/index spatial indices, each with a linear-scan reference
tmk::io src/io KiCad and Simple Route JSON reading and writing
tmk::drc src/drc the design-rule check and its rule engine
tmk::route src/route the router
tmk::passes src/passes after-route passes: widening, stitching, style
tmk::place src/place the placer
tmk::learn src/learn failure memory and the knowledge base
tmk::gpu src/gpu CUDA and Metal kernels and their CPU twins
tmk::crules src/crules component-aware layout rules
tmk::analysis src/analysis read-only audits: return paths, footprint checks
tmk::advice src/advice advice files, the stuck report, advisors
tmk::session src/session the board session for agents
tmk::server src/server the live viewer's server
tmk::app src/app the command line, the route job, the TUI