31 template <
class ScalarTypeT>
36 typedef ScalarTypeT ScalarType;
54 void (*deleteFunction)(
void*)=free);
93 void operator=(
const vtkBuffer&) VTK_DELETE_FUNCTION;
96 template <
class ScalarT>
103 template <
typename ScalarT>
122 template <
typename ScalarT>
129 ScalarType* newArray =
130 static_cast<ScalarType*
>(malloc(size *
sizeof(ScalarType)));
133 this->
SetBuffer(newArray, size,
false, free);
142 template <
typename ScalarT>
145 if (newsize == 0) {
return this->
Allocate(0); }
150 ScalarType* newArray =
151 static_cast<ScalarType*
>(malloc(newsize *
sizeof(ScalarType)));
159 this->
SetBuffer(newArray, newsize,
false, free);
165 ScalarType* newArray =
static_cast<ScalarType*
>(
166 realloc(this->
Pointer, newsize *
sizeof(ScalarType)));
172 this->
Size = newsize;
static vtkBuffer< ScalarTypeT > * New()
vtkIdType GetSize() const
Return the number of elements the current buffer can hold.
const ScalarType * GetBuffer() const
abstract base class for most VTK objects
vtkTemplateTypeMacro(vtkBuffer< ScalarTypeT >, vtkObject) typedef ScalarTypeT ScalarType
void SetBuffer(ScalarType *array, vtkIdType size, bool save=false, void(*deleteFunction)(void *)=free)
Set the memory buffer that this vtkBuffer object will manage.
internal storage class used by vtkSOADataArrayTemplate, vtkAOSDataArrayTemplate, and others...
ScalarType * GetBuffer()
Access the buffer as a scalar pointer.
bool Reallocate(vtkIdType newsize)
Allocate a new buffer that holds newsize elements.
void(* DeleteFunction)(void *)
bool Allocate(vtkIdType size)
Allocate a new buffer that holds size elements.
#define VTK_STANDARD_NEW_BODY(thisClass)
void save(Archiver &ar, const vtkUnicodeString &str, const unsigned int vtkNotUsed(version))