Renders C++ sources out of Sen type sets. Stateful (caches the loaded inja templates), so prefer reusing one instance across calls when possible.
More...
#include <cpp.h>
|
| using | FileContents = std::map<std::filesystem::path, std::string> |
| | Map of relative output path -> rendered file contents. Keys are produced from the type set's parentDirectory joined with the per-file stem (one .h, one .cpp per type set rendered).
|
|
| | CppGenerator () |
| | ~CppGenerator () |
| FileContents | generate (const sen::lang::TypeSet &typeSet, const CppOptions &opts={}) |
| | Renders the types header + impl source for the supplied type set. When opts.recursive is true, transitively imported sets are rendered too and merged into the returned map. Recursion is cycle-safe via a visited-set keyed on TypeSet*. Two distinct type sets resolving to the same parentDirectory /
fileName are deduplicated; first-written body wins.
|
| std::string | generateExports (const CppExportsOptions &opts) |
| | Renders the package exports source file (sen_exported_types.cpp).
|
Renders C++ sources out of Sen type sets. Stateful (caches the loaded inja templates), so prefer reusing one instance across calls when possible.
◆ FileContents
Map of relative output path -> rendered file contents. Keys are produced from the type set's parentDirectory joined with the per-file stem (one .h, one .cpp per type set rendered).
◆ CppGenerator()
| sen::gen::CppGenerator::CppGenerator |
( |
| ) |
|
◆ ~CppGenerator()
| sen::gen::CppGenerator::~CppGenerator |
( |
| ) |
|
◆ generate()
Renders the types header + impl source for the supplied type set. When opts.recursive is true, transitively imported sets are rendered too and merged into the returned map. Recursion is cycle-safe via a visited-set keyed on TypeSet*. Two distinct type sets resolving to the same parentDirectory /
fileName are deduplicated; first-written body wins.
◆ generateExports()
| std::string sen::gen::CppGenerator::generateExports |
( |
const CppExportsOptions & | opts | ) |
|
|
nodiscard |
Renders the package exports source file (sen_exported_types.cpp).
The documentation for this class was generated from the following file: