Navigation: Up, Table of Contents, Bibliography, Index, Title Page

Requirements

A class is said to be a circulator if it fulfills a set of requirements. In the following subsections we give a summary for the requirements of the three different circulator categories. The Section reference arrow presents the formal definition. Note that the stated return values are not required, only a return value that is convertible to the stated type is required.

Forward Circulator (Circulator)

Definition

A class Circulator that satisfies the requirements of a forward circulator for the value type T, supports the following operations.

Types

Circulator::value_type
the value type T.

Circulator::reference
a reference to T.

Circulator::const_reference
a const reference to T.

Circulator::pointer
a pointer to T.

Circulator::const_pointer
a const pointer to T.

Circulator::size_type
unsigned integral type that can hold the size of the data structure.

Circulator::difference_type
signed integral type that can hold the distance between two circulators from the same data structure.

Circulator::iterator_category
the circulator category CGAL_Forward_circulator_tag.

Creation

Circulator c;
a circulator equal to NULL, i.e. a singular value.

Circulator c ( d);
a circulator equal to d.

Operations

bool c = d Assignment.
bool c == NULL Test for emptiness.
bool c != NULL Test for non-emptiness. The result is the same as !(c == NULL).
bool c == d Test for equality: Two circulators are equal if they refer to the same item.
bool c != d Test for inequality. The result is the same as !(c == d).
reference * c Returns the value of the circulator. If Circulator is mutable *c = t is valid.
Precondition: c is dereferenceable.
pointer c -> Returns a pointer to the value of the circulator.
Precondition: c is dereferenceable.
Circulator& ++ c Prefix increment operation.
Precondition: c is dereferenceable.
Postcondition: c is dereferenceable.
Circulator c ++ Postfix increment operation. The result is the same as that of Circulator tmp = c; ++c; return tmp; .

Bidirectional Circulator (Circulator)

Definition

A class Circulator that satisfies the requirements of a bidirectional circulator for the value type T, supports the following operations in addition to the operations supported by a forward circulator.

Types

Circulator::iterator_category
the circulator category CGAL_Bidirectional_circulator_tag.

Operations

Circulator& -- c Prefix decrement operation.
Precondition: c is dereferenceable.
Postcondition: c is dereferenceable.
Circulator c -- Postfix decrement operation. The result is the same as that of Circulator tmp = c; --c; return tmp; .

Random Access Circulator (Circulator)

Definition

A class Circulator that satisfies the requirements of a random access Circulator for the value type T, supports the following operations in addition to the operations supported by a bidirectional Circulator.

Types

Circulator::iterator_category
the circulator category CGAL_Random_access_circulator_tag.

Operations

Circulator& c += difference_type n
The result is the same as if the prefix increment operation was applied n times, but it is computed in constant time.
Circulator c + difference_type n
Same as above, but returns a new circulator.
Circulator difference_type n + c
Same as above.
Circulator& c -= difference_type n
The result is the same as if the prefix decrement operation was applied n times, but it is computed in constant time.
Circulator c - difference_type n
Same as above, but returns a new circulator.
reference c [ difference_type n]
Returns *(c + n).
difference_type c - Circulator d returns the difference between the two circulators within the interval [ 1-s , s-1 ] for a sequence size s. The difference for a fixed circulator c (or d) with all other circulators d (or c) is a consistent ordering of the elements in the data structure. There has to be a minimal circulator dmin for which the difference c- dmin to all other circulators c is non-negative.
Circulator c.min_circulator ()
Returns the minimal circulator cmin (see previous operation) in constant time. If c has a singular value, a singular value is returned.

There are no comparison operators required.


Next: Class declaration of CGAL_..._container_from_circulator<C>
Navigation: Up, Table of Contents, Bibliography, Index, Title Page
The CGAL Project. 22 January 1999.