Logo ROOT  
Reference Guide
ROOT::Internal::VecOps::SmallVectorBase Class Reference

This is all the stuff common to all SmallVectors.

Definition at line 120 of file RVec.hxx.

Public Types

using Size_T = int32_t
 

Public Member Functions

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

Protected Member Functions

 SmallVectorBase ()=delete
 
 SmallVectorBase (void *FirstEl, size_t TotalCapacity)
 
void grow_pod (void *FirstEl, size_t MinSize, 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. More...
 
bool Owns () const
 If true, the RVec is in "memory adoption" mode, i.e. it is acting as a view on a memory buffer it does not own. More...
 

Static Protected Member Functions

static void report_at_maximum_capacity ()
 Report that this vector is already at maximum capacity. More...
 
static void report_size_overflow (size_t MinSize)
 Report that MinSize doesn't fit into this vector's size type. More...
 
static constexpr size_t SizeTypeMax ()
 The maximum value of the Size_T used. More...
 

Protected Attributes

voidfBeginX
 
Size_T fCapacity
 Always >= -1. fCapacity == -1 indicates the RVec is in "memory adoption" mode. More...
 
Size_T fSize = 0
 Always >= 0. More...
 

#include <ROOT/RVec.hxx>

Inheritance diagram for ROOT::Internal::VecOps::SmallVectorBase:
[legend]

Member Typedef Documentation

◆ Size_T

Definition at line 124 of file RVec.hxx.

Constructor & Destructor Documentation

◆ SmallVectorBase() [1/2]

ROOT::Internal::VecOps::SmallVectorBase::SmallVectorBase ( )
protecteddelete

◆ SmallVectorBase() [2/2]

ROOT::Internal::VecOps::SmallVectorBase::SmallVectorBase ( void FirstEl,
size_t  TotalCapacity 
)
inlineprotected

Definition at line 138 of file RVec.hxx.

Member Function Documentation

◆ capacity()

size_t ROOT::Internal::VecOps::SmallVectorBase::capacity ( ) const
inlinenoexcept

Definition at line 157 of file RVec.hxx.

◆ empty()

bool ROOT::Internal::VecOps::SmallVectorBase::empty ( ) const
inline

Definition at line 159 of file RVec.hxx.

◆ grow_pod()

void ROOT::Internal::VecOps::SmallVectorBase::grow_pod ( void FirstEl,
size_t  MinSize,
size_t  TSize 
)
protected

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.

This function will report a fatal error if it cannot increase capacity.

Definition at line 51 of file RVec.cxx.

◆ Owns()

bool ROOT::Internal::VecOps::SmallVectorBase::Owns ( ) const
inlineprotected

If true, the RVec is in "memory adoption" mode, i.e. it is acting as a view on a memory buffer it does not own.

Definition at line 153 of file RVec.hxx.

◆ report_at_maximum_capacity()

void ROOT::Internal::VecOps::SmallVectorBase::report_at_maximum_capacity ( )
staticprotected

Report that this vector is already at maximum capacity.

Throws std::length_error or calls report_fatal_error.

Definition at line 44 of file RVec.cxx.

◆ report_size_overflow()

void ROOT::Internal::VecOps::SmallVectorBase::report_size_overflow ( size_t  MinSize)
staticprotected

Report that MinSize doesn't fit into this vector's size type.

Throws std::length_error or calls report_fatal_error.

Definition at line 37 of file RVec.cxx.

◆ set_size()

void ROOT::Internal::VecOps::SmallVectorBase::set_size ( size_t  N)
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.

Definition at line 170 of file RVec.hxx.

◆ size()

size_t ROOT::Internal::VecOps::SmallVectorBase::size ( ) const
inline

Definition at line 156 of file RVec.hxx.

◆ SizeTypeMax()

static constexpr size_t ROOT::Internal::VecOps::SmallVectorBase::SizeTypeMax ( )
inlinestaticconstexprprotected

The maximum value of the Size_T used.

Definition at line 135 of file RVec.hxx.

Member Data Documentation

◆ fBeginX

void* ROOT::Internal::VecOps::SmallVectorBase::fBeginX
protected

Definition at line 127 of file RVec.hxx.

◆ fCapacity

Size_T ROOT::Internal::VecOps::SmallVectorBase::fCapacity
protected

Always >= -1. fCapacity == -1 indicates the RVec is in "memory adoption" mode.

Definition at line 132 of file RVec.hxx.

◆ fSize

Size_T ROOT::Internal::VecOps::SmallVectorBase::fSize = 0
protected

Always >= 0.

Definition at line 130 of file RVec.hxx.

Libraries for ROOT::Internal::VecOps::SmallVectorBase:
[legend]

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