Peano
Loading...
Searching...
No Matches
Vec< ITEM, ALLOCATOR > Class Template Reference

#include <vec.h>

Public Types

using value_type = ITEM
 

Public Member Functions

 Vec (unsigned int capacity=0, ALLOCATOR allocator=ALLOCATOR())
 
void reserve (unsigned int newCapacity)
 
void prefetch () const
 
void push_back (ITEM &item)
 
ITEM & operator[] (int idx) const
 
void clear ()
 
unsigned int size () const
 
ITEM * data () const
 
 Vec (const Vec &)=delete
 
Vecoperator= (Vec &&other) noexcept
 
 ~Vec ()
 
ITEM * begin ()
 
ITEM * end ()
 
const ITEM * begin () const
 
const ITEM * end () const
 

Private Attributes

ITEM * dataPtr = nullptr
 
ALLOCATOR allocator
 
unsigned int capacity = 0
 
unsigned int freeIdx = 0
 

Detailed Description

template<typename ITEM, typename ALLOCATOR>
class Vec< ITEM, ALLOCATOR >

Definition at line 29 of file vec.h.

Member Typedef Documentation

◆ value_type

template<typename ITEM , typename ALLOCATOR >
using Vec< ITEM, ALLOCATOR >::value_type = ITEM

Definition at line 39 of file vec.h.

Constructor & Destructor Documentation

◆ Vec() [1/2]

template<typename ITEM , typename ALLOCATOR >
Vec< ITEM, ALLOCATOR >::Vec ( unsigned int capacity = 0,
ALLOCATOR allocator = ALLOCATOR() )
explicit

Definition at line 41 of file vec.h.

References Vec< ITEM, ALLOCATOR >::capacity.

◆ Vec() [2/2]

template<typename ITEM , typename ALLOCATOR >
Vec< ITEM, ALLOCATOR >::Vec ( const Vec< ITEM, ALLOCATOR > & )
delete

◆ ~Vec()

template<typename ITEM , typename ALLOCATOR >
Vec< ITEM, ALLOCATOR >::~Vec ( )

Definition at line 103 of file vec.h.

Member Function Documentation

◆ begin() [1/2]

template<typename ITEM , typename ALLOCATOR >
ITEM * Vec< ITEM, ALLOCATOR >::begin ( )

Definition at line 107 of file vec.h.

References Vec< ITEM, ALLOCATOR >::dataPtr.

◆ begin() [2/2]

template<typename ITEM , typename ALLOCATOR >
const ITEM * Vec< ITEM, ALLOCATOR >::begin ( ) const

Definition at line 115 of file vec.h.

References Vec< ITEM, ALLOCATOR >::dataPtr.

◆ clear()

template<typename ITEM , typename ALLOCATOR >
void Vec< ITEM, ALLOCATOR >::clear ( )

Definition at line 76 of file vec.h.

Referenced by peano4.output.Makefile.Makefile::__init__().

Here is the caller graph for this function:

◆ data()

template<typename ITEM , typename ALLOCATOR >
ITEM * Vec< ITEM, ALLOCATOR >::data ( ) const

Definition at line 84 of file vec.h.

References Vec< ITEM, ALLOCATOR >::dataPtr.

Referenced by peano4.datamodel.DaStGenToLegacyTool.DaStGenToLegacyTool::__generate_dastgen_input_file(), peano4.datamodel.DaStGenToLegacyTool.DaStGenToLegacyTool::__get_file_name(), peano4.datamodel.DaStGenToLegacyTool.DaStGenToLegacyTool::__get_full_qualified_file_name(), swift2.particle.Particle.Particle::__init__(), swift2.particle.Particle.Particle::_add_dependency_checks(), swift2.particle.Particle.Particle::_dependency_checks_modify_steps(), swift2.particle.tests.DastgenTestDummyParticle.DastgenTestDummyParticle::_generate_boolean_array_attributes(), swift2.particle.tests.DastgenTestDummyParticle.DastgenTestDummyParticle::_generate_boolean_attributes(), swift2.particle.tests.DastgenTestDummyParticle.DastgenTestDummyParticle::_generate_double_array_attributes(), swift2.particle.tests.DastgenTestDummyParticle.DastgenTestDummyParticle::_generate_double_attributes(), swift2.particle.tests.DastgenTestDummyParticle.DastgenTestDummyParticle::_generate_enum_attributes(), swift2.particle.tests.DastgenTestDummyParticle.DastgenTestDummyParticle::_generate_integer_array_attributes(), swift2.particle.tests.DastgenTestDummyParticle.DastgenTestDummyParticle::_generate_integer_attributes(), swift2.particle.tests.DastgenTestDummyParticle.DastgenTestDummyParticle::_generate_peano_double_array_attributes(), swift2.particle.tests.DastgenTestDummyParticle.DastgenTestDummyParticle::_generate_peano_integer_array_attributes(), swift2.particle.tests.DastgenTestDummyParticle.DastgenTestDummyParticle::_generate_string_attributes(), swift2.particle.tests.DastgenTestDummyParticle.DastgenTestDummyParticle::_generate_user_defined_attributes(), peano4.datamodel.PatchToDoubleArray.PatchToDoubleArray::_get_dictionary_for_output(), peano4.datamodel.DaStGenToLegacyTool.DaStGenToLegacyTool::construct_output(), peano4.datamodel.DynamicArrayOverPrimitivesToStdVector.DynamicArrayOverPrimitivesToStdVector::construct_output(), peano4.datamodel.PatchToDoubleArray.PatchToDoubleArray::construct_output(), peano4.datamodel.PatchToDoubleArrayOnHeap.PatchToDoubleArrayOnHeap::construct_output(), peano4.datamodel.PatchToDoubleArrayWithSmartPointer.PatchToDoubleArrayWithSmartPointer::construct_output(), peano4.datamodel.DaStGenToLegacyTool.DaStGenToLegacyTool::get_header_file_include(), peano4.datamodel.DynamicArrayOverPrimitivesToStdVector.DynamicArrayOverPrimitivesToStdVector::get_header_file_include(), peano4.datamodel.PatchToDoubleArray.PatchToDoubleArray::get_header_file_include(), peano4.datamodel.PatchToDoubleArrayOnHeap.PatchToDoubleArrayOnHeap::get_header_file_include(), peano4.datamodel.PatchToDoubleArrayWithSmartPointer.PatchToDoubleArrayWithSmartPointer::get_header_file_include(), peano4.datamodel.DaStGenToLegacyTool.DaStGenToLegacyTool::get_stack_container(), peano4.datamodel.PatchToDoubleArray.PatchToDoubleArray::get_stack_container(), peano4.datamodel.PatchToDoubleArrayOnHeap.PatchToDoubleArrayOnHeap::get_stack_container(), peano4.datamodel.PatchToDoubleArrayWithSmartPointer.PatchToDoubleArrayWithSmartPointer::get_stack_container(), Vec< ITEM, ALLOCATOR >::prefetch(), swift2.particle.Particle.Particle::readme_descriptor(), swift2.particle.SPHLeapfrogFixedSearchRadius.SPHLeapfrogFixedSearchRadius::set_parameters(), swift2.particle.SPHParticle.SPHParticle::set_parameters(), and swift2.particle.tests.testLeapfrogFixedTimeStepSize.testLeapfrogFixedTimeStepSize::set_parameters().

