vtkTypeInt16Array.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkTypedArray.h.in
5 
6  Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
7  All rights reserved.
8  See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
9 
10  This software is distributed WITHOUT ANY WARRANTY; without even
11  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
12  PURPOSE. See the above copyright notice for more information.
13 
14 =========================================================================*/
15 // .NAME vtkTypeInt16Array - dynamic, self-adjusting array of vtkTypeInt16
16 // .SECTION Description
17 // vtkTypeInt16Array is an array of values of type vtkTypeInt16. It
18 // provides methods for insertion and retrieval of values and will
19 // automatically resize itself to hold new data.
20 //
21 // This array should be preferred for data of type Int16 as this
22 // array will use the correct underlying datatype based on the desired number of bits
23 // and the current platform. The superclass of this type will change depending on the
24 // machine and compiler in use so that the data contained always uses the proper type.
25 
26 #ifndef vtkTypeInt16Array_h
27 #define vtkTypeInt16Array_h
28 
29 #include "vtkCommonCoreModule.h" // For export macro
30 #include "vtkType.h" // For native type selections.
31 
32 #if VTK_TYPE_INT16 == VTK_SHORT
33 # include "vtkShortArray.h"
34 # define vtkTypeArrayBase vtkShortArray
35 #endif
36 
38 {
39 public:
40  static vtkTypeInt16Array* New();
42  void PrintSelf(ostream& os, vtkIndent indent) override;
43 
44  // Description:
45  // A faster alternative to SafeDownCast for downcasting vtkAbstractArrays.
47  {
48  return static_cast<vtkTypeInt16Array*>(Superclass::FastDownCast(source));
49  }
50 
51 protected:
53  ~vtkTypeInt16Array() override;
54 
55 private:
56  vtkTypeInt16Array(const vtkTypeInt16Array&) = delete;
57  void operator=(const vtkTypeInt16Array&) = delete;
58 };
59 
60 // Define vtkArrayDownCast implementation:
62 
63 #undef vtkTypeArrayBase
64 
65 #endif
#define vtkTypeArrayBase
#define VTKCOMMONCORE_EXPORT
static vtkTypeInt16Array * FastDownCast(vtkAbstractArray *source)
vtkArrayDownCast_FastCastMacro(vtkTypeInt16Array)