Blender V5.0
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
48
49#include <algorithm>
50
51#include "MEM_guardedalloc.h"
52
53namespace Freestyle {
54
55template<typename C, typename T> class PointerSequence : public C {
56 PointerSequence(PointerSequence &other);
57 PointerSequence &operator=(PointerSequence &other);
58
59 static void destroyer(T t)
60 {
61 delete t;
62 }
63
64 public:
66
68 {
69 destroy();
70 }
71
72 void destroy()
73 {
74 for_each(this->begin(), this->end(), destroyer);
75 }
76
77 MEM_CXX_CLASS_ALLOC_FUNCS("Freestyle:PointerSequence")
78};
79
80} /* namespace Freestyle */
Read Guarded memory(de)allocation.
#define C
Definition RandGen.cpp:29
iter begin(iter)
#define T
inherits from class Rep
Definition AppCanvas.cpp:20