VTK  9.7.20260716
vtkFilteringInformationKeyManager.h
Go to the documentation of this file.
1// SPDX-FileCopyrightText: Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
2// SPDX-License-Identifier: BSD-3-Clause
12
13#ifndef vtkFilteringInformationKeyManager_h
14#define vtkFilteringInformationKeyManager_h
15
16#include "vtkCommonExecutionModelModule.h" // For export macro
17#include "vtkSystemIncludes.h"
18
19#include "vtkDebugLeaksManager.h" // DebugLeaks exists longer than info keys.
20
21#include <token/Singletons.h> // to increment its Schwarz counter
22
23#include <functional> // for finalizers
24#include <vector> // for finalizers
25
26VTK_ABI_NAMESPACE_BEGIN
28
29class VTKCOMMONEXECUTIONMODEL_EXPORT vtkFilteringInformationKeyManager
30{
31public:
34
41 static void Register(vtkInformationKey* key);
42
48 static void Unregister(vtkInformationKey* key);
49
56 static void AddFinalizer(std::function<void()> finalizer);
57
58private:
59 // Unimplemented
62
63 static void ClassInitialize();
64 static void ClassFinalize();
65
66 static std::vector<std::function<void()>>* Finalizers;
67};
68
69// This instance will show up in any translation unit that uses key
70// types defined in vtkFiltering or that has a singleton. It will
71// make sure vtkFilteringInformationKeyManager's vector of keys is
72// initialized before and destroyed after it is used.
74
75VTK_ABI_NAMESPACE_END
76#endif
77// VTK-HeaderTest-Exclude: vtkFilteringInformationKeyManager.h
static void AddFinalizer(std::function< void()> finalizer)
Ensure that finalizer is invoked before ClassFinalizer() runs.
static void Unregister(vtkInformationKey *key)
Remove a key from the manager's deletion list.
static void Register(vtkInformationKey *key)
Called by constructors of vtkInformationKey subclasses defined in vtkFiltering to register themselves...
Superclass for vtkInformation keys.
static vtkFilteringInformationKeyManager vtkFilteringInformationKeyManagerInstance