VTK  9.7.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 #include "vtkWrappingHints.h" // For VTK_MARSHALMANUAL
31 
32 #include <string> // for std::string compat
33 
34 VTK_ABI_NAMESPACE_BEGIN
35 class vtkDataObject;
36 class vtkExecutive;
49 class vtkInformationKey;
50 class vtkInformationKeyToInformationFriendship;
61 class vtkVariant;
62 
63 class VTKCOMMONCORE_EXPORT VTK_MARSHALMANUAL vtkInformation : public vtkObject
64 {
65 public:
66  static vtkInformation* New();
67  vtkTypeMacro(vtkInformation, vtkObject);
68  void PrintSelf(ostream& os, vtkIndent indent) override;
69  void PrintKeys(ostream& os, vtkIndent indent);
70 
75  void Modified() override;
76 
83 
87  void Clear();
88 
93  int GetNumberOfKeys(); // can't const
94 
102  void Copy(vtkInformation* from, vtkTypeBool deep = 0);
103 
110  void Append(vtkInformation* from, vtkTypeBool deep = 0);
111 
113 
119  void CopyEntry(vtkInformation* from, vtkInformationKey* key, vtkTypeBool deep = 0);
120  void CopyEntry(vtkInformation* from, vtkInformationDataObjectKey* key, vtkTypeBool deep = 0);
121  void CopyEntry(vtkInformation* from, vtkInformationDoubleVectorKey* key, vtkTypeBool deep = 0);
122  void CopyEntry(vtkInformation* from, vtkInformationVariantKey* key, vtkTypeBool deep = 0);
123  void CopyEntry(vtkInformation* from, vtkInformationVariantVectorKey* key, vtkTypeBool deep = 0);
124  void CopyEntry(vtkInformation* from, vtkInformationInformationKey* key, vtkTypeBool deep = 0);
125  void CopyEntry(
127  void CopyEntry(vtkInformation* from, vtkInformationIntegerKey* key, vtkTypeBool deep = 0);
128  void CopyEntry(vtkInformation* from, vtkInformationIntegerVectorKey* key, vtkTypeBool deep = 0);
129  void CopyEntry(
131  void CopyEntry(vtkInformation* from, vtkInformationRequestKey* key, vtkTypeBool deep = 0);
132  void CopyEntry(vtkInformation* from, vtkInformationStringKey* key, vtkTypeBool deep = 0);
133  void CopyEntry(vtkInformation* from, vtkInformationStringVectorKey* key, vtkTypeBool deep = 0);
134  void CopyEntry(vtkInformation* from, vtkInformationUnsignedLongKey* key, vtkTypeBool deep = 0);
136 
143  void CopyEntries(vtkInformation* from, vtkInformationKeyVectorKey* key, vtkTypeBool deep = 0);
144 
148  int Has(vtkInformationKey* key) VTK_FUTURE_CONST;
149 
153  void Remove(vtkInformationKey* key);
154 
156 
159  void Set(vtkInformationRequestKey* key);
160  void Remove(vtkInformationRequestKey* key);
161  int Has(vtkInformationRequestKey* key) VTK_FUTURE_CONST;
163 
165 
168  void Set(vtkInformationIntegerKey* key, int value);
169  int Get(vtkInformationIntegerKey* key);
170  void Remove(vtkInformationIntegerKey* key);
171  int Has(vtkInformationIntegerKey* key) VTK_FUTURE_CONST;
173 
175 
180  void Remove(vtkInformationIdTypeKey* key);
181  int Has(vtkInformationIdTypeKey* key) VTK_FUTURE_CONST;
183 
185 
188  void Set(vtkInformationDoubleKey* key, double value);
189  double Get(vtkInformationDoubleKey* key);
190  void Remove(vtkInformationDoubleKey* key);
191  int Has(vtkInformationDoubleKey* key) VTK_FUTURE_CONST;
193 
195 
198  void Set(vtkInformationVariantKey* key, const vtkVariant& value);
200  void Remove(vtkInformationVariantKey* key);
201  int Has(vtkInformationVariantKey* key) VTK_FUTURE_CONST;
203 
205 
208  void Append(vtkInformationIntegerVectorKey* key, int value);
209  void Set(vtkInformationIntegerVectorKey* key, const int* value, int length);
210  void Set(vtkInformationIntegerVectorKey* key, int value1, int value2, int value3);
211  void Set(vtkInformationIntegerVectorKey* key, int value1, int value2, int value3, int value4,
212  int value5, int value6);
214  int Get(vtkInformationIntegerVectorKey* key, int idx);
215  void Get(vtkInformationIntegerVectorKey* key, int* value);
216  int Length(vtkInformationIntegerVectorKey* key);
217  void Remove(vtkInformationIntegerVectorKey* key);
218  int Has(vtkInformationIntegerVectorKey* key) VTK_FUTURE_CONST;
220 
222 
225  void Append(vtkInformationStringVectorKey* key, const char* value);
226  void Set(vtkInformationStringVectorKey* key, const char* value, int idx = 0);
227  void Append(vtkInformationStringVectorKey* key, const std::string& value);
228  void Set(vtkInformationStringVectorKey* key, const std::string& value, int idx = 0);
229  const char* Get(vtkInformationStringVectorKey* key, int idx = 0);
230  int Length(vtkInformationStringVectorKey* key);
231  void Remove(vtkInformationStringVectorKey* key);
232  int Has(vtkInformationStringVectorKey* key) VTK_FUTURE_CONST;
234 
236 
239  void Set(vtkInformationIntegerPointerKey* key, int* value, int length);
241  void Get(vtkInformationIntegerPointerKey* key, int* value);
243  void Remove(vtkInformationIntegerPointerKey* key);
244  int Has(vtkInformationIntegerPointerKey* key) VTK_FUTURE_CONST;
246 
248 
251  void Set(vtkInformationUnsignedLongKey* key, unsigned long value);
252  unsigned long Get(vtkInformationUnsignedLongKey* key);
253  void Remove(vtkInformationUnsignedLongKey* key);
254  int Has(vtkInformationUnsignedLongKey* key) VTK_FUTURE_CONST;
256 
258 
261  void Append(vtkInformationDoubleVectorKey* key, double value);
262  void Set(vtkInformationDoubleVectorKey* key, const double* value, int length);
263  void Set(vtkInformationDoubleVectorKey* key, double value1, double value2, double value3);
264  void Set(vtkInformationDoubleVectorKey* key, double value1, double value2, double value3,
265  double value4, double value5, double value6);
266  double* Get(vtkInformationDoubleVectorKey* key);
267  double Get(vtkInformationDoubleVectorKey* key, int idx);
268  void Get(vtkInformationDoubleVectorKey* key, double* value);
269  int Length(vtkInformationDoubleVectorKey* key);
270  void Remove(vtkInformationDoubleVectorKey* key);
271  int Has(vtkInformationDoubleVectorKey* key) VTK_FUTURE_CONST;
273 
275 
278  void Append(vtkInformationVariantVectorKey* key, const vtkVariant& value);
279  void Set(vtkInformationVariantVectorKey* key, const vtkVariant* value, int length);
280  void Set(vtkInformationVariantVectorKey* key, const vtkVariant& value1, const vtkVariant& value2,
281  const vtkVariant& value3);
282  void Set(vtkInformationVariantVectorKey* key, const vtkVariant& value1, const vtkVariant& value2,
283  const vtkVariant& value3, const vtkVariant& value4, const vtkVariant& value5,
284  const vtkVariant& value6);
286  const vtkVariant& Get(vtkInformationVariantVectorKey* key, int idx);
288  int Length(vtkInformationVariantVectorKey* key);
289  void Remove(vtkInformationVariantVectorKey* key);
290  int Has(vtkInformationVariantVectorKey* key) VTK_FUTURE_CONST;
292 
294 
304  int Length(vtkInformationKeyVectorKey* key);
305  void Remove(vtkInformationKeyVectorKey* key);
306  int Has(vtkInformationKeyVectorKey* key) VTK_FUTURE_CONST;
308 
309  // Provide extra overloads of this method to avoid requiring user
310  // code to include the headers for these key types. Avoid wrapping
311  // them because the original method can be called from the wrappers
312  // anyway and this causes a python help string to be too long.
313 
325 
337 
339 
342  void Set(vtkInformationStringKey* key, const char*);
343  void Set(vtkInformationStringKey* key, const std::string&);
344  const char* Get(vtkInformationStringKey* key);
345  void Remove(vtkInformationStringKey* key);
346  int Has(vtkInformationStringKey* key) VTK_FUTURE_CONST;
348 
350 
355  void Remove(vtkInformationInformationKey* key);
356  int Has(vtkInformationInformationKey* key) VTK_FUTURE_CONST;
358 
360 
366  int Has(vtkInformationInformationVectorKey* key) VTK_FUTURE_CONST;
368 
370 
375  void Remove(vtkInformationObjectBaseKey* key);
376  int Has(vtkInformationObjectBaseKey* key) VTK_FUTURE_CONST;
378 
380 
384  void Set(vtkInformationObjectBaseVectorKey* key, vtkObjectBase* value, int idx = 0);
388  void Remove(vtkInformationObjectBaseVectorKey* key, vtkObjectBase* objectToRemove);
389  void Remove(vtkInformationObjectBaseVectorKey* key, int indexToRemove);
390  int Has(vtkInformationObjectBaseVectorKey* key) VTK_FUTURE_CONST;
392 
394 
397  void Set(vtkInformationDataObjectKey* key, vtkDataObject VTK_WRAP_EXTERN*);
398  vtkDataObject VTK_WRAP_EXTERN* Get(vtkInformationDataObjectKey* key);
399  void Remove(vtkInformationDataObjectKey* key);
400  int Has(vtkInformationDataObjectKey* key) VTK_FUTURE_CONST;
402 
404 
417  static vtkInformationKey* GetKey(vtkInformationKey* key);
422 
424 
427  bool UsesGarbageCollector() const override { return true; }
429 
431 
434  void SetRequest(vtkInformationRequestKey* request);
435  vtkInformationRequestKey* GetRequest() VTK_FUTURE_CONST;
437 
438 protected:
439  vtkInformation();
440  ~vtkInformation() override;
441 
442  // Get/Set a map entry directly through the vtkObjectBase instance
443  // representing the value. Used internally to manage the map.
444  void SetAsObjectBase(vtkInformationKey* key, vtkObjectBase* value);
445  const vtkObjectBase* GetAsObjectBase(const vtkInformationKey* key) const;
446  vtkObjectBase* GetAsObjectBase(vtkInformationKey* key);
447 
448  // Internal implementation details.
450 
451  // Garbage collection support.
452  void ReportReferences(vtkGarbageCollector*) override;
453 
454  // Report the object associated with the given key to the collector.
455  void ReportAsObjectBase(vtkInformationKey* key, vtkGarbageCollector* collector);
456 
457 private:
458  friend class vtkInformationKeyToInformationFriendship;
460 
461  vtkInformation(const vtkInformation&) = delete;
462  void operator=(const vtkInformation&) = delete;
463  vtkInformationRequestKey* Request;
464 };
465 
466 VTK_ABI_NAMESPACE_END
467 #endif
Key for unsigned long values in vtkInformation.
abstract base class for most VTK objects
Definition: vtkObject.h:52
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.
internal structure for vtkInformation
int vtkIdType
Definition: vtkType.h:363
Superclass for all pipeline executives in VTK.
Definition: vtkExecutive.h:39
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.
#define VTK_MARSHALMANUAL
a simple class to control print indentation
Definition: vtkIndent.h:28
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:68
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:55
Key for vtkIdType values in vtkInformation.
Key for vtkExecutive/Port value pairs.