PLaSK library
Loading...
Searching...
No Matches
plask::ReindexedContainer< ContainerType > Struct Template Reference

ReindexedContainer instantiation is class which objects have reference to original container and operator[]. More...

#include <plask/utils/iterators.hpp>

Public Member Functions

 ReindexedContainer (ContainerType &originalContainer, int firstIndex=0, int delta=1)
 
auto operator[] (const std::size_t &this_index) -> decltype(originalContainer[0])
 
auto operator[] (const std::size_t &this_index) const -> decltype(const_cast< const ContainerType & >(originalContainer)[0])
 

Public Attributes

ContainerTypeoriginalContainer
 
int firstIndex
 
int delta
 

Detailed Description

template<typename ContainerType>
struct plask::ReindexedContainer< ContainerType >

ReindexedContainer instantiation is class which objects have reference to original container and operator[].

All calls to operator[] are delegated to original container, but argument of call is changed (reindexed) using formula: firstIndex + given_index * delta where:

  • given_index is call parameter,
  • firstIndex and delta are paremeters stored in ReindexedContainer.
Template Parameters
ContainerTypetype of original container

Definition at line 457 of file iterators.hpp.

Constructor & Destructor Documentation

◆ ReindexedContainer()

template<typename ContainerType >
plask::ReindexedContainer< ContainerType >::ReindexedContainer ( ContainerType originalContainer,
int  firstIndex = 0,
int  delta = 1 
)
inline

Definition at line 463 of file iterators.hpp.

Member Function Documentation

◆ operator[]() [1/2]

template<typename ContainerType >
auto plask::ReindexedContainer< ContainerType >::operator[] ( const std::size_t &  this_index) -> decltype(originalContainer[0])
inline

Definition at line 466 of file iterators.hpp.

◆ operator[]() [2/2]

Definition at line 470 of file iterators.hpp.

Member Data Documentation

◆ delta

Definition at line 461 of file iterators.hpp.

◆ firstIndex

Definition at line 461 of file iterators.hpp.

◆ originalContainer

Definition at line 459 of file iterators.hpp.


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