yat
0.14.5pre
|
Container2D is a Container that stores elements in a two-dimensional array (columns and rows). It provides element access of a specific row and column, as well as iterators that can be used to iterate over a specific column or row.
A Container2D provides the following:
Value type | X::value_type | Type of element stored in Container. |
Const reference type | X::const_reference | A type that behaves as const reference to the Container2D 's value type. |
Const iterator type | X::const_iterator | A read-only iterator that can be used to iterate over the entire Container2D. Typically the iterator iterates along a row, and when the end of one row is reached it jumps to the beginning of the next row. |
Const column iterator type | X::const_column_iterator | A read-only iterator that can be used to examine the elements in one column of the Container2D. |
Const row iterator type | X::const_row_iterator | A read-only iterator that can be used to examine the elements in one row of the Container2D. |
Name | Expression | Precondition | Return type | Postcondition |
---|---|---|---|---|
Beginning of range | a.begin() | const_iterator | ||
Beginning of column | a.begin_column(size_t column) | 0 <= column < a.columns() | const_column_iterator | |
Beginning of row | a.begin_row(size_t row) | 0 <= row < a.rows() | const_row_iterator | |
End of range | a.end() | const_iterator | ||
End of column | a.end_column(size_t column) | 0 <= column < a.columns() | const_column_iterator | |
End of row | a.end_row(size_t row) | 0 <= row < a.rows() | const_row_iterator | |
Columns | a.columns() | size_t | ||
Rows | a.rows() | size_t | ||
Element Access | a(size_t row, size_t column) | 0 <= row < a.rows() and 0 <= column < a.columns() | const_reference |
Examples of concept Container2D include: