VTK  9.4.20241218
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 "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
49 static void AddFinalizer(std::function<void()> finalizer);
50
51private:
52 // Unimplemented
55
56 static void ClassInitialize();
57 static void ClassFinalize();
58
59 static std::vector<std::function<void()>>* Finalizers;
60};
61
62// This instance will show up in any translation unit that uses key
63// types defined in vtkFiltering or that has a singleton. It will
64// make sure vtkFilteringInformationKeyManager's vector of keys is
65// initialized before and destroyed after it is used.
67
68VTK_ABI_NAMESPACE_END
69#endif
70// 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