mirror of
https://github.com/JakeHillion/object-introspection.git
synced 2024-09-19 19:19:05 +01:00
68290655b1
This change is fully backwards compatible with the old ContainerInfo parser, as it is just adding new fields. The old fields will continue to be used by legacy OICodeGen until that is removed. Also add a README to document the format.
37 lines
1.1 KiB
TOML
37 lines
1.1 KiB
TOML
[info]
|
|
type_name = "folly::F14VectorMap"
|
|
stub_template_params = [2,3,4]
|
|
ctype = "F14_MAP"
|
|
header = "folly/container/detail/F14MapFallback.h"
|
|
|
|
# Old:
|
|
typeName = "folly::F14VectorMap<"
|
|
ns = ["folly::F14VectorMap"]
|
|
numTemplateParams = 2
|
|
replaceTemplateParamIndex = []
|
|
|
|
[codegen]
|
|
decl = """
|
|
template <typename Key, typename Mapped, typename Hasher, typename KeyEqual, typename Alloc>
|
|
void getSizeType(const %1%<Key, Mapped, Hasher, KeyEqual, Alloc> &container, size_t& dataSegOffset);
|
|
"""
|
|
|
|
func = """
|
|
template <typename Key, typename Mapped, typename Hasher, typename KeyEqual, typename Alloc>
|
|
void getSizeType(const %1%<Key, Mapped, Hasher, KeyEqual, Alloc> &container, size_t& returnArg)
|
|
{
|
|
size_t memorySize = container.getAllocatedMemorySize();
|
|
SAVE_SIZE(sizeof(%1%<Key, Mapped, Hasher, KeyEqual>) + 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.first, returnArg);
|
|
getSizeType(it.second, returnArg);
|
|
}
|
|
}
|
|
"""
|