Blender
V4.3
intern
ghost
intern
GHOST_Util.hh
Go to the documentation of this file.
1
/* SPDX-FileCopyrightText: 2002-2023 Blender Authors
2
*
3
* SPDX-License-Identifier: GPL-2.0-or-later */
4
9
#pragma once
10
11
#include <functional>
12
17
struct
GHOST_C_CustomDataWrapper
{
18
using
FreeFn
= std::function<void(
void
*)>;
19
20
void
*
custom_data_
;
21
FreeFn
free_fn_
;
22
23
GHOST_C_CustomDataWrapper
(
void
*custom_data,
FreeFn
free_fn)
24
:
custom_data_
(custom_data),
free_fn_
(free_fn)
25
{
26
}
27
~GHOST_C_CustomDataWrapper
()
28
{
29
if
(
free_fn_
!=
nullptr
&&
custom_data_
!=
nullptr
) {
30
free_fn_
(
custom_data_
);
31
}
32
}
33
};
GHOST_C_CustomDataWrapper
Definition
GHOST_Util.hh:17
GHOST_C_CustomDataWrapper::custom_data_
void * custom_data_
Definition
GHOST_Util.hh:20
GHOST_C_CustomDataWrapper::FreeFn
std::function< void(void *)> FreeFn
Definition
GHOST_Util.hh:18
GHOST_C_CustomDataWrapper::GHOST_C_CustomDataWrapper
GHOST_C_CustomDataWrapper(void *custom_data, FreeFn free_fn)
Definition
GHOST_Util.hh:23
GHOST_C_CustomDataWrapper::~GHOST_C_CustomDataWrapper
~GHOST_C_CustomDataWrapper()
Definition
GHOST_Util.hh:27
GHOST_C_CustomDataWrapper::free_fn_
FreeFn free_fn_
Definition
GHOST_Util.hh:21
Generated on Thu Feb 6 2025 07:36:39 for Blender by
doxygen
1.11.0