|  | VTK
    9.0.1
    | 
 
 
 
Go to the documentation of this file.
   33 template <
class ScalarTypeT>
 
   61   void SetFreeFunction(
bool noFreeFunction, 
void (*deleteFunction)(
void*) = free);
 
   95   void operator=(
const vtkBuffer&) = 
delete;
 
   98 template <
class ScalarT>
 
  105 template <
typename ScalarT>
 
  108   if (this->Pointer != array)
 
  110     if (this->DeleteFunction)
 
  112       this->DeleteFunction(this->Pointer);
 
  114     this->Pointer = array;
 
  119 template <
typename ScalarT>
 
  124     this->DeleteFunction = 
nullptr;
 
  128     this->DeleteFunction = deleteFunction;
 
  133 template <
typename ScalarT>
 
  137   this->SetBuffer(
nullptr, 0);
 
  143       this->SetBuffer(newArray, 
size);
 
  144       this->DeleteFunction = free;
 
  153 template <
typename ScalarT>
 
  158     return this->Allocate(0);
 
  161   if (this->Pointer && this->DeleteFunction != free)
 
  168     std::copy(this->Pointer, this->Pointer + std::min(this->Size, newsize), newArray);
 
  170     this->SetBuffer(newArray, newsize);
 
  171     this->DeleteFunction = free;
 
  183     this->Pointer = newArray;
 
  184     this->Size = newsize;
 
  
void SetBuffer(ScalarType *array, vtkIdType size)
Set the memory buffer that this vtkBuffer object will manage.
void(* DeleteFunction)(void *)
abstract base class for most VTK objects
internal storage class used by vtkSOADataArrayTemplate, vtkAOSDataArrayTemplate, and others.
bool Allocate(vtkIdType size)
Allocate a new buffer that holds size elements.
static vtkBuffer< ScalarTypeT > * New()
bool Reallocate(vtkIdType newsize)
Allocate a new buffer that holds newsize elements.
vtkIdType GetSize() const
Return the number of elements the current buffer can hold.
void SetFreeFunction(bool noFreeFunction, void(*deleteFunction)(void *)=free)
Set the free function to be used when releasing this object.
#define VTK_STANDARD_NEW_BODY(thisClass)
ScalarType * GetBuffer()
Access the buffer as a scalar pointer.
vtkTemplateTypeMacro(vtkBuffer< ScalarTypeT >, vtkObject)
const ScalarType * GetBuffer() const