Here is the caller graph for this function:

◆ end() [1/2]

template<typename ITEM , typename ALLOCATOR >
ITEM * Vec< ITEM, ALLOCATOR >::end ( )

Definition at line 111 of file vec.h.

References Vec< ITEM, ALLOCATOR >::freeIdx.

Referenced by kernel_impl.Enumerator::fetch(), kernel_impl.Enumerator::lower(), and kernel_impl.Enumerator::upper().

Here is the caller graph for this function:

◆ end() [2/2]

template<typename ITEM , typename ALLOCATOR >
const ITEM * Vec< ITEM, ALLOCATOR >::end ( ) const

Definition at line 119 of file vec.h.

References Vec< ITEM, ALLOCATOR >::freeIdx.

Referenced by kernel_impl.Enumerator::fetch(), kernel_impl.Enumerator::lower(), and kernel_impl.Enumerator::upper().

Here is the caller graph for this function:

◆ operator=()

template<typename ITEM , typename ALLOCATOR >
Vec & Vec< ITEM, ALLOCATOR >::operator= ( Vec< ITEM, ALLOCATOR > && other)
noexcept

Definition at line 90 of file vec.h.

References Vec< ITEM, ALLOCATOR >::dataPtr.

◆ operator[]()

template<typename ITEM , typename ALLOCATOR >
ITEM & Vec< ITEM, ALLOCATOR >::operator[] ( int idx) const

Definition at line 72 of file vec.h.

◆ prefetch()

template<typename ITEM , typename ALLOCATOR >
void Vec< ITEM, ALLOCATOR >::prefetch ( ) const

Definition at line 52 of file vec.h.

References Vec< ITEM, ALLOCATOR >::data(), and Vec< ITEM, ALLOCATOR >::size().

Here is the call graph for this function:

◆ push_back()

template<typename ITEM , typename ALLOCATOR >
void Vec< ITEM, ALLOCATOR >::push_back ( ITEM & item)

Definition at line 58 of file vec.h.

References Vec< ITEM, ALLOCATOR >::freeIdx.

◆ reserve()

template<typename ITEM , typename ALLOCATOR >
void Vec< ITEM, ALLOCATOR >::reserve ( unsigned int newCapacity)

Definition at line 46 of file vec.h.

References assert.

◆ size()

template<typename ITEM , typename ALLOCATOR >
unsigned int Vec< ITEM, ALLOCATOR >::size ( ) const

Field Documentation

◆ allocator

template<typename ITEM , typename ALLOCATOR >
ALLOCATOR Vec< ITEM, ALLOCATOR >::allocator
private

Definition at line 33 of file vec.h.

◆ capacity

template<typename ITEM , typename ALLOCATOR >
unsigned int Vec< ITEM, ALLOCATOR >::capacity = 0
private

Definition at line 35 of file vec.h.

Referenced by Vec< ITEM, ALLOCATOR >::Vec().

◆ dataPtr

template<typename ITEM , typename ALLOCATOR >
ITEM* Vec< ITEM, ALLOCATOR >::dataPtr = nullptr
private

◆ freeIdx

template<typename ITEM , typename ALLOCATOR >
unsigned int Vec< ITEM, ALLOCATOR >::freeIdx = 0
private

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