VTK  9.3.20240425
vtkInformationKeyLookup.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
3
13#ifndef vtkInformationKeyLookup_h
14#define vtkInformationKeyLookup_h
15
16#include "vtkCommonCoreModule.h" // For export macro
17#include "vtkObject.h"
18
19#include <map> // For std::map
20#include <string> // For std::string
21#include <utility> // For std::pair
22
23VTK_ABI_NAMESPACE_BEGIN
25
26class VTKCOMMONCORE_EXPORT vtkInformationKeyLookup : public vtkObject
27{
28public:
31
35 void PrintSelf(ostream& os, vtkIndent indent) override;
36
43 static vtkInformationKey* Find(const std::string& name, const std::string& location);
44
45protected:
48
49 friend class vtkInformationKey;
50
55 static void RegisterKey(
56 vtkInformationKey* key, const std::string& name, const std::string& location);
57
58private:
60 void operator=(const vtkInformationKeyLookup&) = delete;
61
62 typedef std::pair<std::string, std::string> Identifier; // Location, Name
63 typedef std::map<Identifier, vtkInformationKey*> KeyMap;
64
65 // Using a static function / variable here to ensure static initialization
66 // works as intended, since key objects are static, too.
67 static KeyMap& Keys();
68};
69
70VTK_ABI_NAMESPACE_END
71#endif // vtkInformationKeyLookup_h
a simple class to control print indentation
Definition vtkIndent.h:108
Find vtkInformationKeys from name and location strings.
static vtkInformationKeyLookup * New()
static vtkInformationKey * Find(const std::string &name, const std::string &location)
Find an information key from name and location strings.
~vtkInformationKeyLookup() override
static void RegisterKey(vtkInformationKey *key, const std::string &name, const std::string &location)
Add a key to the KeyMap.
void PrintSelf(ostream &os, vtkIndent indent) override
Lists all known keys.
Superclass for vtkInformation keys.
abstract base class for most VTK objects
Definition vtkObject.h:162