VTK
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 
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 <utility> // For std::pair
33 #include <string> // For std::string
34 
35 class vtkInformationKey;
36 
37 class VTKCOMMONCORE_EXPORT vtkInformationKeyLookup: public vtkObject
38 {
39 public:
40  static vtkInformationKeyLookup* New();
42 
43 
46  void PrintSelf(ostream& os, vtkIndent indent) override;
47 
54  static vtkInformationKey* Find(const std::string &name,
55  const std::string &location);
56 
57 protected:
59  ~vtkInformationKeyLookup() override;
60 
61  friend class vtkInformationKey;
62 
67  static void RegisterKey(vtkInformationKey *key,
68  const std::string &name,
69  const std::string &location);
70 
71 private:
72  vtkInformationKeyLookup(const vtkInformationKeyLookup&) = delete;
73  void operator=(const vtkInformationKeyLookup&) = delete;
74 
75  typedef std::pair<std::string, std::string> Identifier; // Location, Name
76  typedef std::map<Identifier, vtkInformationKey*> KeyMap;
77 
78  // Using a static function / variable here to ensure static initialization
79  // works as intended, since key objects are static, too.
80  static KeyMap& Keys();
81 };
82 
83 #endif // vtkInformationKeyLookup_h
abstract base class for most VTK objects
Definition: vtkObject.h:59
Find vtkInformationKeys from name and location strings.
Superclass for vtkInformation keys.
a simple class to control print indentation
Definition: vtkIndent.h:39
static vtkObject * New()
Create an object with Debug turned off, modified time initialized to zero, and reference counting on...