VTK  9.3.1
vtkInformation.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
25 #ifndef vtkInformation_h
26 #define vtkInformation_h
27 
28 #include "vtkCommonCoreModule.h" // For export macro
29 #include "vtkObject.h"
30 
31 #include <string> // for std::string compat
32 
33 VTK_ABI_NAMESPACE_BEGIN
34 class vtkDataObject;
35 class vtkExecutive;
48 class vtkInformationKey;
49 class vtkInformationKeyToInformationFriendship;
60 class vtkVariant;
61 
62 class VTKCOMMONCORE_EXPORT vtkInformation : public vtkObject
63 {
64 public:
65  static vtkInformation* New();
66  vtkTypeMacro(vtkInformation, vtkObject);
67  void PrintSelf(ostream& os, vtkIndent indent) override;
68  void PrintKeys(ostream& os, vtkIndent indent);
69 
74  void Modified() override;
75 
82 
86  void Clear();
87 
92  int GetNumberOfKeys();
93 
101  void Copy(vtkInformation* from, vtkTypeBool deep = 0);
102 
109  void Append(vtkInformation* from, vtkTypeBool deep = 0);
110 
112 
118  void CopyEntry(vtkInformation* from, vtkInformationKey* key, vtkTypeBool deep = 0);
119  void CopyEntry(vtkInformation* from, vtkInformationDataObjectKey* key, vtkTypeBool deep = 0);
120  void CopyEntry(vtkInformation* from, vtkInformationDoubleVectorKey* key, vtkTypeBool deep = 0);
121  void CopyEntry(vtkInformation* from, vtkInformationVariantKey* key, vtkTypeBool deep = 0);
122  void CopyEntry(vtkInformation* from, vtkInformationVariantVectorKey* key, vtkTypeBool deep = 0);
123  void CopyEntry(vtkInformation* from, vtkInformationInformationKey* key, vtkTypeBool deep = 0);
124  void CopyEntry(
126  void CopyEntry(vtkInformation* from, vtkInformationIntegerKey* key, vtkTypeBool deep = 0);
127  void CopyEntry(vtkInformation* from, vtkInformationIntegerVectorKey* key, vtkTypeBool deep = 0);
128  void CopyEntry(
130  void CopyEntry(vtkInformation* from, vtkInformationRequestKey* key, vtkTypeBool deep = 0);
131  void CopyEntry(vtkInformation* from, vtkInformationStringKey* key, vtkTypeBool deep = 0);
132  void CopyEntry(vtkInformation* from, vtkInformationStringVectorKey* key, vtkTypeBool deep = 0);
133  void CopyEntry(vtkInformation* from, vtkInformationUnsignedLongKey* key, vtkTypeBool deep = 0);
135 
142  void CopyEntries(vtkInformation* from, vtkInformationKeyVectorKey* key, vtkTypeBool deep = 0);
143 
147  int Has(vtkInformationKey* key);
148 
152  void Remove(vtkInformationKey* key);
153 
155 
158  void Set(vtkInformationRequestKey* key);
159  void Remove(vtkInformationRequestKey* key);
160  int Has(vtkInformationRequestKey* key);
162 
164 
167  void Set(vtkInformationIntegerKey* key, int value);
168  int Get(vtkInformationIntegerKey* key);
169  void Remove(vtkInformationIntegerKey* key);
170  int Has(vtkInformationIntegerKey* key);
172 
174 
179  void Remove(vtkInformationIdTypeKey* key);
180  int Has(vtkInformationIdTypeKey* key);
182 
184 
187  void Set(vtkInformationDoubleKey* key, double value);
188  double Get(vtkInformationDoubleKey* key);
189  void Remove(vtkInformationDoubleKey* key);
190  int Has(vtkInformationDoubleKey* key);
192 
194 
197  void Set(vtkInformationVariantKey* key, const vtkVariant& value);
199  void Remove(vtkInformationVariantKey* key);
200  int Has(vtkInformationVariantKey* key);
202 
204 
207  void Append(vtkInformationIntegerVectorKey* key, int value);
208  void Set(vtkInformationIntegerVectorKey* key, const int* value, int length);
209  void Set(vtkInformationIntegerVectorKey* key, int value1, int value2, int value3);
210  void Set(vtkInformationIntegerVectorKey* key, int value1, int value2, int value3, int value4,
211  int value5, int value6);
213  int Get(vtkInformationIntegerVectorKey* key, int idx);
214  void Get(vtkInformationIntegerVectorKey* key, int* value);
215  int Length(vtkInformationIntegerVectorKey* key);
216  void Remove(vtkInformationIntegerVectorKey* key);
219 
221 
224  void Append(vtkInformationStringVectorKey* key, const char* value);
225  void Set(vtkInformationStringVectorKey* key, const char* value, int idx = 0);
226  void Append(vtkInformationStringVectorKey* key, const std::string& value);
227  void Set(vtkInformationStringVectorKey* key, const std::string& value, int idx = 0);
228  const char* Get(vtkInformationStringVectorKey* key, int idx = 0);
229  int Length(vtkInformationStringVectorKey* key);
230  void Remove(vtkInformationStringVectorKey* key);
233 
235 
238  void Set(vtkInformationIntegerPointerKey* key, int* value, int length);
240  void Get(vtkInformationIntegerPointerKey* key, int* value);
242  void Remove(vtkInformationIntegerPointerKey* key);
245 
247 
250  void Set(vtkInformationUnsignedLongKey* key, unsigned long value);
251  unsigned long Get(vtkInformationUnsignedLongKey* key);
252  void Remove(vtkInformationUnsignedLongKey* key);
255 
257 
260  void Append(vtkInformationDoubleVectorKey* key, double value);
261  void Set(vtkInformationDoubleVectorKey* key, const double* value, int length);
262  void Set(vtkInformationDoubleVectorKey* key, double value1, double value2, double value3);
263  void Set(vtkInformationDoubleVectorKey* key, double value1, double value2, double value3,
264  double value4, double value5, double value6);
265  double* Get(vtkInformationDoubleVectorKey* key);
266  double Get(vtkInformationDoubleVectorKey* key, int idx);
267  void Get(vtkInformationDoubleVectorKey* key, double* value);
268  int Length(vtkInformationDoubleVectorKey* key);
269  void Remove(vtkInformationDoubleVectorKey* key);
272 
274 
277  void Append(vtkInformationVariantVectorKey* key, const vtkVariant& value);
278  void Set(vtkInformationVariantVectorKey* key, const vtkVariant* value, int length);
279  void Set(vtkInformationVariantVectorKey* key, const vtkVariant& value1, const vtkVariant& value2,
280  const vtkVariant& value3);
281  void Set(vtkInformationVariantVectorKey* key, const vtkVariant& value1, const vtkVariant& value2,
282  const vtkVariant& value3, const vtkVariant& value4, const vtkVariant& value5,
283  const vtkVariant& value6);
285  const vtkVariant& Get(vtkInformationVariantVectorKey* key, int idx);
287  int Length(vtkInformationVariantVectorKey* key);
288  void Remove(vtkInformationVariantVectorKey* key);
291 
293 
303  int Length(vtkInformationKeyVectorKey* key);
304  void Remove(vtkInformationKeyVectorKey* key);
307 
308  // Provide extra overloads of this method to avoid requiring user
309  // code to include the headers for these key types. Avoid wrapping
310  // them because the original method can be called from the wrappers
311  // anyway and this causes a python help string to be too long.
312 
324 
336 
338 
341  void Set(vtkInformationStringKey* key, const char*);
342  void Set(vtkInformationStringKey* key, const std::string&);
343  const char* Get(vtkInformationStringKey* key);
344  void Remove(vtkInformationStringKey* key);
345  int Has(vtkInformationStringKey* key);
347 
349 
354  void Remove(vtkInformationInformationKey* key);
357 
359 
367 
369 
374  void Remove(vtkInformationObjectBaseKey* key);
377 
379 
383  void Set(vtkInformationObjectBaseVectorKey* key, vtkObjectBase* value, int idx = 0);
387  void Remove(vtkInformationObjectBaseVectorKey* key, vtkObjectBase* objectToRemove);
388  void Remove(vtkInformationObjectBaseVectorKey* key, int indexToRemove);
391 
393 
396  void Set(vtkInformationDataObjectKey* key, vtkDataObject VTK_WRAP_EXTERN*);
397  vtkDataObject VTK_WRAP_EXTERN* Get(vtkInformationDataObjectKey* key);
398  void Remove(vtkInformationDataObjectKey* key);
401 
403 
416  static vtkInformationKey* GetKey(vtkInformationKey* key);
421 
423 
426  bool UsesGarbageCollector() const override { return true; }
428 
430 
433  void SetRequest(vtkInformationRequestKey* request);
434  vtkInformationRequestKey* GetRequest();
436 
437 protected:
438  vtkInformation();
439  ~vtkInformation() override;
440 
441  // Get/Set a map entry directly through the vtkObjectBase instance
442  // representing the value. Used internally to manage the map.
443  void SetAsObjectBase(vtkInformationKey* key, vtkObjectBase* value);
444  const vtkObjectBase* GetAsObjectBase(const vtkInformationKey* key) const;
445  vtkObjectBase* GetAsObjectBase(vtkInformationKey* key);
446 
447  // Internal implementation details.
449 
450  // Garbage collection support.
451  void ReportReferences(vtkGarbageCollector*) override;
452 
453  // Report the object associated with the given key to the collector.
454  void ReportAsObjectBase(vtkInformationKey* key, vtkGarbageCollector* collector);
455 
456 private:
457  friend class vtkInformationKeyToInformationFriendship;
459 
460  vtkInformation(const vtkInformation&) = delete;
461  void operator=(const vtkInformation&) = delete;
462  vtkInformationRequestKey* Request;
463 };
464 
465 VTK_ABI_NAMESPACE_END
466 #endif
Key for unsigned long values in vtkInformation.
abstract base class for most VTK objects
Definition: vtkObject.h:51
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
Key for vtkInformation values.
Store vtkAlgorithm input/output information.
Key for vtkDataObject values.
vtkInformationInternals * Internal
internal structure for vtkInformation
int vtkIdType
Definition: vtkType.h:315
Superclass for all pipeline executives in VTK.
Definition: vtkExecutive.h:38
Key for string values in vtkInformation.
Detect and break reference loops.
A type representing the union of many types.
Definition: vtkVariant.h:52
int vtkTypeBool
Definition: vtkABI.h:64
Superclass for vtkInformation keys.
Key for double vector values.
bool UsesGarbageCollector() const override
Initiate garbage collection when a reference is removed.
a simple class to control print indentation
Definition: vtkIndent.h:28
virtual void ReportReferences(vtkGarbageCollector *)
Key for pointer to pointer.
Key for integer values in vtkInformation.
Iterates over keys of an information object.
Key for vtkObjectBase values.
virtual void Modified()
Update the modification time for this object.
abstract base class for most VTK objects
Definition: vtkObjectBase.h:62
Key for variant values in vtkInformation.
Key for String vector values.
Key for vector-of-keys values.
Key for vtkExecutive/Port value pair vectors.
Key for vtkObjectBase vector values.
Key for double values in vtkInformation.
Store zero or more vtkInformation instances.
static vtkObject * New()
Create an object with Debug turned off, modified time initialized to zero, and reference counting on...
general representation of visualization data
Definition: vtkDataObject.h:54
Key for vtkIdType values in vtkInformation.
Key for vtkExecutive/Port value pairs.