Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
ROOT::Internal::VecOps::SmallVectorBase Class Reference

This is all the stuff common to all SmallVectors.

Definition at line 138 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.
 
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.
 
bool Owns () const
 If false, the RVec is in "memory adoption" mode, i.e. it is acting as a view on a memory buffer it does not own.
 

Static Protected Member Functions

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

Protected Attributes

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

#include <ROOT/RVec.hxx>

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

Member Typedef Documentation

◆ Size_T

Definition at line 142 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 156 of file RVec.hxx.

Member Function Documentation

◆ capacity()

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

Definition at line 175 of file RVec.hxx.

◆ empty()

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

Definition at line 177 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 false, 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 171 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 188 of file RVec.hxx.

◆ size()

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

Definition at line 174 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 153 of file RVec.hxx.

Member Data Documentation

◆ fBeginX

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

Definition at line 145 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 150 of file RVec.hxx.

◆ fSize

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

Always >= 0.

Definition at line 148 of file RVec.hxx.

Libraries for ROOT::Internal::VecOps::SmallVectorBase:

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