Skip to content

Commit 1f66ef0

Browse files
committed
ContainerInfo: Read "extra" codegen field
1 parent 4e80dac commit 1f66ef0

File tree

3 files changed

+11
-0
lines changed

3 files changed

+11
-0
lines changed

oi/ContainerInfo.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -269,6 +269,10 @@ ContainerInfo::ContainerInfo(const fs::path& path) {
269269
codegenToml["traversal_func"].value<std::string>()) {
270270
codegen.traversalFunc = std::move(*str);
271271
}
272+
if (std::optional<std::string> str =
273+
codegenToml["extra"].value<std::string>()) {
274+
codegen.extra = std::move(*str);
275+
}
272276

273277
if (toml::array* arr = codegenToml["processor"].as_array()) {
274278
codegen.processors.reserve(arr->size());

oi/ContainerInfo.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ struct ContainerInfo {
3737
std::string func;
3838
std::string handler = "";
3939
std::string traversalFunc = "";
40+
std::string extra = "";
4041
std::vector<Processor> processors{};
4142
};
4243

types/README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,12 @@ This document describes the format of the container definition files contained i
4848
`static types::st::Unit<DB> getSizeType(const T& container, ST returnArg)`
4949
where `ST` defines the combined static type of each supplied processor.
5050

51+
- `extra`
52+
53+
Any extra C++ code to be included directly. This code is not automatically
54+
wrapped in a namespace, so definitions from different container TOML files
55+
will collide if they share the same name.
56+
5157

5258
## Changes introduced with Typed Data Segment
5359
- `decl` and `func` fields are ignored when using `-ftyped-data-segment` and the

0 commit comments

Comments
 (0)