Logo ROOT  
Reference Guide
ROOT::Internal::VecOps::SmallVectorTemplateBase< T, bool > Class Template Reference

template<typename T, bool = (std::is_trivially_copy_constructible<T>::value) && (std::is_trivially_move_constructible<T>::value) && std::is_trivially_destructible<T>::value>
class ROOT::Internal::VecOps::SmallVectorTemplateBase< T, bool >

SmallVectorTemplateBase<TriviallyCopyable = false> - This is where we put method implementations that are designed to work with non-trivial T's.

We approximate is_trivially_copyable with trivial move/copy construction and trivial destruction. While the standard doesn't specify that you're allowed copy these types with memcpy, there is no way for the type to observe this. This catches the important case of std::pair<POD, POD>, which is not trivially assignable.

Definition at line 310 of file RVec.hxx.

Public Member Functions

void pop_back ()
 
void push_back (const T &Elt)
 
void push_back (T &&Elt)
 
- Public Member Functions inherited from ROOT::Internal::VecOps::SmallVectorTemplateCommon< T >
reference back ()
 
const_reference back () const
 
const_iterator begin () const noexcept
 
iterator begin () noexcept
 
size_t capacity () const noexcept
 
size_t capacity_in_bytes () const
 
const_iterator cbegin () const noexcept
 
const_iterator cend () const noexcept
 
const_reverse_iterator crbegin () const noexcept
 
const_reverse_iterator crend () const noexcept
 
const_pointer data () const noexcept
 Return a pointer to the vector's buffer, even if empty(). More...
 
pointer data () noexcept
 Return a pointer to the vector's buffer, even if empty(). More...
 
R__RVEC_NODISCARD bool empty () const
 
const_iterator end () const noexcept
 
iterator end () noexcept
 
reference front ()
 
const_reference front () const
 
size_type max_size () const noexcept
 
const_reverse_iterator rbegin () const noexcept
 
reverse_iterator rbegin () noexcept
 
const_reverse_iterator rend () const noexcept
 
reverse_iterator rend () noexcept
 
size_t size () const
 
size_type size_in_bytes () const
 
- Public Member Functions inherited from ROOT::Internal::VecOps::SmallVectorBase
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. More...
 
size_t size () const
 

Protected Member Functions

 SmallVectorTemplateBase (size_t Size)
 
void grow (size_t MinSize=0)
 Grow the allocated memory (without initializing new elements), doubling the size of the allocated memory. More...
 
- Protected Member Functions inherited from ROOT::Internal::VecOps::SmallVectorTemplateCommon< T >
 SmallVectorTemplateCommon (size_t Size)
 
void grow_pod (size_t MinSize, size_t TSize)
 
bool isSmall () const
 Return true if this is a smallvector which has not had dynamic memory allocated for it. More...
 
void resetToSmall ()
 Put this vector in a state of being small. More...
 
- Protected Member Functions inherited from ROOT::Internal::VecOps::SmallVectorBase
 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 destroy_range (T *S, T *E)
 
template<typename It1 , typename It2 >
static void uninitialized_copy (It1 I, It1 E, It2 Dest)
 Copy the range [I, E) onto the uninitialized memory starting with "Dest", constructing elements as needed. More...
 
template<typename It1 , typename It2 >
static void uninitialized_move (It1 I, It1 E, It2 Dest)
 Move the range [I, E) into the uninitialized memory starting with "Dest", constructing elements as needed. More...
 
- Static Protected Member Functions inherited from ROOT::Internal::VecOps::SmallVectorBase
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...
 

Additional Inherited Members

- Public Types inherited from ROOT::Internal::VecOps::SmallVectorTemplateCommon< T >
using const_iterator = const T *
 
using const_pointer = const T *
 
using const_reference = const T &
 
using const_reverse_iterator = std::reverse_iterator< const_iterator >
 
using difference_type = ptrdiff_t
 
using iterator = T *
 
using pointer = T *
 
using reference = T &
 
using reverse_iterator = std::reverse_iterator< iterator >
 
using size_type = size_t
 
using value_type = T
 
- Public Types inherited from ROOT::Internal::VecOps::SmallVectorBase
using Size_T = int32_t
 
- Protected Attributes inherited from ROOT::Internal::VecOps::SmallVectorBase
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::SmallVectorTemplateBase< T, bool >:
[legend]

Constructor & Destructor Documentation

◆ SmallVectorTemplateBase()

template<typename T , bool = (std::is_trivially_copy_constructible<T>::value) && (std::is_trivially_move_constructible<T>::value) && std::is_trivially_destructible<T>::value>
ROOT::Internal::VecOps::SmallVectorTemplateBase< T, bool >::SmallVectorTemplateBase ( size_t  Size)
inlineprotected

Definition at line 312 of file RVec.hxx.

Member Function Documentation

◆ destroy_range()

template<typename T , bool = (std::is_trivially_copy_constructible<T>::value) && (std::is_trivially_move_constructible<T>::value) && std::is_trivially_destructible<T>::value>
static void ROOT::Internal::VecOps::SmallVectorTemplateBase< T, bool >::destroy_range ( T *  S,
T *  E 
)
inlinestaticprotected

Definition at line 314 of file RVec.hxx.

◆ grow()

template<typename T , bool = (std::is_trivially_copy_constructible<T>::value) && (std::is_trivially_move_constructible<T>::value) && std::is_trivially_destructible<T>::value>
void ROOT::Internal::VecOps::SmallVectorTemplateBase< T, bool >::grow ( size_t  MinSize = 0)
protected

Grow the allocated memory (without initializing new elements), doubling the size of the allocated memory.

Guarantees space for at least one more element, or MinSize more elements if specified.

◆ pop_back()

template<typename T , bool = (std::is_trivially_copy_constructible<T>::value) && (std::is_trivially_move_constructible<T>::value) && std::is_trivially_destructible<T>::value>
void ROOT::Internal::VecOps::SmallVectorTemplateBase< T, bool >::pop_back ( )
inline

Definition at line 360 of file RVec.hxx.

◆ push_back() [1/2]

template<typename T , bool = (std::is_trivially_copy_constructible<T>::value) && (std::is_trivially_move_constructible<T>::value) && std::is_trivially_destructible<T>::value>
void ROOT::Internal::VecOps::SmallVectorTemplateBase< T, bool >::push_back ( const T &  Elt)
inline

Definition at line 344 of file RVec.hxx.

◆ push_back() [2/2]

template<typename T , bool = (std::is_trivially_copy_constructible<T>::value) && (std::is_trivially_move_constructible<T>::value) && std::is_trivially_destructible<T>::value>
void ROOT::Internal::VecOps::SmallVectorTemplateBase< T, bool >::push_back ( T &&  Elt)
inline

Definition at line 352 of file RVec.hxx.

◆ uninitialized_copy()

template<typename T , bool = (std::is_trivially_copy_constructible<T>::value) && (std::is_trivially_move_constructible<T>::value) && std::is_trivially_destructible<T>::value>
template<typename It1 , typename It2 >
static void ROOT::Internal::VecOps::SmallVectorTemplateBase< T, bool >::uninitialized_copy ( It1  I,
It1  E,
It2  Dest 
)
inlinestaticprotected

Copy the range [I, E) onto the uninitialized memory starting with "Dest", constructing elements as needed.

Definition at line 333 of file RVec.hxx.

◆ uninitialized_move()

template<typename T , bool = (std::is_trivially_copy_constructible<T>::value) && (std::is_trivially_move_constructible<T>::value) && std::is_trivially_destructible<T>::value>
template<typename It1 , typename It2 >
static void ROOT::Internal::VecOps::SmallVectorTemplateBase< T, bool >::uninitialized_move ( It1  I,
It1  E,
It2  Dest 
)
inlinestaticprotected

Move the range [I, E) into the uninitialized memory starting with "Dest", constructing elements as needed.

Definition at line 325 of file RVec.hxx.


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