WPILibC++  2020.3.2-60-g3011ebe
wpi::SmallVectorBase Class Reference

This is all the non-templated stuff common to all SmallVectors. More...

#include <SmallVector.h>

Inheritance diagram for wpi::SmallVectorBase:
wpi::SmallVectorTemplateCommon< char > wpi::SmallVectorTemplateCommon< frc2::Command * > wpi::SmallVectorTemplateCommon< frc2::Subsystem * > wpi::SmallVectorTemplateCommon< nt::NetworkTableEntry > wpi::SmallVectorTemplateCommon< std::pair< KeyT, ValueT > > wpi::SmallVectorTemplateCommon< std::string > wpi::SmallVectorTemplateCommon< std::unique_ptr< frc2::Command > > wpi::SmallVectorTemplateCommon< T > wpi::SmallVectorTemplateCommon< uint8_t > wpi::SmallVectorTemplateCommon< wpi::SmallString< 16 > > wpi::SmallVectorTemplateCommon< wpi::uv::Buffer > wpi::SmallVectorTemplateCommon< T, typename >

Public Member Functions

LLVM_ATTRIBUTE_ALWAYS_INLINE size_t size () const
 
LLVM_ATTRIBUTE_ALWAYS_INLINE size_t capacity () const
 
LLVM_NODISCARD bool empty () const
 
void set_size (size_t Size)
 Set the array size to N, which the current array must have enough capacity for. More...
 

Protected Member Functions

 SmallVectorBase (void *FirstEl, size_t Capacity)
 
void grow_pod (void *FirstEl, size_t MinCapacity, size_t TSize)
 This is an implementation of the grow() method which only works on POD-like data types and is out of line to reduce code duplication.
 

Protected Attributes

void * BeginX
 
unsigned Size = 0
 
unsigned Capacity
 

Detailed Description

This is all the non-templated stuff common to all SmallVectors.

Member Function Documentation

◆ set_size()

void wpi::SmallVectorBase::set_size ( size_t  Size)
inline

Set the array size to N, which the current array must have enough capacity for.

This does not construct or destroy any elements in the vector.

Clients can use this in conjunction with capacity() to write past the end of the buffer when they know that more elements are available, and only update the size later. This avoids the cost of value initializing elements which will only be overwritten.


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