ITK  4.13.0
Insight Segmentation and Registration Toolkit
Public Member Functions | List of all members
itk::VariableLengthVector< TValue >::DontShrinkToFit Struct Reference

#include <itkVariableLengthVector.h>

+ Inheritance diagram for itk::VariableLengthVector< TValue >::DontShrinkToFit:
+ Collaboration diagram for itk::VariableLengthVector< TValue >::DontShrinkToFit:

Detailed Description

template<typename TValue>
struct itk::VariableLengthVector< TValue >::DontShrinkToFit

VariableLengthVector Allocation Policy: reallocate memory only when size increases. This policy, when used from VariableLengthVector::SetSize(), will reallocate the internal buffer only if the new size requested for the VariableLengthVector increases.

Returns
whether newSize is bigger than oldSize
Warning
Unlike classes like std::vector<>, VariableLengthVector has no capacity concept: the size of the VariableLengthVector is its capacity. However, this will help a class without capacity to emulate one. The consequence is that reallocations will occur with scenarios such as the following:
v.SetSize(42);
v.SetSize(12); // no reallocation
v.SetSize(42); // pointless reallocation (given this policy)
See Also
itk::VariableLengthVector::SetSize
AlwaysReallocate
NeverReallocate
ShrinkToFit

Definition at line 216 of file itkVariableLengthVector.h.

Public Member Functions

bool operator() (unsigned int newSize, unsigned int oldSize) const
 

Member Function Documentation

template<typename TValue>
bool itk::VariableLengthVector< TValue >::DontShrinkToFit::operator() ( unsigned int  newSize,
unsigned int  oldSize 
) const
inline

Definition at line 218 of file itkVariableLengthVector.h.


The documentation for this struct was generated from the following file: