object-introspection/types/f14_node_set.toml
Jake Hillion f9cb0115e1 types: remove now unused handlers
Summary:

Handlers were added in an intermediate form of tbv2 but those intermediate
forms have now been removed. Remove all the handlers to make grepping/find and
replaces easier across the types.

Test Plan:

- CI
2023-11-15 14:27:07 +00:00

82 lines
2.1 KiB
TOML

[info]
type_name = "folly::F14NodeSet"
stub_template_params = [1,2,3]
ctype = "F14_SET"
header = "folly/container/F14Set.h"
# Old:
typeName = "folly::F14NodeSet<"
ns = ["folly::F14NodeSet"]
numTemplateParams = 1
replaceTemplateParamIndex = [1, 2]
allocatorIndex = 3
[codegen]
decl = """
template <typename Key, typename Hasher, typename KeyEqual, typename Alloc>
void getSizeType(const %1%<Key, Hasher, KeyEqual, Alloc> &container, size_t& returnArg);
"""
func = """
template <typename Key, typename Hasher, typename KeyEqual, typename Alloc>
void getSizeType(const %1%<Key, Hasher, KeyEqual, Alloc> &container, size_t& returnArg)
{
size_t memorySize = container.getAllocatedMemorySize();
SAVE_SIZE(sizeof(%1%<Key, Hasher, KeyEqual, Alloc>) + memorySize);
SAVE_DATA(memorySize);
SAVE_DATA(container.bucket_count());
SAVE_DATA(container.size());
// The double ampersand is needed otherwise this loop doesn't work with vector<bool>
for (auto&& it: container) {
getSizeType(it, returnArg);
}
}
"""
traversal_func = """
auto tail = returnArg
.write((uintptr_t)container.getAllocatedMemorySize())
.write((uintptr_t)container.bucket_count())
.write(container.size());
for (auto &&entry: container) {
tail = tail.delegate([&entry](auto ret) {
return OIInternal::getSizeType<DB>(entry, ret);
});
}
return tail.finish();
"""
[[codegen.processor]]
type = "types::st::VarInt<DB>"
func = "el.pointer = std::get<ParsedData::VarInt>(d.val).value;"
[[codegen.processor]]
type = "types::st::VarInt<DB>"
func = """
el.container_stats.emplace(result::Element::ContainerStats {
.capacity = std::get<ParsedData::VarInt>(d.val).value,
});
"""
[[codegen.processor]]
type = """
types::st::List<DB, typename TypeHandler<DB, T0>::type>
"""
func = """
auto allocationSize = el.pointer.value();
el.pointer.reset();
auto list = std::get<ParsedData::List>(d.val);
el.container_stats->length = list.length;
el.exclusive_size += allocationSize - list.length * sizeof(T0);
static constexpr auto childField = make_field<DB, T0>("[]");
for (size_t i = 0; i < list.length; i++)
stack_ins(childField);
"""