2022-12-19 14:37:51 +00:00
|
|
|
[info]
|
2023-05-23 22:26:38 +01:00
|
|
|
type_name = "std::vector"
|
|
|
|
stub_template_params = [1]
|
2022-12-19 14:37:51 +00:00
|
|
|
ctype = "SEQ_TYPE"
|
|
|
|
header = "vector"
|
2023-05-23 22:26:38 +01:00
|
|
|
|
|
|
|
# Old:
|
|
|
|
typeName = "std::vector<"
|
2022-12-19 14:37:51 +00:00
|
|
|
ns = ["namespace std"]
|
2023-05-23 22:26:38 +01:00
|
|
|
numTemplateParams = 1
|
2022-12-19 14:37:51 +00:00
|
|
|
allocatorIndex = 1
|
|
|
|
|
|
|
|
[codegen]
|
|
|
|
decl = """
|
|
|
|
template<typename T>
|
|
|
|
void getSizeType(const %1%<T> &container, size_t& returnArg);
|
|
|
|
"""
|
|
|
|
|
|
|
|
func = """
|
|
|
|
template<typename T>
|
|
|
|
void getSizeType(const %1%<T> &container, size_t& returnArg)
|
|
|
|
{
|
|
|
|
SAVE_SIZE(sizeof(%1%<T>));
|
|
|
|
|
|
|
|
SAVE_DATA((uintptr_t)&container);
|
|
|
|
SAVE_DATA((uintptr_t)container.capacity());
|
|
|
|
SAVE_DATA((uintptr_t)container.size());
|
|
|
|
|
|
|
|
SAVE_SIZE((container.capacity() - container.size()) * sizeof(T));
|
|
|
|
|
|
|
|
// The double ampersand is needed otherwise this loop doesn't work with vector<bool>
|
|
|
|
for (auto&& it: container) {
|
|
|
|
getSizeType(it, returnArg);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
"""
|