object-introspection/types/list_type.toml
2022-12-19 06:37:51 -08:00

32 lines
741 B
TOML

[info]
typeName = "std::list<"
numTemplateParams = 1
ctype = "LIST_TYPE"
header = "list"
ns = ["namespace std"]
replaceTemplateParamIndex = []
allocatorIndex = 1
# underlyingContainerIndex = 0
[codegen]
decl = """
template<typename T, typename Allocator>
void getSizeType(const %1%<T, Allocator> &container, size_t& returnArg);
"""
func = """
template<typename T, typename Allocator>
void getSizeType(const %1%<T, Allocator> &container, size_t& returnArg)
{
SAVE_SIZE(sizeof(%1%<T>));
SAVE_DATA((uintptr_t)&container);
SAVE_DATA((uintptr_t)container.size());
// The double ampersand is needed otherwise this loop doesn't work with vector<bool>
for (auto&& it: container) {
getSizeType(it, returnArg);
}
}
"""