Defines the two-dimensional map (lookup table) data type.
More...
#include <map2d.h>
|
using | IteratorType = typename std::map< TROW, std::map< TCOL, TCell > >::iterator |
| Map row iterator. More...
|
|
using | ConstIteratorType = typename std::map< TROW, std::map< TCOL, TCell > >::const_iterator |
| Read-only map iterator. More...
|
|
|
| Map2d ()=default |
| Initialises a new instance of the Map2d class. More...
|
|
| Map2d (std::map< TROW, std::map< TCOL, TCell >> &&data) noexcept |
| Initialises a new instance of the Map2d class. More...
|
|
bool | empty () const noexcept |
| Determine whether the container is empty. More...
|
|
std::size_t | size () const noexcept |
| Gets the total size of the container dataset. More...
|
|
std::size_t | rows () const noexcept |
| Gets the number of rows. More...
|
|
std::size_t | columns () const noexcept |
| Gets the number of columns. More...
|
|
bool | contains (const TROW &row_key) const |
| Determines whether the container contains a row. More...
|
|
bool | contains (const TROW &row_key, const TCOL &col_key) const |
| Determines whether the container contains a value. More...
|
|
std::map< TCOL, TCell > & | row (const TROW &row_key) |
| Gets a row dataset. More...
|
|
const std::map< TCOL, TCell > & | row (const TROW &row_key) const |
| Gets a read-row dataset. More...
|
|
TCell & | at (const TROW &row_key, const TCOL &col_key) |
| Gets a value at a cell by row and column with bounds checking. More...
|
|
const TCell & | at (const TROW &row_key, const TCOL &col_key) const |
| Gets a read-only value at a cell by row and column with bounds checking. More...
|
|
IteratorType | begin () noexcept |
| Gets an iterator to the beginning of the map. More...
|
|
IteratorType | end () noexcept |
| Gets an iterator to the element following the element of the map. More...
|
|
ConstIteratorType | begin () const noexcept |
| Gets an read-only iterator to the beginning of the map. More...
|
|
ConstIteratorType | end () const noexcept |
| Gets an read-only iterator to the element following the element of the map. More...
|
|
ConstIteratorType | cbegin () const noexcept |
| Gets an read-only iterator to the beginning of the map. More...
|
|
ConstIteratorType | cend () const noexcept |
| Gets an read-only iterator to the element following the element of the map. More...
|
|
template<class TROW, class TCOL, class TCell>
class hgps::Map2d< TROW, TCOL, TCell >
Defines the two-dimensional map (lookup table) data type.
- Template Parameters
-
TROW | Rows date type |
TCOL | Columns data type |
TCell | Cell value data type |
◆ ConstIteratorType
template<class TROW , class TCOL , class TCell >
◆ IteratorType
template<class TROW , class TCOL , class TCell >
◆ Map2d() [1/2]
template<class TROW , class TCOL , class TCell >
Initialises a new instance of the Map2d class.
◆ Map2d() [2/2]
template<class TROW , class TCOL , class TCell >
hgps::Map2d< TROW, TCOL, TCell >::Map2d |
( |
std::map< TROW, std::map< TCOL, TCell >> && |
data | ) |
|
|
inlinenoexcept |
Initialises a new instance of the Map2d class.
- Parameters
-
data | The lookup table data |
◆ at() [1/2]
template<class TROW , class TCOL , class TCell >
TCell& hgps::Map2d< TROW, TCOL, TCell >::at |
( |
const TROW & |
row_key, |
|
|
const TCOL & |
col_key |
|
) |
| |
|
inline |
Gets a value at a cell by row and column with bounds checking.
- Parameters
-
row_key | The row identifier |
col_key | The column identifier |
- Returns
- The cell value
◆ at() [2/2]
template<class TROW , class TCOL , class TCell >
const TCell& hgps::Map2d< TROW, TCOL, TCell >::at |
( |
const TROW & |
row_key, |
|
|
const TCOL & |
col_key |
|
) |
| const |
|
inline |
Gets a read-only value at a cell by row and column with bounds checking.
- Parameters
-
row_key | The row identifier |
col_key | The column identifier |
- Returns
- The read-only cell value
◆ begin() [1/2]
template<class TROW , class TCOL , class TCell >
Gets an read-only iterator to the beginning of the map.
- Returns
- Iterator to the first element
◆ begin() [2/2]
template<class TROW , class TCOL , class TCell >
Gets an iterator to the beginning of the map.
- Returns
- Iterator to the first element
◆ cbegin()
template<class TROW , class TCOL , class TCell >
Gets an read-only iterator to the beginning of the map.
- Returns
- Iterator to the first element
◆ cend()
template<class TROW , class TCOL , class TCell >
Gets an read-only iterator to the element following the element of the map.
- Returns
- Iterator to the element following the last element.
◆ columns()
template<class TROW , class TCOL , class TCell >
std::size_t hgps::Map2d< TROW, TCOL, TCell >::columns |
( |
| ) |
const |
|
inlinenoexcept |
Gets the number of columns.
- Returns
- Number of columns
◆ contains() [1/2]
template<class TROW , class TCOL , class TCell >
bool hgps::Map2d< TROW, TCOL, TCell >::contains |
( |
const TROW & |
row_key | ) |
const |
|
inline |
Determines whether the container contains a row.
- Parameters
-
row_key | The row identifier |
- Returns
- true, if the contains the row; otherwise, false
◆ contains() [2/2]
template<class TROW , class TCOL , class TCell >
bool hgps::Map2d< TROW, TCOL, TCell >::contains |
( |
const TROW & |
row_key, |
|
|
const TCOL & |
col_key |
|
) |
| const |
|
inline |
Determines whether the container contains a value.
- Parameters
-
row_key | The row identifier |
col_key | The column identifier |
- Returns
- true, if the contains the row; otherwise, false
◆ empty()
template<class TROW , class TCOL , class TCell >
Determine whether the container is empty.
- Returns
- true, if the container is empty; otherwise, false.
◆ end() [1/2]
template<class TROW , class TCOL , class TCell >
Gets an read-only iterator to the element following the element of the map.
- Returns
- Iterator to the element following the last element.
◆ end() [2/2]
template<class TROW , class TCOL , class TCell >
Gets an iterator to the element following the element of the map.
- Returns
- Iterator to the element following the last element.
◆ row() [1/2]
template<class TROW , class TCOL , class TCell >
std::map<TCOL, TCell>& hgps::Map2d< TROW, TCOL, TCell >::row |
( |
const TROW & |
row_key | ) |
|
|
inline |
Gets a row dataset.
- Parameters
-
row_key | The row identifier |
- Returns
- Row dataset
◆ row() [2/2]
template<class TROW , class TCOL , class TCell >
const std::map<TCOL, TCell>& hgps::Map2d< TROW, TCOL, TCell >::row |
( |
const TROW & |
row_key | ) |
const |
|
inline |
Gets a read-row dataset.
- Parameters
-
row_key | The row identifier |
- Returns
- Row dataset
◆ rows()
template<class TROW , class TCOL , class TCell >
std::size_t hgps::Map2d< TROW, TCOL, TCell >::rows |
( |
| ) |
const |
|
inlinenoexcept |
Gets the number of rows.
- Returns
- Number of rows
◆ size()
template<class TROW , class TCOL , class TCell >
std::size_t hgps::Map2d< TROW, TCOL, TCell >::size |
( |
| ) |
const |
|
inlinenoexcept |
Gets the total size of the container dataset.
- Returns
- Total size
The documentation for this class was generated from the following file: