2022-12-19 14:37:51 +00:00
|
|
|
[info]
|
2023-05-23 22:26:38 +01:00
|
|
|
type_name = "std::unordered_map"
|
|
|
|
stub_template_params = [2,3,4]
|
2022-12-19 14:37:51 +00:00
|
|
|
ctype = "STD_UNORDERED_MAP_TYPE"
|
|
|
|
header = "unordered_map"
|
2023-05-23 22:26:38 +01:00
|
|
|
|
|
|
|
# Old:
|
|
|
|
typeName = "std::unordered_map<"
|
2022-12-19 14:37:51 +00:00
|
|
|
ns = ["namespace std"]
|
2023-05-23 22:26:38 +01:00
|
|
|
numTemplateParams = 2
|
2022-12-19 14:37:51 +00:00
|
|
|
replaceTemplateParamIndex = [2, 3]
|
|
|
|
allocatorIndex = 4
|
|
|
|
|
|
|
|
[codegen]
|
|
|
|
decl = """
|
|
|
|
template<class K, class T, class H, class KE, class A>
|
|
|
|
void getSizeType(const %1%<K, T, H, KE, A> &container, size_t& returnArg);
|
|
|
|
"""
|
|
|
|
|
|
|
|
func = """
|
|
|
|
template<class K, class T, class H, class KE, class A>
|
|
|
|
void getSizeType(const %1%<K, T, H, KE, A> &container, size_t& returnArg)
|
|
|
|
{
|
|
|
|
constexpr size_t nodeSize = sizeof(typename %1%<K, T, H, KE, A>::node_type);
|
|
|
|
size_t bucketCount = container.bucket_count();
|
|
|
|
size_t numElems = container.size();
|
|
|
|
|
|
|
|
SAVE_SIZE(sizeof(%1%<K, T, H, KE, A>) + (nodeSize * numElems) + (bucketCount * sizeof(uintptr_t)));
|
|
|
|
|
|
|
|
SAVE_DATA((uintptr_t)nodeSize);
|
|
|
|
SAVE_DATA((uintptr_t)bucketCount);
|
|
|
|
SAVE_DATA((uintptr_t)numElems);
|
|
|
|
|
|
|
|
for (auto const& it : container)
|
|
|
|
{
|
|
|
|
getSizeType(it.first, returnArg);
|
|
|
|
getSizeType(it.second, returnArg);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
"""
|