ContainerInfo: Read "extra" codegen field

This commit is contained in:
Alastair Robertson 2023-09-26 12:19:28 -07:00 committed by Alastair Robertson
parent 4e80dace1a
commit 1f66ef064a
3 changed files with 11 additions and 0 deletions

View File

@ -269,6 +269,10 @@ ContainerInfo::ContainerInfo(const fs::path& path) {
codegenToml["traversal_func"].value<std::string>()) {
codegen.traversalFunc = std::move(*str);
}
if (std::optional<std::string> str =
codegenToml["extra"].value<std::string>()) {
codegen.extra = std::move(*str);
}
if (toml::array* arr = codegenToml["processor"].as_array()) {
codegen.processors.reserve(arr->size());

View File

@ -37,6 +37,7 @@ struct ContainerInfo {
std::string func;
std::string handler = "";
std::string traversalFunc = "";
std::string extra = "";
std::vector<Processor> processors{};
};

View File

@ -48,6 +48,12 @@ This document describes the format of the container definition files contained i
`static types::st::Unit<DB> getSizeType(const T& container, ST returnArg)`
where `ST` defines the combined static type of each supplied processor.
- `extra`
Any extra C++ code to be included directly. This code is not automatically
wrapped in a namespace, so definitions from different container TOML files
will collide if they share the same name.
## Changes introduced with Typed Data Segment
- `decl` and `func` fields are ignored when using `-ftyped-data-segment` and the