|
Aleph-w 3.0
A C++ Library for Data Structures and Algorithms
|
Iterator over the vertices of a regular polygon. More...
#include <polygon.H>
Public Member Functions | |
| Vertex_Iterator (const Regular_Polygon &__poly) | |
| Construct iterator from a regular polygon. | |
| bool | has_curr () const |
| Check if there is a current vertex. | |
| Vertex & | get_current_vertex () |
| Get the current vertex. | |
| void | next_ne () noexcept |
| Advance to next vertex (no exception on overflow). | |
| void | next () |
| Advance to next vertex. | |
| void | prev () |
| Move to previous vertex. | |
Private Attributes | |
| const Regular_Polygon & | poly |
| Reference to the polygon. | |
| size_t | curr |
| Current vertex index. | |
| Vertex | vertex |
| Cache for compatibility with Polygon::Vertex_Iterator. | |
Iterator over the vertices of a regular polygon.
This iterator provides the same interface as Polygon::Vertex_Iterator to enable generic code that works with both polygon types.
|
inline |
|
inline |
Get the current vertex.
| std::overflow_error | If no current vertex exists. |
Definition at line 965 of file polygon.H.
References ah_overflow_error_if, curr, Regular_Polygon::get_vertex(), has_curr(), Aleph::maps(), poly, and vertex.
|
inline |
Check if there is a current vertex.
Definition at line 960 of file polygon.H.
References curr, poly, and Regular_Polygon::size().
Referenced by get_current_vertex(), next(), prev(), TEST_F(), and TEST_F().
|
inline |
Advance to next vertex.
| std::overflow_error | If already at end. |
Definition at line 980 of file polygon.H.
References ah_overflow_error_if, has_curr(), Aleph::maps(), and next_ne().
Referenced by TEST_F().
|
inlinenoexcept |
|
inline |
Move to previous vertex.
| std::underflow_error | If already at beginning. |
Definition at line 989 of file polygon.H.
References ah_underflow_error_if, curr, has_curr(), and Aleph::maps().
|
private |
Current vertex index.
Definition at line 946 of file polygon.H.
Referenced by get_current_vertex(), has_curr(), next_ne(), and prev().
|
private |
Reference to the polygon.
Definition at line 945 of file polygon.H.
Referenced by get_current_vertex(), and has_curr().
|
private |
Cache for compatibility with Polygon::Vertex_Iterator.
Definition at line 947 of file polygon.H.
Referenced by get_current_vertex().