Blender V4.3
PointerSequence.h
Go to the documentation of this file.
1/* SPDX-FileCopyrightText: 2023 Blender Authors
2 *
3 * SPDX-License-Identifier: GPL-2.0-or-later */
4
5#pragma once
6
49#include <algorithm>
50
51#ifdef WITH_CXX_GUARDEDALLOC
52# include "MEM_guardedalloc.h"
53#endif
54
55namespace Freestyle {
56
57template<typename C, typename T> class PointerSequence : public C {
59 PointerSequence &operator=(PointerSequence &other);
60
61 static void destroyer(T t)
62 {
63 delete t;
64 }
65
66 public:
68
70 {
71 destroy();
72 }
73
74 void destroy()
75 {
76 for_each(this->begin(), this->end(), destroyer);
77 }
78
79#ifdef WITH_CXX_GUARDEDALLOC
80 MEM_CXX_CLASS_ALLOC_FUNCS("Freestyle:PointerSequence")
81#endif
82};
83
84} /* namespace Freestyle */
Read Guarded memory(de)allocation.
inherits from class Rep
Definition AppCanvas.cpp:20