PLaSK library
|
Lazy data (vector). More...
#include <plask/lazydata.hpp>
Public Types | |
typedef T | CellType |
typedef DataVector< T > | DataVectorType |
typedef DataVector< const T > | DataVectorOfConstType |
typedef IndexedIterator< const LazyData, T > | const_iterator |
Random access iterator type which allow iterate over all points in this lazy data vector, in order appointed by operator[]. | |
typedef const_iterator | iterator |
typedef const_iterator | Iterator |
Public Member Functions | |
LazyData (const LazyDataImpl< T > *impl=nullptr) | |
Construct lazy data vector which use given implementation to provide data. | |
LazyData (std::size_t size, T value) | |
Construct lazy data vector which returns the same value for each index. | |
LazyData (DataVector< const T > data_vector) | |
Construct lazy data vector which wraps DataVector and allows to access to it. | |
LazyData (DataVector< T > data_vector) | |
LazyData (std::size_t size, std::function< T(std::size_t)> func) | |
Construct lazy data from size and functor. | |
void | reset (const LazyDataImpl< T > *new_impl=nullptr) |
void | reset (std::size_t size, T value) |
void | reset (DataVector< const T > data_vector) |
void | reset (DataVector< T > data_vector) |
void | reset (std::size_t size, std::function< T(std::size_t)> func) |
T | operator[] (std::size_t index) const |
Get index-th value from this vector. | |
T | at (std::size_t index) const |
Get index-th value from this vector. | |
DataVector< const T > | nonLazy () const |
operator DataVector< const T > () const | |
DataVector< T > | claim () const |
std::size_t | size () const |
Get the number of elements in this vector. | |
const_iterator | begin () const |
const_iterator | end () const |
bool | isNotNull () const |
bool | isNull () const |
Lazy data (vector).
It ownership a pointer to implementation of lazy data (vector) which is of the type LazyDataImpl<T>.
Reading from LazyData object is thread-safty.
Definition at line 161 of file lazydata.hpp.
typedef T plask::LazyData< T >::CellType |
Definition at line 169 of file lazydata.hpp.
typedef IndexedIterator< const LazyData, T > plask::LazyData< T >::const_iterator |
Random access iterator type which allow iterate over all points in this lazy data vector, in order appointed by operator[].
This iterator type is indexed, which means that it have (read-write) index field equal to 0 for begin() and growing up to size() for end().
Definition at line 251 of file lazydata.hpp.
typedef DataVector<const T> plask::LazyData< T >::DataVectorOfConstType |
Definition at line 171 of file lazydata.hpp.
typedef DataVector<T> plask::LazyData< T >::DataVectorType |
Definition at line 170 of file lazydata.hpp.
typedef const_iterator plask::LazyData< T >::iterator |
Definition at line 252 of file lazydata.hpp.
typedef const_iterator plask::LazyData< T >::Iterator |
Definition at line 253 of file lazydata.hpp.
|
inline |
Construct lazy data vector which use given implementation to provide data.
impl | lazy data vector implementation to use (if nullptr, reset should be called before another methods) |
Definition at line 177 of file lazydata.hpp.
|
inline |
Construct lazy data vector which returns the same value for each index.
size | number of values, size of the vector |
value | value which will be returned for each index |
Definition at line 184 of file lazydata.hpp.
|
inline |
Construct lazy data vector which wraps DataVector and allows to access to it.
data_vector | vector to wrap |
Definition at line 190 of file lazydata.hpp.
|
inline |
Definition at line 191 of file lazydata.hpp.
|
inline |
Construct lazy data from size and functor.
size | data size |
func | function returning data at point |
Definition at line 198 of file lazydata.hpp.
|
inline |
Get index-th value from this vector.
index | should be a value from 0 to size()-1 |
Definition at line 229 of file lazydata.hpp.
|
inline |
this
Definition at line 256 of file lazydata.hpp.
|
inline |
Definition at line 235 of file lazydata.hpp.
|
inline |
this
Definition at line 259 of file lazydata.hpp.
|
inline |
Definition at line 261 of file lazydata.hpp.
|
inline |
Definition at line 263 of file lazydata.hpp.
|
inline |
Definition at line 231 of file lazydata.hpp.
|
inline |
Definition at line 233 of file lazydata.hpp.
|
inline |
Get index-th value from this vector.
index | should be a value from 0 to size()-1 |
Definition at line 222 of file lazydata.hpp.
|
inline |
Definition at line 201 of file lazydata.hpp.
|
inline |
Definition at line 205 of file lazydata.hpp.
|
inline |
Definition at line 206 of file lazydata.hpp.
|
inline |
Definition at line 208 of file lazydata.hpp.
|
inline |
Definition at line 203 of file lazydata.hpp.
|
inline |
Get the number of elements in this vector.
Definition at line 245 of file lazydata.hpp.