My Project
Loading...
Searching...
No Matches
Opm::PAvgDynamicSourceData::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 class  Item { Pressure , MixtureDensity , PoreVol , 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.
 
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.
 
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.
 

Friends

class PAvgDynamicSourceData
 

Detailed Description

template<typename T>
class Opm::PAvgDynamicSourceData::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 double or
const double
.

Member Function Documentation

◆ operator=()

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

Assign all items.

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.

◆ operator[]()

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

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 T >
template<typename Ret = SourceDataSpan&>
constexpr std::enable_if_t<! std::is_const_v< T >, Ret > Opm::PAvgDynamicSourceData::SourceDataSpan< T >::set ( const Item  i,
const ElmT  value 
)
inlineconstexpr

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: