A two-dimensional storage class for objects centered on the vertices of a 2d square lattice. More...
#include <grid.h>
Public Member Functions | |
Grid ()=default | |
Default ctor. More... | |
Grid (Grid &&)=default | |
Move ctor. More... | |
Grid (Grid const &)=default | |
Copy ctor. More... | |
Grid (int w, int d) | |
Standard ctor with default-inserted elements. More... | |
Grid (int w, int d, T def) | |
Standard ctor. More... | |
T & | operator() (Coord const &coord) |
Access an element at the specified coordinate. More... | |
T const & | operator() (Coord const &coord) const |
Access an element at the specified coordinate. More... | |
Grid & | operator= (Grid &&)=default |
Move assignment operator is defaulted. More... | |
Grid & | operator= (Grid const &)=default |
Copy assignment operator is defaulted. More... | |
template<typename Archive > | |
void | serialize (Archive &ar, const unsigned int) |
Boost serialisation. More... | |
Private Attributes | |
int | depth |
depth of the lattice. More... | |
Vec< T > | storage |
backing storage. More... | |
int | width |
width of the lattice. More... | |
A two-dimensional storage class for objects centered on the vertices of a 2d square lattice.
When accesses outside the constructed range are requested, they are mapped into that range using restrict()
. The width-wise coordinate comes first, the depth-wise coordinate second.