opm-common
Loading...
Searching...
No Matches
Opm::FastSmallVector< ValueType, N > Class Template Reference

An implementation of vector/array based on small object optimization. More...

#include <FastSmallVector.hpp>

Public Types

using size_type = typename std::vector<ValueType>::size_type
using Iterator = ValueType*
 Iterator type is a plain pointer, so be warned there is no validity checking.
using ConstIterator = const ValueType*
 ConstIterator type is a plain pointer, so be warned there is no validity checking.

Public Member Functions

 FastSmallVector ()
 default constructor
 FastSmallVector (const size_t numElem)
 constructor based on the number of the element
 FastSmallVector (const size_t numElem, const ValueType value)
 constructor based on the number of the element, and all the elements will have the same value
 FastSmallVector (const FastSmallVector &other)
 copy constructor
 FastSmallVector (FastSmallVector &&other)
 move constructor
 ~FastSmallVector ()
 destructor
FastSmallVectoroperator= (FastSmallVector &&other)
 move assignment
FastSmallVectoroperator= (const FastSmallVector &other)
 copy assignment
ValueType & operator[] (size_t idx)
 access the idx th element
const ValueType & operator[] (size_t idx) const
 const access the idx th element
size_type size () const
 number of elements
ConstIterator begin () const
 To support range-for etc.
ConstIterator end () const
 To support range-for etc.
ConstIterator cbegin () const
 To support range-for etc.
ConstIterator cend () const
 To support range-for etc.
Iterator begin ()
 To support range-for etc.
Iterator end ()
 To support range-for etc.
size_type capacity ()
void push_back (const ValueType &value)

Detailed Description

template<typename ValueType, unsigned N>
class Opm::FastSmallVector< ValueType, N >

An implementation of vector/array based on small object optimization.

It is intended to be used by the DynamicEvaluation for better efficiency.

ValueType is the type of the data N is the size of the buffer that willl be allocated during compilation time


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