vtkTypeUInt16Array.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
3 // .NAME vtkTypeUInt16Array - dynamic, self-adjusting array of vtkTypeUInt16
4 // .SECTION Description
5 // vtkTypeUInt16Array is an array of values of type vtkTypeUInt16. It
6 // provides methods for insertion and retrieval of values and will
7 // automatically resize itself to hold new data.
8 //
9 // This array should be preferred for data of type UInt16 as this
10 // array will use the correct underlying datatype based on the desired number of bits
11 // and the current platform. The superclass of this type will change depending on the
12 // machine and compiler in use so that the data contained always uses the proper type.
13 
14 #ifndef vtkTypeUInt16Array_h
15 #define vtkTypeUInt16Array_h
16 
17 #include "vtkCommonCoreModule.h" // For export macro
18 #include "vtkType.h" // For native type selections.
19 
20 #if VTK_TYPE_UINT16 == VTK_UNSIGNED_SHORT
21 # include "vtkUnsignedShortArray.h"
22 # define vtkTypeArrayBase vtkUnsignedShortArray
23 #endif
24 
25 
27 
29 {
30 public:
31  static vtkTypeUInt16Array* New();
33  void PrintSelf(ostream& os, vtkIndent indent) override;
34 
35  // Description:
36  // A faster alternative to SafeDownCast for downcasting vtkAbstractArrays.
38  {
39  return static_cast<vtkTypeUInt16Array*>(Superclass::FastDownCast(source));
40  }
41 
42 protected:
44  ~vtkTypeUInt16Array() override;
45 
46 private:
47  vtkTypeUInt16Array(const vtkTypeUInt16Array&) = delete;
48  void operator=(const vtkTypeUInt16Array&) = delete;
49 };
50 
51 // Define vtkArrayDownCast implementation:
53 
55 
56 #undef vtkTypeArrayBase
57 
58 #endif
59 /* VTK-HeaderTest-Exclude: INCLUDES */
#define vtkTypeArrayBase
vtkArrayDownCast_FastCastMacro(vtkTypeUInt16Array)
#define VTKCOMMONCORE_EXPORT
#define VTK_ABI_NAMESPACE_END
#define VTK_ABI_NAMESPACE_BEGIN
static vtkTypeUInt16Array * FastDownCast(vtkAbstractArray *source)