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

A Random Access Adaptor for Iterators and Circulators

Definition

The class CGAL_Random_access_adaptor<IC> provides a random access for data structures. Either the data structure supports random access iterators or circulators where this class maps function calls to the iterator or circulator, or a STL vector is used to provide the random access. The iterator or circulator of the data structure are of type IC.

#include <CGAL/Random_access_adaptor.h>

Types

CGAL_Random_access_adaptor<IC>::size_type
size type of the STL vector.

Creation

CGAL_Random_access_adaptor<IC> random_access;
invalid index.

CGAL_Random_access_adaptor<IC> random_access ( IC i);
empty random access index initialized to start at i.

CGAL_Random_access_adaptor<IC> random_access ( IC i, IC j);
random access index initialized to the range [i,j).

void random_access.reserve ( size_type r)
reserve r entries, if a vector is used internally.

Operations

IC random_access [ size_type n]
returns iterator or circulator to the n-th item.
Precondition: n < number of items in random_access.
void random_access.push_back ( IC k)
adds k at the end of the indices.

See Also

CGAL_Inverse_index and CGAL_Random_access_value_adaptor.


Next: Class declaration of CGAL_Random_access_value_adaptor<IC,T>
Navigation: Up, Table of Contents, Bibliography, Index, Title Page
The CGAL Project. 22 January 1999.