opm-common
Opm::PAvgDynamicSourceData< Scalar >::SourceDataSpan< T > Class Template Reference

Ad hoc implementation of fixed-width span/view of an underlying contiguous range of elements. More...

#include <PAvgDynamicSourceData.hpp>

Public Types

enum  Item {
  Pressure, MixtureDensity, PoreVol, Depth,
  Last_Do_Not_Use
}
 Supported items of dynamic data per source location.
 
using ElmT = std::remove_cv_t< T >
 

Public Member Functions

constexpr ElmT operator[] (const Item i) const
 Read-only access to numerical value of specified item. More...
 
template<typename Ret = SourceDataSpan&>
constexpr std::enable_if_t<! std::is_const_v< T >, Ret > set (const Item i, const ElmT value)
 Assign specified item. More...
 
template<typename U , typename Ret = SourceDataSpan&>
constexpr std::enable_if_t<! std::is_const_v< T >, Ret > operator= (const SourceDataSpan< U > src)
 Assign all items. More...
 

Friends

class PAvgDynamicSourceData< Scalar >
 

Detailed Description

template<typename Scalar>
template<typename T>
class Opm::PAvgDynamicSourceData< Scalar >::SourceDataSpan< T >

Ad hoc implementation of fixed-width span/view of an underlying contiguous range of elements.

Template Parameters
TElement type. Const or non-const as needed. Typically Scalar or
const Scalar
.

Member Function Documentation

◆ operator=()

template<typename Scalar>
template<typename T>
template<typename U , typename Ret = SourceDataSpan&>
constexpr std::enable_if_t<! std::is_const_v<T>, Ret> Opm::PAvgDynamicSourceData< Scalar >::SourceDataSpan< T >::operator= ( const SourceDataSpan< U >  src)
inline

Assign all items.

Available only if underlying range is non-const.

Parameters
[src]Source data span
Returns
*this
to enable chaining.

◆ operator[]()

template<typename Scalar>
template<typename T>
constexpr ElmT Opm::PAvgDynamicSourceData< Scalar >::SourceDataSpan< T >::operator[] ( const Item  i) const
inline

Read-only access to numerical value of specified item.

Parameters
[in]iItem of dynamic source data.
Returns
Numerical value of specified item.

◆ set()

template<typename Scalar>
template<typename T>
template<typename Ret = SourceDataSpan&>
constexpr std::enable_if_t<! std::is_const_v<T>, Ret> Opm::PAvgDynamicSourceData< Scalar >::SourceDataSpan< T >::set ( const Item  i,
const ElmT  value 
)
inline

Assign specified item.

Availble only if underlying range is non-const.

Parameters
[in]iItem of dynamic source data.
[in]valueNumerical value of specified item.
Returns
*this
to enable chaining.

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