Rebel Fork Framework
Urho3D::Array2D< T, Container > Class Template Reference

2D array template. More...

#include <Urho3D/Container/Array2D.h>

Inheritance diagram for Urho3D::Array2D< T, Container >:
Urho3D::ArrayDimensions2D

Public Member Functions

 Array2D ()=default
 Construct default.
 
 Array2D (const ArrayDimensions2D &dim)
 Construct with dimensions and default value.
 
 Array2D (const ArrayDimensions2D &dim, const T &value)
 Construct with dimensions and initial value.
 
 Array2D (int width, int height)
 Construct with given size and default value.
 
 Array2D (int width, int height, const T &value)
 Construct with given size and initial value.
 
void Reset ()
 Reset array to empty.
 
void Reset (const ArrayDimensions2D &dim)
 Resize array. All elements are reset to default value.
 
void Reset (const ArrayDimensions2D &dim, const T &value)
 Resize array. All elements are reset to specified default value.
 
void Reset (int width, int height)
 Resize array. All elements are reset to default value.
 
void Reset (int width, int height, const T &value)
 Resize array. All elements are reset to specified default value.
 
void Fill (const T &value)
 Fill array with given value.
 
const ArrayDimensions2DDim () const
 Return array dimensions.
 
Container & GetContainer ()
 Return underlying container.
 
const Container & GetContainer () const
 Return constant underlying container.
 
T & Get (const IntVector2 &index)
 Return element by index.
 
T * GetOptional (const IntVector2 &index)
 Return element by index or null if out of bounds.
 
T & GetWrapped (const IntVector2 &index)
 Return element by wrapped index.
 
T & GetClamped (const IntVector2 &index)
 Return element by clamped index.
 
const T & Get (const IntVector2 &index) const
 Return constant element by index.
 
const T * GetOptional (const IntVector2 &index) const
 Return constant element by index or null if out of bounds.
 
const T & GetWrapped (const IntVector2 &index) const
 Return constant element by wrapped index.
 
const T & GetClamped (const IntVector2 &index) const
 Return constant element by clamped index.
 
T & operator[] (const IntVector2 &index)
 Return element by index.
 
const T & operator[] (const IntVector2 &index) const
 Return constant element by index.
 
void Swap (Array2D< T > &other)
 Swap with other array.
 
auto Begin ()
 Return array begin.
 
auto End ()
 Return array end.
 
auto Begin () const
 Return array begin (const).
 
auto End () const
 Return array end (const).
 
- Public Member Functions inherited from Urho3D::ArrayDimensions2D
 ArrayDimensions2D ()=default
 Construct default.
 
 ArrayDimensions2D (int width, int height)
 Construct with given size.
 
 ArrayDimensions2D (const IntVector2 &size)
 Construct with given size as vector (implicitly convertible).
 
int GetWidth () const
 Return width.
 
int GetHeight () const
 Return height.
 
IntVector2 GetSize () const
 Return array size as int vector.
 
IntRect GetRect () const
 Return array dimensions as IntRect.
 
unsigned GetCapacity () const
 Return total number of elements.
 
bool Contains (const IntVector2 &index) const
 Return whether the index is contained in the array.
 
IntVector2 ClampIndex (const IntVector2 &index) const
 Return index clamped to array boundaries.
 
IntVector2 WrapIndex (const IntVector2 &index) const
 Return index wrapped to array boundaries.
 
unsigned IndexToOffset (const IntVector2 &index) const
 Convert 2D array index to linear array index.
 
IntVector2 OffsetToIndex (unsigned index) const
 Convert linear array index to 2D array index.
 

Private Attributes

Container data_
 Array data.
 

Additional Inherited Members

- Protected Member Functions inherited from Urho3D::ArrayDimensions2D
void SetSize (int width, int height)
 Set dimensions.
 
void Swap (ArrayDimensions2D &other)
 Swap with other array dimensions.
 

Detailed Description

template<class T, class Container = ea::vector<T>>
class Urho3D::Array2D< T, Container >

2D array template.


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