Rocstar  1.0
Rocstar multiphysics simulation application
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Random_access_adaptor< IC > Class Template Reference

#include <Random_access_adaptor.h>

Inheritance diagram for Random_access_adaptor< IC >:
Collaboration diagram for Random_access_adaptor< IC >:

Public Types

typedef Index::size_type size_type
 
typedef IC iterator
 
typedef IC Circulator
 

Public Member Functions

void init_index (IC i, const IC &j, std::forward_iterator_tag)
 
void init_index (const IC &i, const IC &j, std::bidirectional_iterator_tag)
 
void init_index (const IC &i, const IC &, std::random_access_iterator_tag)
 
void init_index (const IC &i, const IC &j)
 
void reserve (size_type r, std::forward_iterator_tag)
 
void reserve (size_type r, std::bidirectional_iterator_tag)
 
void reserve (size_type, std::random_access_iterator_tag)
 
void push_back (const IC &k, std::forward_iterator_tag)
 
void push_back (const IC &k, std::bidirectional_iterator_tag)
 
void push_back (const IC &, std::random_access_iterator_tag)
 
const IC & find (size_type n, std::forward_iterator_tag) const
 
const IC & find (size_type n, std::bidirectional_iterator_tag) const
 
IC find (size_type n, std::random_access_iterator_tag) const
 
 Random_access_adaptor ()
 
 Random_access_adaptor (const IC &i)
 
 Random_access_adaptor (const IC &i, const IC &j)
 
void reserve (size_type r)
 
IC find (size_type n) const
 
IC operator[] (size_type n) const
 
void push_back (const IC &k)
 

Protected Types

typedef std::vector< IC > Index
 

Protected Attributes

Index index
 
IC start
 

Detailed Description

template<class IC>
class Random_access_adaptor< IC >

Definition at line 61 of file Random_access_adaptor.h.

Member Typedef Documentation

typedef IC Circulator

Definition at line 133 of file Random_access_adaptor.h.

typedef std::vector< IC> Index
protected

Definition at line 75 of file Random_access_adaptor.h.

typedef IC iterator

Definition at line 132 of file Random_access_adaptor.h.

typedef Index::size_type size_type

Definition at line 80 of file Random_access_adaptor.h.

Constructor & Destructor Documentation

Definition at line 135 of file Random_access_adaptor.h.

Random_access_adaptor ( const IC &  i)
inline

Definition at line 138 of file Random_access_adaptor.h.

138 : start(i) {}
blockLoc i
Definition: read.cpp:79
Random_access_adaptor ( const IC &  i,
const IC &  j 
)
inline

Definition at line 141 of file Random_access_adaptor.h.

141  : start(i) {
142  // random access index initialized with range [i,j).
143  init_index( i, j);
144  }
void init_index(IC i, const IC &j, std::forward_iterator_tag)
blockLoc i
Definition: read.cpp:79
j indices j
Definition: Indexing.h:6

Member Function Documentation

const IC& find ( size_type  n,
std::forward_iterator_tag   
) const
inline

Definition at line 120 of file Random_access_adaptor.h.

Referenced by Random_access_adaptor< Vertex_iterator >::find(), and Random_access_adaptor< Vertex_iterator >::operator[]().

120  {
121  // returns inverse index of k.
122  CGAL_assertion( n < index.size());
123  return index[n];
124  }
#define CGAL_assertion(EX)
Definition: assertions.h:87
const NT & n

Here is the caller graph for this function:

const IC& find ( size_type  n,
std::bidirectional_iterator_tag   
) const
inline

Definition at line 125 of file Random_access_adaptor.h.

125  {
126  return find( n, std::forward_iterator_tag());
127  }
const IC & find(size_type n, std::forward_iterator_tag) const
const NT & n
IC find ( size_type  n,
std::random_access_iterator_tag   
) const
inline

Definition at line 128 of file Random_access_adaptor.h.

128  {
129  return start + n;
130  }
const NT & n
IC find ( size_type  n) const
inline

Definition at line 159 of file Random_access_adaptor.h.

159  {
160  // returns inverse index of k.
161 #if !defined(CGAL_CFG_NO_ITERATOR_TRAITS) || \
162  defined(CGAL_LIMITED_ITERATOR_TRAITS_SUPPORT)
163  typedef typename std::iterator_traits<IC>::iterator_category ICC;
164  return find( n, ICC());
165 #else
166  return find( n, std::iterator_category( IC()));
167 #endif
168  }
const IC & find(size_type n, std::forward_iterator_tag) const
const NT & n
void init_index ( IC  i,
const IC &  j,
std::forward_iterator_tag   
)

Definition at line 186 of file Random_access_adaptor.h.

References is_empty_range().

Referenced by Random_access_adaptor< Vertex_iterator >::init_index(), and Random_access_adaptor< Vertex_iterator >::Random_access_adaptor().

