mirror of
https://github.com/JakeHillion/object-introspection.git
synced 2024-11-09 21:24:14 +00:00
35 lines
801 B
TOML
35 lines
801 B
TOML
[info]
|
|
typeName = "std::vector<"
|
|
numTemplateParams = 1
|
|
ctype = "SEQ_TYPE"
|
|
header = "vector"
|
|
ns = ["namespace std"]
|
|
replaceTemplateParamIndex = []
|
|
allocatorIndex = 1
|
|
# underlyingContainerIndex = 0
|
|
|
|
[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);
|
|
}
|
|
}
|
|
"""
|