\( \newcommand{\E}{\mathrm{E}} \) \( \newcommand{\A}{\mathrm{A}} \) \( \newcommand{\R}{\mathrm{R}} \) \( \newcommand{\N}{\mathrm{N}} \) \( \newcommand{\Q}{\mathrm{Q}} \) \( \newcommand{\Z}{\mathrm{Z}} \) \( \def\ccSum #1#2#3{ \sum_{#1}^{#2}{#3} } \def\ccProd #1#2#3{ \sum_{#1}^{#2}{#3} }\)
CGAL 4.7 - STL Extensions for CGAL
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
CGAL::Random_access_adaptor< IC > Class Template Reference

#include <CGAL/iterator.h>

Definition

The class Random_access_adaptor 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 std::vector is used to provide the random access. The iterator or circulator of the data structure are of type IC.

See also
CGAL::Inverse_index<IC>
CGAL::Random_access_value_adaptor<IC,T>

Types

typedef unspecified_type size_type
 size type of the STL std::vector. More...
 

Creation

 Random_access_adaptor ()
 invalid index. More...
 
 Random_access_adaptor (const IC &i)
 empty random access index initialized to start at i. More...
 
 Random_access_adaptor (const IC &i, const IC &j)
 random access index initialized to the range [i,j). More...
 
void reserve (size_type r)
 reserve r entries, if a std::vector is used internally. More...
 

Operations

IC operator[] (size_type n)
 returns iterator or circulator to the n-th item. More...
 
void push_back (const IC &k)
 adds k at the end of the indices. More...
 

Member Typedef Documentation

template<typename IC >
typedef unspecified_type CGAL::Random_access_adaptor< IC >::size_type

size type of the STL std::vector.

Constructor & Destructor Documentation

template<typename IC >
CGAL::Random_access_adaptor< IC >::Random_access_adaptor ( )

invalid index.

template<typename IC >
CGAL::Random_access_adaptor< IC >::Random_access_adaptor ( const IC &  i)

empty random access index initialized to start at i.

template<typename IC >
CGAL::Random_access_adaptor< IC >::Random_access_adaptor ( const IC &  i,
const IC &  j 
)

random access index initialized to the range [i,j).

Member Function Documentation

template<typename IC >
IC CGAL::Random_access_adaptor< IC >::operator[] ( size_type  n)

returns iterator or circulator to the n-th item.

Precondition
n < number of items in the data-structure.
template<typename IC >
void CGAL::Random_access_adaptor< IC >::push_back ( const IC &  k)

adds k at the end of the indices.

template<typename IC >
void CGAL::Random_access_adaptor< IC >::reserve ( size_type  r)

reserve r entries, if a std::vector is used internally.