1 /*=========================================================================
2 
3   Program:   Visualization Toolkit
4   Module:    vtkInformationIntegerKey.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 /**
16  * @class   vtkInformationIntegerKey
17  * @brief   Key for integer values in vtkInformation.
18  *
19  * vtkInformationIntegerKey is used to represent keys for integer values
20  * in vtkInformation.
21  */
22 
23 #ifndef vtkInformationIntegerKey_h
24 #define vtkInformationIntegerKey_h
25 
26 #include "vtkCommonCoreModule.h" // For export macro
27 #include "vtkInformationKey.h"
28 
29 #include "vtkCommonInformationKeyManager.h" // Manage instances of this type.
30 
31 class VTKCOMMONCORE_EXPORT vtkInformationIntegerKey : public vtkInformationKey
32 {
33 public:
34   vtkTypeMacro(vtkInformationIntegerKey, vtkInformationKey);
35   void PrintSelf(ostream& os, vtkIndent indent) override;
36 
37   vtkInformationIntegerKey(const char* name, const char* location);
38   ~vtkInformationIntegerKey() override;
39 
40   /**
41    * This method simply returns a new vtkInformationIntegerKey, given a
42    * name and a location. This method is provided for wrappers. Use the
43    * constructor directly from C++ instead.
44    */
MakeKey(const char * name,const char * location)45   static vtkInformationIntegerKey* MakeKey(const char* name, const char* location)
46   {
47     return new vtkInformationIntegerKey(name, location);
48   }
49 
50   ///@{
51   /**
52    * Get/Set the value associated with this key in the given
53    * information object.
54    */
55   void Set(vtkInformation* info, int);
56   int Get(vtkInformation* info);
57   ///@}
58 
59   /**
60    * Copy the entry associated with this key from one information
61    * object to another.  If there is no entry in the first information
62    * object for this key, the value is removed from the second.
63    */
64   void ShallowCopy(vtkInformation* from, vtkInformation* to) override;
65 
66   /**
67    * Print the key's value in an information object to a stream.
68    */
69   void Print(ostream& os, vtkInformation* info) override;
70 
71 protected:
72   /**
73    * Get the address at which the actual value is stored.  This is
74    * meant for use from a debugger to add watches and is therefore not
75    * a public method.
76    */
77   int* GetWatchAddress(vtkInformation* info);
78 
79 private:
80   vtkInformationIntegerKey(const vtkInformationIntegerKey&) = delete;
81   void operator=(const vtkInformationIntegerKey&) = delete;
82 };
83 
84 #endif
85