![]() |
LArSoft
v10_06_00
Liquid Argon Software toolkit - https://larsoft.org/
|
Base class for a container of data arranged on a grid. More...
#include "GridContainers.h"
Public Types | |
| using | Datum_t = DATUM |
| type of contained datum More... | |
| using | Indexer_t = IXMAN |
| using | Grid_t = GridContainerBase< Datum_t, Indexer_t > |
| this type More... | |
| using | CellIndex_t = typename Indexer_t::CellIndex_t |
| type of index for direct access to the cell More... | |
| using | CellIndexOffset_t = typename Indexer_t::CellIndexOffset_t |
| type of difference between indices More... | |
| using | CellDimIndex_t = typename Indexer_t::CellDimIndex_t |
| type of difference between indices More... | |
| using | CellID_t = typename Indexer_t::CellID_t |
| type of cell coordinate (x, y, z) More... | |
| using | Cell_t = std::vector< Datum_t > |
| type of a single cell container More... | |
| using | Cells_t = std::vector< Cell_t > |
| type of container holding all cells More... | |
| using | const_iterator = typename Cells_t::const_iterator |
| type of iterator to all cells More... | |
Public Member Functions | |
| GridContainerBase (std::array< size_t, dims()> const &dims) | |
| Constructor: specifies the size of the container and allocates it. More... | |
| Indexer_t const & | indexManager () const |
| Returns the index manager of the grid. More... | |
Data structure | |
| size_t | size () const |
| Returns the total size of the container. More... | |
| bool | has (CellIndexOffset_t index) const |
| Returns whether the specified index is valid. More... | |
Data access | |
| CellIndex_t | index (CellID_t const &id) const |
| Return the index of the element from its cell coordinates (no check!) More... | |
| CellIndexOffset_t | indexOffset (CellID_t const &origin, CellID_t const &cellID) const |
| Returns the difference in index from two cells. More... | |
| Cell_t & | operator[] (CellID_t const &id) |
| Returns a reference to the specified cell. More... | |
| Cell_t const & | operator[] (CellID_t const &id) const |
| Returns a constant reference to the specified cell. More... | |
| Cell_t & | operator[] (CellIndex_t index) |
| Returns a reference to to the cell with specified index. More... | |
| Cell_t const & | operator[] (CellIndex_t index) const |
| Returns a constant reference to the cell with specified index. More... | |
Data insertion | |
| void | insert (CellID_t const &cellID, Datum_t const &elem) |
| Copies an element into the specified cell. More... | |
| void | insert (CellID_t const &cellID, Datum_t &&elem) |
| Moves an element into the specified cell. More... | |
| void | insert (CellIndex_t index, Datum_t const &elem) |
| Copies an element into the cell with the specified index. More... | |
| void | insert (CellIndex_t index, Datum_t &&elem) |
| Moves an element into the cell with the specified index. More... | |
Static Public Member Functions | |
| static constexpr unsigned int | dims () |
Protected Member Functions | |
| Cell_t & | cell (CellID_t const &cellID) |
| Returns a reference to the specified cell. More... | |
| Cell_t const & | cell (CellID_t const &cellID) const |
| Returns a constant reference to the specified cell. More... | |
Protected Attributes | |
| Indexer_t | indices |
| manager of the indices of the container More... | |
| Cells_t | data |
| organised collection of points More... | |
Base class for a container of data arranged on a grid.
| DATUM | type of datum to be contained |
| IXMAN | type of the grid index manager |
This is base class for GridContainer::D classes. It provides the full functionality, to which the other classes add some dimension-specific interface.
Definition at line 41 of file GridContainers.h.
| using util::details::GridContainerBase< DATUM, IXMAN >::Cell_t = std::vector<Datum_t> |
type of a single cell container
Definition at line 64 of file GridContainers.h.
| using util::details::GridContainerBase< DATUM, IXMAN >::CellDimIndex_t = typename Indexer_t::CellDimIndex_t |
type of difference between indices
Definition at line 58 of file GridContainers.h.
| using util::details::GridContainerBase< DATUM, IXMAN >::CellID_t = typename Indexer_t::CellID_t |
type of cell coordinate (x, y, z)
Definition at line 61 of file GridContainers.h.
| using util::details::GridContainerBase< DATUM, IXMAN >::CellIndex_t = typename Indexer_t::CellIndex_t |
type of index for direct access to the cell
Definition at line 52 of file GridContainers.h.
| using util::details::GridContainerBase< DATUM, IXMAN >::CellIndexOffset_t = typename Indexer_t::CellIndexOffset_t |
type of difference between indices
Definition at line 55 of file GridContainers.h.
| using util::details::GridContainerBase< DATUM, IXMAN >::Cells_t = std::vector<Cell_t> |
type of container holding all cells
Definition at line 67 of file GridContainers.h.
| using util::details::GridContainerBase< DATUM, IXMAN >::const_iterator = typename Cells_t::const_iterator |
type of iterator to all cells
Definition at line 70 of file GridContainers.h.
| using util::details::GridContainerBase< DATUM, IXMAN >::Datum_t = DATUM |
type of contained datum
Definition at line 44 of file GridContainers.h.
| using util::details::GridContainerBase< DATUM, IXMAN >::Grid_t = GridContainerBase<Datum_t, Indexer_t> |
this type
Definition at line 47 of file GridContainers.h.
| using util::details::GridContainerBase< DATUM, IXMAN >::Indexer_t = IXMAN |
Definition at line 45 of file GridContainers.h.
|
inline |
Constructor: specifies the size of the container and allocates it.
Definition at line 73 of file GridContainers.h.
|
inlineprotected |
Returns a reference to the specified cell.
Definition at line 143 of file GridContainers.h.
References util::details::GridContainerBase< DATUM, IXMAN >::index().
Referenced by util::details::GridContainerBase< DATUM, IXMAN >::insert(), and util::details::GridContainerBase< DATUM, IXMAN >::operator[]().
|
inlineprotected |
Returns a constant reference to the specified cell.
Definition at line 146 of file GridContainers.h.
References util::details::GridContainerBase< DATUM, IXMAN >::index().
|
inlinestatic |
Definition at line 49 of file GridContainers.h.
|
inline |
Returns whether the specified index is valid.
Definition at line 84 of file GridContainers.h.
References util::details::GridContainerBase< DATUM, IXMAN >::indices.
|
inline |
Return the index of the element from its cell coordinates (no check!)
Definition at line 92 of file GridContainers.h.
References util::details::GridContainerBase< DATUM, IXMAN >::indices.
Referenced by util::details::GridContainerBase< DATUM, IXMAN >::cell(), util::details::GridContainerBase< DATUM, IXMAN >::insert(), and util::details::GridContainerBase< DATUM, IXMAN >::operator[]().
|
inline |
Returns the index manager of the grid.
Definition at line 135 of file GridContainers.h.
References util::details::GridContainerBase< DATUM, IXMAN >::indices.
|
inline |
Returns the difference in index from two cells.
Definition at line 95 of file GridContainers.h.
References util::details::GridContainerBase< DATUM, IXMAN >::indices.
|
inline |
Copies an element into the specified cell.
Definition at line 118 of file GridContainers.h.
References util::details::GridContainerBase< DATUM, IXMAN >::cell().
|
inline |
Moves an element into the specified cell.
Definition at line 121 of file GridContainers.h.
References util::details::GridContainerBase< DATUM, IXMAN >::cell().
|
inline |
Copies an element into the cell with the specified index.
Definition at line 127 of file GridContainers.h.
References util::details::GridContainerBase< DATUM, IXMAN >::data, and util::details::GridContainerBase< DATUM, IXMAN >::index().
|
inline |
Moves an element into the cell with the specified index.
Definition at line 130 of file GridContainers.h.
References util::details::GridContainerBase< DATUM, IXMAN >::data, and util::details::GridContainerBase< DATUM, IXMAN >::index().
|
inline |
Returns a reference to the specified cell.
Definition at line 101 of file GridContainers.h.
References util::details::GridContainerBase< DATUM, IXMAN >::cell().
|
inline |
Returns a constant reference to the specified cell.
Definition at line 104 of file GridContainers.h.
References util::details::GridContainerBase< DATUM, IXMAN >::cell().
|
inline |
Returns a reference to to the cell with specified index.
Definition at line 107 of file GridContainers.h.
References util::details::GridContainerBase< DATUM, IXMAN >::data, and util::details::GridContainerBase< DATUM, IXMAN >::index().
|
inline |
Returns a constant reference to the cell with specified index.
Definition at line 110 of file GridContainers.h.
References util::details::GridContainerBase< DATUM, IXMAN >::data, and util::details::GridContainerBase< DATUM, IXMAN >::index().
|
inline |
Returns the total size of the container.
Definition at line 81 of file GridContainers.h.
References util::details::GridContainerBase< DATUM, IXMAN >::indices.
|
protected |
organised collection of points
Definition at line 140 of file GridContainers.h.
Referenced by util::details::GridContainerBase< DATUM, IXMAN >::insert(), and util::details::GridContainerBase< DATUM, IXMAN >::operator[]().
|
protected |
manager of the indices of the container
Definition at line 138 of file GridContainers.h.
Referenced by util::details::GridContainerBase< DATUM, IXMAN >::has(), util::details::GridContainerBase< DATUM, IXMAN >::index(), util::details::GridContainerBase< DATUM, IXMAN >::indexManager(), util::details::GridContainerBase< DATUM, IXMAN >::indexOffset(), and util::details::GridContainerBase< DATUM, IXMAN >::size().