PLaSK library
Loading...
Searching...
No Matches
plask::SafeDataImpl< T > Struct Template Reference

LazyData implementation removing NaN from another data. More...

#include <plask/lazydata.hpp>

Inheritance diagram for plask::SafeDataImpl< T >:
[legend]
Collaboration diagram for plask::SafeDataImpl< T >:
[legend]

Public Member Functions

 SafeDataImpl (const LazyData< T > &src, const T safe_value=Zero< T >())
 Create lazy data filter.
 
std::size_t size () const override
 Get the number of elements in this vector.
 
at (std::size_t i) const override
 Get index-th value from vector.
 
- Public Member Functions inherited from plask::LazyDataImpl< T >
virtual ~LazyDataImpl ()
 
virtual DataVector< const T > getAll () const
 Get all values as non-lazy vector.
 
virtual DataVector< T > claim () const
 

Public Attributes

const LazyData< T > src
 
constsafe_value
 

Additional Inherited Members

- Public Types inherited from plask::LazyDataImpl< T >
typedefCellType
 

Detailed Description

template<typename T>
struct plask::SafeDataImpl< T >

LazyData implementation removing NaN from another data.

TODO: sanitize also inf

Definition at line 414 of file lazydata.hpp.

Constructor & Destructor Documentation

◆ SafeDataImpl()

template<typename T >
plask::SafeDataImpl< T >::SafeDataImpl ( const LazyData< T > &  src,
const safe_value = Zero<T>() 
)
inline

Create lazy data filter.

Parameters
srcsource lazy data or vector
sane_valuesane value that is returned instead of NaN

Definition at line 424 of file lazydata.hpp.

Member Function Documentation

◆ at()

template<typename T >
T plask::SafeDataImpl< T >::at ( std::size_t  index) const
inlineoverridevirtual

Get index-th value from vector.

Parameters
indexshould be a value from 0 to size()-1
Returns
index-th value from vector

Implements plask::LazyDataImpl< T >.

Definition at line 428 of file lazydata.hpp.

◆ size()

template<typename T >
std::size_t plask::SafeDataImpl< T >::size ( ) const
inlineoverridevirtual

Get the number of elements in this vector.

Returns
the number of elements in this vector

Implements plask::LazyDataImpl< T >.

Definition at line 426 of file lazydata.hpp.

Member Data Documentation

◆ safe_value

template<typename T >
const T plask::SafeDataImpl< T >::safe_value

Definition at line 417 of file lazydata.hpp.

◆ src

template<typename T >
const LazyData<T> plask::SafeDataImpl< T >::src

Definition at line 416 of file lazydata.hpp.


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