VTK  9.4.20241118
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
13#ifndef vtkFilteringInformationKeyManager_h
14#define vtkFilteringInformationKeyManager_h
15
16#include "vtkCommonExecutionModelModule.h" // For export macro
17#include "vtkSystemIncludes.h"
18
19#include "token/Singletons.h" // to increment its Schwarz counter
20#include "vtkDebugLeaksManager.h" // DebugLeaks exists longer than info keys.
21
22#include <functional> // for finalizers
23#include <vector> // for finalizers
24
25VTK_ABI_NAMESPACE_BEGIN
27
28class VTKCOMMONEXECUTIONMODEL_EXPORT vtkFilteringInformationKeyManager
29{
30public:
33
40 static void Register(vtkInformationKey* key);
41
48 static void AddFinalizer(std::function<void()> finalizer);
49
50private:
51 // Unimplemented
54
55 static void ClassInitialize();
56 static void ClassFinalize();
57
58 static std::vector<std::function<void()>>* Finalizers;
59};
60
61// This instance will show up in any translation unit that uses key
62// types defined in vtkFiltering or that has a singleton. It will
63// make sure vtkFilteringInformationKeyManager's vector of keys is
64// initialized before and destroyed after it is used.
66
67VTK_ABI_NAMESPACE_END
68#endif
69// VTK-HeaderTest-Exclude: vtkFilteringInformationKeyManager.h
static void AddFinalizer(std::function< void()> finalizer)
Ensure that finalizer is invoked before ClassFinalizer() runs.
static void Register(vtkInformationKey *key)
Called by constructors of vtkInformationKey subclasses defined in vtkFiltering to register themselves...
Superclass for vtkInformation keys.
static vtkFilteringInformationKeyManager vtkFilteringInformationKeyManagerInstance