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 
22 #ifndef vtkInformationKeyLookup_h
23 #define vtkInformationKeyLookup_h
24 
25 #include "vtkCommonCoreModule.h" // For export macro
26 #include "vtkObject.h"
27 
28 #include <map> // For std::map
29 #include <utility> // For std::pair
30 #include <string> // For std::string
31 
32 class vtkInformationKey;
33 
34 class VTKCOMMONCORE_EXPORT vtkInformationKeyLookup: public vtkObject
35 {
36 public:
37  static vtkInformationKeyLookup* New();
39 
40 
43  void PrintSelf(ostream& os, vtkIndent indent) VTK_OVERRIDE;
44 
51  static vtkInformationKey* Find(const std::string &name,
52  const std::string &location);
53 
54 protected:
56  ~vtkInformationKeyLookup() VTK_OVERRIDE;
57 
58  friend class vtkInformationKey;
59 
64  static void RegisterKey(vtkInformationKey *key,
65  const std::string &name,
66  const std::string &location);
67 
68 private:
69  vtkInformationKeyLookup(const vtkInformationKeyLookup&) VTK_DELETE_FUNCTION;
70  void operator=(const vtkInformationKeyLookup&) VTK_DELETE_FUNCTION;
71 
72  typedef std::pair<std::string, std::string> Identifier; // Location, Name
73  typedef std::map<Identifier, vtkInformationKey*> KeyMap;
74 
75  // Using a static function / variable here to ensure static initialization
76  // works as intended, since key objects are static, too.
77  static KeyMap& Keys();
78 };
79 
80 #endif // vtkInformationKeyLookup_h
abstract base class for most VTK objects
Definition: vtkObject.h:53
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
Find vtkInformationKeys from name and location strings.
Superclass for vtkInformation keys.
a simple class to control print indentation
Definition: vtkIndent.h:33
static vtkObject * New()
Create an object with Debug turned off, modified time initialized to zero, and reference counting on...