2022-12-19 14:37:51 +00:00
|
|
|
[info]
|
2023-05-23 22:26:38 +01:00
|
|
|
type_name = "std::shared_ptr"
|
2022-12-19 14:37:51 +00:00
|
|
|
ctype = "SHRD_PTR_TYPE"
|
|
|
|
header = "memory"
|
2023-05-23 22:26:38 +01:00
|
|
|
|
|
|
|
# Old:
|
|
|
|
typeName = "std::shared_ptr"
|
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
|
|
|
replaceTemplateParamIndex = []
|
|
|
|
|
|
|
|
[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) {
|
2023-04-05 20:55:40 +01:00
|
|
|
SAVE_DATA((uintptr_t)(s_ptr.get()));
|
2022-12-19 14:37:51 +00:00
|
|
|
|
2023-04-05 20:55:40 +01:00
|
|
|
if (s_ptr && pointers.add((uintptr_t)(s_ptr.get()))) {
|
|
|
|
SAVE_DATA(1);
|
|
|
|
getSizeType(*(s_ptr.get()), returnArg);
|
|
|
|
} else {
|
|
|
|
SAVE_DATA(0);
|
|
|
|
}
|
2022-12-19 14:37:51 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
"""
|