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 121 of file RVec.hxx.

Public Types

using Size_T = int32_t
 

Public Member Functions

size_t capacity () const noexcept
 
R__RVEC_NODISCARD bool empty () const
 
void set_size (size_t N)
 Set the array size to N, which the current array must have enough capacity for.
 
void shrink_to_fit ()
 
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 true, 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 125 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 139 of file RVec.hxx.

Member Function Documentation

◆ capacity()

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

Definition at line 158 of file RVec.hxx.

◆ empty()

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

Definition at line 160 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 154 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 171 of file RVec.hxx.

◆ shrink_to_fit()

void ROOT::Internal::VecOps::SmallVectorBase::shrink_to_fit ( )
inline

Definition at line 182 of file RVec.hxx.

◆ size()

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

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

Member Data Documentation

◆ fBeginX

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

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

◆ fSize

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

Always >= 0.

Definition at line 131 of file RVec.hxx.

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

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