------------------------------------------------------------------------------
| 60 | |
| 61 | //------------------------------------------------------------------------------ |
| 62 | vtkInformationVector** vtkExecutiveInternals::GetInputInformation(int newNumberOfPorts) |
| 63 | { |
| 64 | // Adjust the number of vectors. |
| 65 | int oldNumberOfPorts = static_cast<int>(this->InputInformation.size()); |
| 66 | if (newNumberOfPorts > oldNumberOfPorts) |
| 67 | { |
| 68 | // Create new vectors. |
| 69 | this->InputInformation.resize(newNumberOfPorts, nullptr); |
| 70 | for (int i = oldNumberOfPorts; i < newNumberOfPorts; ++i) |
| 71 | { |
| 72 | this->InputInformation[i] = vtkInformationVector::New(); |
| 73 | } |
| 74 | } |
| 75 | else if (newNumberOfPorts < oldNumberOfPorts) |
| 76 | { |
| 77 | // Delete old vectors. |
| 78 | for (int i = newNumberOfPorts; i < oldNumberOfPorts; ++i) |
| 79 | { |
| 80 | if (vtkInformationVector* v = this->InputInformation[i]) |
| 81 | { |
| 82 | // Set the pointer to nullptr first to avoid reporting of the |
| 83 | // entry if deleting the vector causes a garbage collection |
| 84 | // reference walk. |
| 85 | this->InputInformation[i] = nullptr; |
| 86 | v->Delete(); |
| 87 | } |
| 88 | } |
| 89 | this->InputInformation.resize(newNumberOfPorts); |
| 90 | } |
| 91 | |
| 92 | // Return the array of information vector pointers. |
| 93 | if (newNumberOfPorts > 0) |
| 94 | { |
| 95 | return this->InputInformation.data(); |
| 96 | } |
| 97 | else |
| 98 | { |
| 99 | return nullptr; |
| 100 | } |
| 101 | } |
| 102 | |
| 103 | //------------------------------------------------------------------------------ |
| 104 | vtkExecutive::vtkExecutive() |
no test coverage detected