STAPL API Reference          
Overview   Containers   Algorithms   Views   Skeletons   Run-Time System
Modules     Classes    
List of all members | Public Member Functions | Public Types | Protected Member Functions | Protected Types | Protected Attributes
stapl::lightweight_vector< T > Struct Template Reference

This container is lightweight wrapper around std::vector and keeps a shared_ptr to the underlying std::vector. More...

Public Member Functions

 lightweight_vector (std::size_t size)
 
 lightweight_vector (iterator begin, iterator end)
 
 lightweight_vector (const_iterator begin, const_iterator end)
 
const_iterator begin (void) const
 Return an const_iterator to the beginning of the sequence of elements this container stores.
 
const_iterator cbegin (void) const
 Return an const_iterator to the beginning of the sequence of elements this container stores.
 
iterator begin (void)
 Return an iterator to the beginning of the sequence of elements this container stores.
 
const_iterator end (void) const
 Return an const_iterator to the end (one past the last element) of the sequence of elements this container stores.
 
const_iterator cend (void) const
 Return an const_iterator to the end (one past the last element) of the sequence of elements this container stores.
 
iterator end (void)
 Return an iterator to the end (one past the last element) of the sequence of elements this container stores.
 
reference operator[] (std::size_t const &idx)
 Return reference to element in buffer at index idx.
 
const_reference operator[] (std::size_t const &idx) const
 Return reference to element in buffer at index idx.
 
bool operator== (lightweight_vector< T > const &other) const
 
void push_back (T const &t)
 
void emplace_back (T &&t)
 
void reserve (std::size_t size)
 
void resize (std::size_t size)
 
bool empty () const
 
const_reference front (void) const
 
reference front (void)
 
template<class InputIterator >
void insert (iterator position, InputIterator first, InputIterator last)
 
void insert (iterator position, size_type n, value_type const &val)
 
iterator insert (iterator position, value_type const &val)
 
base_t::content_t * get ()
 
void clear ()
 
template<class InputIterator >
void assign (InputIterator first, InputIterator last)
 
void assign (size_type n, value_type const &val)
 
std::size_t size () const
 
domain_type domain () const
 
dimensions_type dimensions () const
 

Public Types

using reference = typename base_t::reference
 
using const_reference = typename base_t::const_reference
 
using iterator = typename base_t::iterator
 
using const_iterator = typename base_t::const_iterator
 
using size_type = std::size_t
 
using value_type = T
 
using domain_type = indexed_domain< std::size_t, dims >
 
using index_type = typename domain_type::index_type
 
using dimensions_type = typename domain_type::dimensions_type
 

Protected Member Functions

void resize_domain (dimensions_type const &dimensions)
 

Protected Types

using content_t = typename std::conditional< initialized==non_initialized, lightweight_multiarray_storage< value_type >, std::vector< value_type > >::type
 

Protected Attributes

storage_t m_content
 
domain_type m_domain
 

Detailed Description

template<typename T>
struct stapl::lightweight_vector< T >

This container is lightweight wrapper around std::vector and keeps a shared_ptr to the underlying std::vector.

This container is used in the skeletons in which copying large vectors would result in performance degradation. As an example, lightweight_vector is used in the NAS IS benchmark in order to avoid intermediate copies made by the PARAGRAPH for filtering the results of each task.

Template Parameters
Tthe type of elements to store

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