mirror of
https://github.com/JakeHillion/object-introspection.git
synced 2024-09-19 19:19:05 +01:00
35 lines
733 B
TOML
35 lines
733 B
TOML
[info]
|
||
typeName = "std::shared_ptr"
|
||
numTemplateParams = 1
|
||
ctype = "SHRD_PTR_TYPE"
|
||
header = "memory"
|
||
ns = ["namespace std"]
|
||
replaceTemplateParamIndex = []
|
||
# allocatorIndex = 0
|
||
# underlyingContainerIndex = 0
|
||
|
||
[codegen]
|
||
decl = """
|
||
template<typename T>
|
||
void getSizeType(const %1%<T> &s_ptr, size_t& returnArg);
|
||
"""
|
||
|
||
func = """
|
||
template<typename T>
|
||
void getSizeType(const %1%<T> &s_ptr, size_t& returnArg)
|
||
{
|
||
SAVE_SIZE(sizeof(%1%<T>));
|
||
|
||
if constexpr (!std::is_void<T>::value) {
|
||
SAVE_DATA((uintptr_t)(s_ptr.get()));
|
||
|
||
if (s_ptr && pointers.add((uintptr_t)(s_ptr.get()))) {
|
||
SAVE_DATA(1);
|
||
getSizeType(*(s_ptr.get()), returnArg);
|
||
} else {
|
||
SAVE_DATA(0);
|
||
}
|
||
}
|
||
}
|
||
"""
|