VTK  9.2.6
vtkInformationKeyLookup.h
Go to the documentation of this file.
1/*=========================================================================
2
3 Program: Visualization Toolkit
4 Module: vtkInformationKeyLookup.h
5
6 Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
7 All rights reserved.
8 See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
9
10 This software is distributed WITHOUT ANY WARRANTY; without even
11 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
12 PURPOSE. See the above copyright notice for more information.
13
14=========================================================================*/
15
24
25#ifndef vtkInformationKeyLookup_h
26#define vtkInformationKeyLookup_h
27
28#include "vtkCommonCoreModule.h" // For export macro
29#include "vtkObject.h"
30
31#include <map> // For std::map
32#include <string> // For std::string
33#include <utility> // For std::pair
34
36
37class VTKCOMMONCORE_EXPORT vtkInformationKeyLookup : public vtkObject
38{
39public:
42
46 void PrintSelf(ostream& os, vtkIndent indent) override;
47
54 static vtkInformationKey* Find(const std::string& name, const std::string& location);
55
56protected:
59
60 friend class vtkInformationKey;
61
66 static void RegisterKey(
67 vtkInformationKey* key, const std::string& name, const std::string& location);
68
69private:
71 void operator=(const vtkInformationKeyLookup&) = delete;
72
73 typedef std::pair<std::string, std::string> Identifier; // Location, Name
74 typedef std::map<Identifier, vtkInformationKey*> KeyMap;
75
76 // Using a static function / variable here to ensure static initialization
77 // works as intended, since key objects are static, too.
78 static KeyMap& Keys();
79};
80
81#endif // vtkInformationKeyLookup_h
a simple class to control print indentation
Definition vtkIndent.h:40
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.