187  {
188  if ( ! is_empty_range( i, j)) {
189  do {
190  index.push_back( i);
191  } while ((++i) != (j));
192  }
193 }
bool is_empty_range(const IC &ic1, const IC &ic2)
Definition: circulator.h:362
blockLoc i
Definition: read.cpp:79
j indices j
Definition: Indexing.h:6

Here is the call graph for this function:

Here is the caller graph for this function:

void init_index ( const IC &  i,
const IC &  j,
std::bidirectional_iterator_tag   
)
inline

Definition at line 83 of file Random_access_adaptor.h.

84  {
85  init_index( i, j, std::forward_iterator_tag());
86  }
void init_index(IC i, const IC &j, std::forward_iterator_tag)
blockLoc i
Definition: read.cpp:79
j indices j
Definition: Indexing.h:6
void init_index ( const IC &  i,
const IC &  ,
std::random_access_iterator_tag   
)
inline

Definition at line 87 of file Random_access_adaptor.h.

88  {
89  start = i;
90  }
blockLoc i
Definition: read.cpp:79
void init_index ( const IC &  i,
const IC &  j 
)
inline

Definition at line 91 of file Random_access_adaptor.h.

91  {
92 #if !defined(CGAL_CFG_NO_ITERATOR_TRAITS) || \
93  defined(CGAL_LIMITED_ITERATOR_TRAITS_SUPPORT)
94  typedef typename std::iterator_traits<IC>::iterator_category ICC;
95  init_index( i, j, ICC());
96 #else
97  init_index( i, j, std::iterator_category( i));
98 #endif
99  }
void init_index(IC i, const IC &j, std::forward_iterator_tag)
blockLoc i
Definition: read.cpp:79
j indices j
Definition: Indexing.h:6
IC operator[] ( size_type  n) const
inline

Definition at line 170 of file Random_access_adaptor.h.

Referenced by Random_access_value_adaptor< Vertex_iterator, Vertex >::operator[]().

170 { return find(n); }
const IC & find(size_type n, std::forward_iterator_tag) const
const NT & n

Here is the caller graph for this function:

void push_back ( const IC &  k,
std::forward_iterator_tag   
)
inline

Definition at line 111 of file Random_access_adaptor.h.

Referenced by Polyhedron_incremental_builder_3< HDS >::add_vertex(), and Random_access_adaptor< Vertex_iterator >::push_back().

111  {
112  index.push_back(k);
113  }
j indices k indices k
Definition: Indexing.h:6

Here is the caller graph for this function:

void push_back ( const IC &  k,
std::bidirectional_iterator_tag   
)
inline

Definition at line 114 of file Random_access_adaptor.h.

114  {
115  push_back( k, std::forward_iterator_tag());
116  }
j indices k indices k
Definition: Indexing.h:6
void push_back(const IC &k, std::forward_iterator_tag)
void push_back ( const IC &  ,
std::random_access_iterator_tag   
)
inline

Definition at line 117 of file Random_access_adaptor.h.

117 {}
void push_back ( const IC &  k)
inline

Definition at line 172 of file Random_access_adaptor.h.

172  {
173  // adds k at the end of the indices.
174 #if !defined(CGAL_CFG_NO_ITERATOR_TRAITS) || \
175  defined(CGAL_LIMITED_ITERATOR_TRAITS_SUPPORT)
176  typedef typename std::iterator_traits<IC>::iterator_category ICC;
177  push_back( k, ICC());
178 #else
179  push_back( k, std::iterator_category( k));
180 #endif
181  }
j indices k indices k
Definition: Indexing.h:6
void push_back(const IC &k, std::forward_iterator_tag)
void reserve ( size_type  r,
std::forward_iterator_tag   
)
inline

Definition at line 102 of file Random_access_adaptor.h.

Referenced by Polyhedron_incremental_builder_3< HDS >::begin_surface(), and Random_access_adaptor< Vertex_iterator >::reserve().

102  {
103  index.reserve( r);
104  }

Here is the caller graph for this function:

void reserve ( size_type  r,
std::bidirectional_iterator_tag   
)
inline

Definition at line 105 of file Random_access_adaptor.h.

105  {
106  reserve( r, std::forward_iterator_tag());
107  }
void reserve(size_type r, std::forward_iterator_tag)
void reserve ( size_type  ,
std::random_access_iterator_tag   
)
inline

Definition at line 108 of file Random_access_adaptor.h.

108 {}
void reserve ( size_type  r)
inline

Definition at line 146 of file Random_access_adaptor.h.

146  {
147  // reserve r entries, if a `vector' is used internally.
148 #if !defined(CGAL_CFG_NO_ITERATOR_TRAITS) || \
149  defined(CGAL_LIMITED_ITERATOR_TRAITS_SUPPORT)
150  typedef typename std::iterator_traits<IC>::iterator_category ICC;
151  reserve( r, ICC());
152 #else
153  reserve( r, std::iterator_category( IC()));
154 #endif
155  }
void reserve(size_type r, std::forward_iterator_tag)

Member Data Documentation


The documentation for this class was generated from the following file: