EIC Software
Reference for
EIC
simulation and reconstruction software on GitHub
|
#include <acts/blob/sPHENIX/thirdparty/dfelibs/dfe/dfe_smallvector.hpp>
Classes | |
struct | AllocatedStorage |
Public Types | |
using | value_type = T |
using | size_type = std::size_t |
using | iterator = T * |
using | const_iterator = const T * |
Public Member Functions | |
SmallVector ()=default | |
~SmallVector () | |
value_type & | operator[] (size_type idx) |
const value_type & | operator[] (size_type idx) const |
iterator | begin () |
iterator | end () |
const_iterator | begin () const |
const_iterator | end () const |
bool | empty () const |
Return true if there are no elements in the vector. | |
size_type | size () const |
Return the number of elements in the vector. | |
size_type | capacity () const |
Return the number of elements that can be stored in the available memory. | |
void | clear () |
template<typename... Args> | |
iterator | emplace (const_iterator pos, Args &&...args) |
Construct an element directly before the given position in the vector. | |
template<typename... Args> | |
T & | emplace_back (Args &&...args) |
Construct an element at the back of the vector and return its reference. | |
Private Member Functions | |
AllocatedStorage | allocate_storage (size_type capacity) |
void | destruct_inplace () |
void | destruct_deallocate_onheap () |
Private Attributes | |
size_type | m_size = 0 |
union { | |
AllocatedStorage m_onheap | |
}; | |
Allocator | m_alloc |
An continous container that stores some elements in-place.
T | Stored element type |
N | Maximum number of elements stored in-place. |
Allocator | Allocator for elements of type T |
If the vector contains less or equal than N elements, they are stored in the vector itself without the need to allocate additional memory.
Supports access by index, iteration over elements, deleting all existing elements from the vector, and adding elements at a specified location or at the back.
Definition at line 47 of file dfe_smallvector.hpp.
View newest version in sPHENIX GitHub at line 47 of file dfe_smallvector.hpp
using dfe::SmallVector< T, N, Allocator >::const_iterator = const T* |
Definition at line 52 of file dfe_smallvector.hpp.
View newest version in sPHENIX GitHub at line 52 of file dfe_smallvector.hpp
using dfe::SmallVector< T, N, Allocator >::iterator = T* |
Definition at line 51 of file dfe_smallvector.hpp.
View newest version in sPHENIX GitHub at line 51 of file dfe_smallvector.hpp
using dfe::SmallVector< T, N, Allocator >::size_type = std::size_t |
Definition at line 50 of file dfe_smallvector.hpp.
View newest version in sPHENIX GitHub at line 50 of file dfe_smallvector.hpp
using dfe::SmallVector< T, N, Allocator >::value_type = T |
Definition at line 49 of file dfe_smallvector.hpp.
View newest version in sPHENIX GitHub at line 49 of file dfe_smallvector.hpp
|
default |
|
inline |
Definition at line 55 of file dfe_smallvector.hpp.
View newest version in sPHENIX GitHub at line 55 of file dfe_smallvector.hpp
References dfe::SmallVector< T, N, Allocator >::clear().
|
inlineprivate |
Definition at line 107 of file dfe_smallvector.hpp.
View newest version in sPHENIX GitHub at line 107 of file dfe_smallvector.hpp
References nanoflann::allocate(), dfe::SmallVector< T, N, Allocator >::capacity(), dfe::SmallVector< T, N, Allocator >::AllocatedStorage::capacity, dfe::SmallVector< T, N, Allocator >::AllocatedStorage::data, and Acts::UnitConstants::s.
Referenced by dfe::SmallVector< T, N, Allocator >::emplace().
|
inline |
Definition at line 158 of file dfe_smallvector.hpp.
View newest version in sPHENIX GitHub at line 158 of file dfe_smallvector.hpp
References dfe::SmallVector< T, N, Allocator >::AllocatedStorage::data, dfe::SmallVector< T, N, Allocator >::m_size, charm_jet_strange_helicity::N, and T.
Referenced by dfe::SmallVector< T, N, Allocator >::emplace(), and dfe::SmallVector< T, N, Allocator >::end().
|
inline |
Definition at line 164 of file dfe_smallvector.hpp.
View newest version in sPHENIX GitHub at line 164 of file dfe_smallvector.hpp
References dfe::SmallVector< T, N, Allocator >::AllocatedStorage::data, dfe::SmallVector< T, N, Allocator >::m_size, charm_jet_strange_helicity::N, and T.
|
inline |
Return the number of elements that can be stored in the available memory.
Definition at line 70 of file dfe_smallvector.hpp.
View newest version in sPHENIX GitHub at line 70 of file dfe_smallvector.hpp
References dfe::SmallVector< T, N, Allocator >::AllocatedStorage::capacity, dfe::SmallVector< T, N, Allocator >::m_onheap, dfe::SmallVector< T, N, Allocator >::m_size, and charm_jet_strange_helicity::N.
Referenced by dfe::SmallVector< T, N, Allocator >::allocate_storage(), and dfe::SmallVector< T, N, Allocator >::emplace().
|
inline |
Remove all elements.
This will release allocated memory if the vector contains more elements than can be stored in-place.
Definition at line 170 of file dfe_smallvector.hpp.
View newest version in sPHENIX GitHub at line 170 of file dfe_smallvector.hpp
References dfe::SmallVector< T, N, Allocator >::destruct_deallocate_onheap(), dfe::SmallVector< T, N, Allocator >::destruct_inplace(), dfe::SmallVector< T, N, Allocator >::m_size, and charm_jet_strange_helicity::N.
Referenced by dfe::SmallVector< T, N, Allocator >::~SmallVector().
|
inlineprivate |
Definition at line 127 of file dfe_smallvector.hpp.
View newest version in sPHENIX GitHub at line 127 of file dfe_smallvector.hpp
References dfe::SmallVector< T, N, Allocator >::AllocatedStorage::capacity, dfe::SmallVector< T, N, Allocator >::AllocatedStorage::data, dfe::SmallVector< T, N, Allocator >::end(), dfe::SmallVector< T, N, Allocator >::m_alloc, dfe::SmallVector< T, N, Allocator >::m_size, and T.
Referenced by dfe::SmallVector< T, N, Allocator >::clear(), and dfe::SmallVector< T, N, Allocator >::emplace().
|
inlineprivate |
Definition at line 117 of file dfe_smallvector.hpp.
View newest version in sPHENIX GitHub at line 117 of file dfe_smallvector.hpp
References dfe::SmallVector< T, N, Allocator >::end(), dfe::SmallVector< T, N, Allocator >::m_size, and T.
Referenced by dfe::SmallVector< T, N, Allocator >::clear(), and dfe::SmallVector< T, N, Allocator >::emplace().
SmallVector< T, N, Allocator >::iterator dfe::SmallVector< T, N, Allocator >::emplace | ( | const_iterator | pos, |
Args &&... | args | ||
) |
Construct an element directly before the given position in the vector.
Definition at line 182 of file dfe_smallvector.hpp.
View newest version in sPHENIX GitHub at line 182 of file dfe_smallvector.hpp
References dfe::SmallVector< T, N, Allocator >::allocate_storage(), charm_jet_coverage::args, dfe::SmallVector< T, N, Allocator >::begin(), dfe::SmallVector< T, N, Allocator >::capacity(), dfe::SmallVector< T, N, Allocator >::destruct_deallocate_onheap(), dfe::SmallVector< T, N, Allocator >::destruct_inplace(), Acts::UnitConstants::e, dfe::SmallVector< T, N, Allocator >::end(), dfe::SmallVector< T, N, Allocator >::m_alloc, dfe::SmallVector< T, N, Allocator >::m_size, charm_jet_strange_helicity::N, pos(), dfe::SmallVector< T, N, Allocator >::size(), T, charm_jet_tagging_optimization_study::target, and nlohmann::detail::void().
Referenced by dfe::SmallVector< T, N, Allocator >::emplace_back().
|
inline |
Construct an element at the back of the vector and return its reference.
Definition at line 239 of file dfe_smallvector.hpp.
View newest version in sPHENIX GitHub at line 239 of file dfe_smallvector.hpp
References charm_jet_coverage::args, dfe::SmallVector< T, N, Allocator >::emplace(), and dfe::SmallVector< T, N, Allocator >::end().
|
inline |
Return true if there are no elements in the vector.
Definition at line 66 of file dfe_smallvector.hpp.
View newest version in sPHENIX GitHub at line 66 of file dfe_smallvector.hpp
References dfe::SmallVector< T, N, Allocator >::m_size.
|
inline |
Definition at line 61 of file dfe_smallvector.hpp.
View newest version in sPHENIX GitHub at line 61 of file dfe_smallvector.hpp
References dfe::SmallVector< T, N, Allocator >::begin(), and dfe::SmallVector< T, N, Allocator >::m_size.
Referenced by dfe::SmallVector< T, N, Allocator >::destruct_deallocate_onheap(), dfe::SmallVector< T, N, Allocator >::destruct_inplace(), dfe::SmallVector< T, N, Allocator >::emplace(), and dfe::SmallVector< T, N, Allocator >::emplace_back().
|
inline |
Definition at line 63 of file dfe_smallvector.hpp.
View newest version in sPHENIX GitHub at line 63 of file dfe_smallvector.hpp
References dfe::SmallVector< T, N, Allocator >::begin(), and dfe::SmallVector< T, N, Allocator >::m_size.
|
inline |
Definition at line 139 of file dfe_smallvector.hpp.
View newest version in sPHENIX GitHub at line 139 of file dfe_smallvector.hpp
References dfe::SmallVector< T, N, Allocator >::AllocatedStorage::data, dfe::SmallVector< T, N, Allocator >::m_size, charm_jet_strange_helicity::N, and T.
|
inline |
Definition at line 148 of file dfe_smallvector.hpp.
View newest version in sPHENIX GitHub at line 148 of file dfe_smallvector.hpp
References dfe::SmallVector< T, N, Allocator >::AllocatedStorage::data, dfe::SmallVector< T, N, Allocator >::m_size, charm_jet_strange_helicity::N, and T.
|
inline |
Return the number of elements in the vector.
Definition at line 68 of file dfe_smallvector.hpp.
View newest version in sPHENIX GitHub at line 68 of file dfe_smallvector.hpp
References dfe::SmallVector< T, N, Allocator >::m_size.
Referenced by dfe::SmallVector< T, N, Allocator >::emplace().
union { ... } |
|
private |
Definition at line 100 of file dfe_smallvector.hpp.
View newest version in sPHENIX GitHub at line 100 of file dfe_smallvector.hpp
Referenced by dfe::SmallVector< T, N, Allocator >::destruct_deallocate_onheap(), and dfe::SmallVector< T, N, Allocator >::emplace().
AllocatedStorage dfe::SmallVector< T, N, Allocator >::m_onheap |
Definition at line 96 of file dfe_smallvector.hpp.
View newest version in sPHENIX GitHub at line 96 of file dfe_smallvector.hpp
Referenced by dfe::SmallVector< T, N, Allocator >::capacity().
|
private |
Definition at line 94 of file dfe_smallvector.hpp.
View newest version in sPHENIX GitHub at line 94 of file dfe_smallvector.hpp
Referenced by dfe::SmallVector< T, N, Allocator >::begin(), dfe::SmallVector< T, N, Allocator >::capacity(), dfe::SmallVector< T, N, Allocator >::clear(), dfe::SmallVector< T, N, Allocator >::destruct_deallocate_onheap(), dfe::SmallVector< T, N, Allocator >::destruct_inplace(), dfe::SmallVector< T, N, Allocator >::emplace(), dfe::SmallVector< T, N, Allocator >::empty(), dfe::SmallVector< T, N, Allocator >::end(), dfe::SmallVector< T, N, Allocator >::operator[](), and dfe::SmallVector< T, N, Allocator >::size().