BELFEM 0.9.0
Berkeley Lab Finite Element Framework
Loading...
Searching...
No Matches
belfem::Cell< T > Class Template Reference

Cell is a wrapper around the standard vector. More...

#include <cl_Cell.hpp>

Public Member Functions

 Cell ()=default
 Cell (const std::size_t aReserve)
 Cell (const std::size_t aSize, const T aInitializationValue)
 Cell (const std::initializer_list< T > &aInitList)
 Cell (const Cell< T > &other)
 Cell (Cell< T > &&other) noexcept
Cell< T > & operator= (const Cell< T > &other)
Cell< T > & operator= (Cell< T > &&other) noexcept
 ~Cell ()=default
T * data ()
const T * data () const
std::vector< T > & vector_data ()
const std::vector< T > & vector_data () const
auto operator() (size_t aIndex) -> decltype(mCell[aIndex])
auto operator() (size_t aIndex) const -> decltype(mCell[aIndex])
size_t size () const
 return the size of the Cell
void set_size (const size_t aSize)
void set_size (const size_t aSize, const T &aValue)
auto begin () -> decltype(mCell.begin())
auto end () -> decltype(mCell.end())
auto begin () const -> decltype(mCell.begin())
auto end () const -> decltype(mCell.end())
void clear ()
 clear the memory
void reserve (const size_t aSize)
 reserve memory
void push (const T &aValue)
 push an entry to the end of the cell (copy version)
void push (T &&aValue)
 push an entry to the end of the cell (move version)
template<typename... Args>
void emplace (Args &&... args)
 emplace an entry at the end (construct in-place)
pop ()
 pop an entry from the Cell
void shrink_to_fit ()
 free unused memory
T & first ()
const T & first () const
T & last ()
const T & last () const
void swap (Cell< T > &other) noexcept
 Swap contents with another Cell.
bool empty () const
 Check if Cell is empty.
size_t capacity () const
 Get capacity.
auto insert (typename std::vector< T >::const_iterator pos, const T &valuevalue) -> decltype(mCell.insert(pos, valuevalue))
 Insert element at position (copy version).
auto insert (typename std::vector< T >::const_iterator pos, T &&valuevalue) -> decltype(mCell.insert(pos, std::move(valuevalue)))
 Insert element at position (move version).
auto erase (typename std::vector< T >::const_iterator pos) -> decltype(mCell.erase(pos))
 Erase element at position.
auto erase (typename std::vector< T >::const_iterator first, typename std::vector< T >::const_iterator last) -> decltype(mCell.erase(first, last))
 Erase range of elements.
void print (const std::string aLabel="") const
void print (const std::string aLabel) const

Detailed Description

template<typename T>
class belfem::Cell< T >

Cell is a wrapper around the standard vector.

It also supports sorting and unique making of entries.

See also
BELFEM Container Classes - Usage Guide

Constructor & Destructor Documentation

◆ Cell() [1/6]

template<typename T>
belfem::Cell< T >::Cell ( )
default

◆ Cell() [2/6]

template<typename T>
belfem::Cell< T >::Cell ( const std::size_t aReserve)
inline

◆ Cell() [3/6]

template<typename T>
belfem::Cell< T >::Cell ( const std::size_t aSize,
const T aInitializationValue )
inline

◆ Cell() [4/6]

template<typename T>
belfem::Cell< T >::Cell ( const std::initializer_list< T > & aInitList)
inline

◆ Cell() [5/6]

template<typename T>
belfem::Cell< T >::Cell ( const Cell< T > & other)
inline

◆ Cell() [6/6]

template<typename T>
belfem::Cell< T >::Cell ( Cell< T > && other)
inlinenoexcept

◆ ~Cell()

template<typename T>
belfem::Cell< T >::~Cell ( )
default

Member Function Documentation

◆ begin() [1/2]

template<typename T>
auto belfem::Cell< T >::begin ( ) -> decltype(mCell.begin())
inline

◆ begin() [2/2]

template<typename T>
auto belfem::Cell< T >::begin ( ) const -> decltype(mCell.begin())
inline

◆ capacity()

template<typename T>
size_t belfem::Cell< T >::capacity ( ) const
inline

Get capacity.

◆ clear()

template<typename T>
void belfem::Cell< T >::clear ( )
inline

clear the memory

◆ data() [1/2]

template<typename T>
T * belfem::Cell< T >::data ( )
inline

