VTK  9.3.20240419
vtkInformationObjectBaseVectorKey.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
13 #ifndef vtkInformationObjectBaseVectorKey_h
14 #define vtkInformationObjectBaseVectorKey_h
15 
16 #include "vtkCommonCoreModule.h" // For export macro
17 #include "vtkCommonInformationKeyManager.h" // Manage instances of this type.
18 #include "vtkInformationKey.h"
19 
20 VTK_ABI_NAMESPACE_BEGIN
21 class vtkInformationObjectBaseVectorValue;
22 
23 class VTKCOMMONCORE_EXPORT vtkInformationObjectBaseVectorKey : public vtkInformationKey
24 {
25 public:
27  void PrintSelf(ostream& os, vtkIndent indent) override;
29 
38  const char* name, const char* location, const char* requiredClass = nullptr);
39  //
42 
50  const char* name, const char* location, const char* requiredClass = nullptr)
51  {
52  return new vtkInformationObjectBaseVectorKey(name, location, requiredClass);
53  }
54 
59 
65 
70  int Length(vtkInformation* info) { return this->Size(info); }
71 
76 
82 
84 
89  void Remove(vtkInformation* info, int idx);
90  using Superclass::Remove; // Don't hide base class methods
92 
98  void SetRange(vtkInformation* info, vtkObjectBase** source, int from, int to, int n);
99 
105  void GetRange(vtkInformation* info, vtkObjectBase** dest, int from, int to, int n);
106 
111 
112  // _escription:
113  // Get a pointer to the first vtkObjectBase in the vector. We are
114  // uysing a vector of smart pointers so this is not easy to
115  // implement.
116  // vtkObjectBase **Get(vtkInformation* info);
117 
124 
128  void Print(ostream& os, vtkInformation* info) override;
129 
130 protected:
131  // The type required of all objects stored with this key.
132  const char* RequiredClass;
133 
134 private:
139  void CreateObjectBase();
144  bool ValidateDerivedType(vtkInformation* info, vtkObjectBase* aValue);
150  vtkInformationObjectBaseVectorValue* GetObjectBaseVector(vtkInformation* info);
151 
152  //
154  void operator=(const vtkInformationObjectBaseVectorKey&) = delete;
155 };
156 
157 VTK_ABI_NAMESPACE_END
158 #endif
a simple class to control print indentation
Definition: vtkIndent.h:108
Superclass for vtkInformation keys.
Key for vtkObjectBase vector values.
void ShallowCopy(vtkInformation *source, vtkInformation *dest) override
Copy the entry associated with this key from one information object to another.
void Remove(vtkInformation *info, int idx)
Remove all instances of val from the list.
void GetRange(vtkInformation *info, vtkObjectBase **dest, int from, int to, int n)
Copy n values from the range in this vector defined by [from from+n-1] into the range in the destinat...
void Resize(vtkInformation *info, int size)
Resize (extend) the vector to hold size objects.
void Clear(vtkInformation *info)
Clear the vector.
vtkInformationObjectBaseVectorKey(const char *name, const char *location, const char *requiredClass=nullptr)
The name of the static instance and the class in which it is defined(location) should be passed to th...
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkObjectBase * Get(vtkInformation *info, int idx)
Get the vtkObjectBase at a specific location in the vector.
int Size(vtkInformation *info)
Get the vector's length.
void Append(vtkInformation *info, vtkObjectBase *value)
Put the value on the back of the vector, with ref counting.
~vtkInformationObjectBaseVectorKey() override
The name of the static instance and the class in which it is defined(location) should be passed to th...
void Remove(vtkInformation *info, vtkObjectBase *val)
Remove all instances of val from the list.
void Print(ostream &os, vtkInformation *info) override
Print the key's value in an information object to a stream.
void Set(vtkInformation *info, vtkObjectBase *value, int i)
Set element i of the vector to value.
static vtkInformationObjectBaseVectorKey * MakeKey(const char *name, const char *location, const char *requiredClass=nullptr)
This method simply returns a new vtkInformationObjectBaseVectorKey, given a name, location and option...
void SetRange(vtkInformation *info, vtkObjectBase **source, int from, int to, int n)
Copy n values from the range in source defined by [from from+n-1] into the range in this vector defin...
Store vtkAlgorithm input/output information.
abstract base class for most VTK objects
Definition: vtkObjectBase.h:84
@ location
Definition: vtkX3D.h:406
@ info
Definition: vtkX3D.h:376
@ value
Definition: vtkX3D.h:220
@ name
Definition: vtkX3D.h:219
@ size
Definition: vtkX3D.h:253
boost::graph_traits< vtkGraph * >::vertex_descriptor source(boost::graph_traits< vtkGraph * >::edge_descriptor e, vtkGraph *)
#define VTK_NEWINSTANCE