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

Wrap DataVector and allow to access to it. More...

#include <plask/lazydata.hpp>

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

Public Member Functions

 LazyDataFromVectorImpl (DataVector< const T > vec)
 
at (std::size_t index) const override
 Get index-th value from vector.
 
std::size_t size () const override
 Get the number of elements in this vector.
 
DataVector< const T > getAll () const override
 Get all values as non-lazy vector.
 
DataVector< T > claim () const override
 
- Public Member Functions inherited from plask::LazyDataImpl< T >
virtual ~LazyDataImpl ()
 

Public Attributes

DataVector< const T > vec
 

Additional Inherited Members

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

Detailed Description

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

Wrap DataVector and allow to access to it.

getAll() does not copy the wrapped vector.

Definition at line 104 of file lazydata.hpp.

Constructor & Destructor Documentation

◆ LazyDataFromVectorImpl()

template<typename T >
plask::LazyDataFromVectorImpl< T >::LazyDataFromVectorImpl ( DataVector< const T >  vec)
inline

Definition at line 108 of file lazydata.hpp.

Member Function Documentation

◆ at()

template<typename T >
T plask::LazyDataFromVectorImpl< 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 110 of file lazydata.hpp.

◆ claim()

template<typename T >
DataVector< T > plask::LazyDataFromVectorImpl< T >::claim ( ) const
inlineoverridevirtual

Reimplemented from plask::LazyDataImpl< T >.

Definition at line 116 of file lazydata.hpp.

◆ getAll()

template<typename T >
DataVector< const T > plask::LazyDataFromVectorImpl< T >::getAll ( ) const
inlineoverridevirtual

Get all values as non-lazy vector.

Returns
non-lazy representation of this

Reimplemented from plask::LazyDataImpl< T >.

Definition at line 114 of file lazydata.hpp.

◆ size()

template<typename T >
std::size_t plask::LazyDataFromVectorImpl< 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 112 of file lazydata.hpp.

Member Data Documentation

◆ vec

Definition at line 106 of file lazydata.hpp.


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