◆ data() [2/2]

template<typename T>
const T * belfem::Cell< T >::data ( ) const
inline

◆ emplace()

template<typename T>
template<typename... Args>
void belfem::Cell< T >::emplace ( Args &&... args)
inline

emplace an entry at the end (construct in-place)

◆ empty()

template<typename T>
bool belfem::Cell< T >::empty ( ) const
inline

Check if Cell is empty.

◆ end() [1/2]

template<typename T>
auto belfem::Cell< T >::end ( ) -> decltype(mCell.end())
inline

◆ end() [2/2]

template<typename T>
auto belfem::Cell< T >::end ( ) const -> decltype(mCell.end())
inline

◆ erase() [1/2]

template<typename T>
auto belfem::Cell< T >::erase ( typename std::vector< T >::const_iterator first,
typename std::vector< T >::const_iterator last ) -> decltype(mCell.erase(first, last))
inline

Erase range of elements.

◆ erase() [2/2]

template<typename T>
auto belfem::Cell< T >::erase ( typename std::vector< T >::const_iterator pos) -> decltype(mCell.erase(pos))
inline

Erase element at position.

◆ first() [1/2]

template<typename T>
T & belfem::Cell< T >::first ( )
inline

◆ first() [2/2]

template<typename T>
const T & belfem::Cell< T >::first ( ) const
inline

◆ insert() [1/2]

template<typename T>
auto belfem::Cell< T >::insert ( typename std::vector< T >::const_iterator pos,
const T & value ) -> decltype(mCell.insert(pos, value))
inline

Insert element at position (copy version).

◆ insert() [2/2]

template<typename T>
auto belfem::Cell< T >::insert ( typename std::vector< T >::const_iterator pos,
T && value ) -> decltype(mCell.insert(pos, std::move(value)))
inline

Insert element at position (move version).

◆ last() [1/2]

template<typename T>
T & belfem::Cell< T >::last ( )
inline

◆ last() [2/2]

template<typename T>
const T & belfem::Cell< T >::last ( ) const
inline

◆ operator()() [1/2]

template<typename T>
auto belfem::Cell< T >::operator() ( size_t aIndex) -> decltype(mCell[aIndex])
inline

◆ operator()() [2/2]

template<typename T>
auto belfem::Cell< T >::operator() ( size_t aIndex) const -> decltype(mCell[aIndex])
inline

◆ operator=() [1/2]

template<typename T>
Cell< T > & belfem::Cell< T >::operator= ( Cell< T > && other)
inlinenoexcept

◆ operator=() [2/2]

template<typename T>
Cell< T > & belfem::Cell< T >::operator= ( const Cell< T > & other)
inline

◆ pop()

template<typename T>
T belfem::Cell< T >::pop ( )
inline

pop an entry from the Cell

◆ print() [1/2]

void belfem::Cell< real >::print ( const std::string aLabel) const
inline

◆ print() [2/2]

template<typename T>
void belfem::Cell< T >::print ( const std::string aLabel = "") const

◆ push() [1/2]

template<typename T>
void belfem::Cell< T >::push ( const T & aValue)
inline

push an entry to the end of the cell (copy version)

◆ push() [2/2]

template<typename T>
void belfem::Cell< T >::push ( T && aValue)
inline

push an entry to the end of the cell (move version)

◆ reserve()

template<typename T>
void belfem::Cell< T >::reserve ( const size_t aSize)
inline

reserve memory

◆ set_size() [1/2]

template<typename T>
void belfem::Cell< T >::set_size ( const size_t aSize)
inline

◆ set_size() [2/2]

template<typename T>
void belfem::Cell< T >::set_size ( const size_t aSize,
const T & aValue )
inline

◆ shrink_to_fit()

template<typename T>
void belfem::Cell< T >::shrink_to_fit ( )
inline

free unused memory

◆ size()

template<typename T>
size_t belfem::Cell< T >::size ( ) const
inline

return the size of the Cell

◆ swap()

template<typename T>
void belfem::Cell< T >::swap ( Cell< T > & other)
inlinenoexcept

Swap contents with another Cell.

◆ vector_data() [1/2]

template<typename T>
std::vector< T > & belfem::Cell< T >::vector_data ( )
inline

◆ vector_data() [2/2]

template<typename T>
const std::vector< T > & belfem::Cell< T >::vector_data ( ) const
inline

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