Rocstar  1.0
Rocstar multiphysics simulation application
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Iterator_from_circulator< C, Ref, Ptr > Class Template Reference

#include <circulator.h>

Public Types

typedef C Circulator
 
typedef
Iterator_from_circulator< C,
Ref, Ptr > 
Self
 
typedef
I__traits::iterator_category 
iterator_category
 
typedef C::value_type value_type
 
typedef C::difference_type difference_type
 
typedef C::size_type size_type
 
typedef C::reference reference
 
typedef C::pointer pointer
 

Public Member Functions

 Iterator_from_circulator ()
 
 Iterator_from_circulator (const C *circ, int n)
 
template<class CC , class CREF , class CPTR >
 Iterator_from_circulator (const Iterator_from_circulator< CC, CREF, CPTR > &c)
 
bool operator== (const Self &i) const
 
bool operator!= (const Self &i) const
 
Ref operator* () const
 
Ptr operator-> () const
 
Selfoperator++ ()
 
Self operator++ (int)
 
Selfoperator-- ()
 
Self operator-- (int)
 
Selfoperator+= (difference_type n)
 
Self operator+ (difference_type n) const
 
Selfoperator-= (difference_type n)
 
Self operator- (difference_type n) const
 
difference_type operator- (const Self &i) const
 
Ref operator[] (difference_type n) const
 
bool operator< (const Self &i) const
 
bool operator> (const Self &i) const
 
bool operator<= (const Self &i) const
 
bool operator>= (const Self &i) const
 
const C * anchor () const
 
int winding () const
 
Circulator current_circulator () const
 

Private Types

typedef std::iterator_traits< C > I_traits
 
typedef I_traits::iterator_category I_Iter_cat
 
typedef
I_Iterator_from_circulator_traits
< I_Iter_cat
I__traits
 

Private Attributes

const C * m_anchor
 
current
 
int m_winding
 

Detailed Description

template<class C, class Ref, class Ptr>
class Iterator_from_circulator< C, Ref, Ptr >

Definition at line 538 of file circulator.h.

Member Typedef Documentation

typedef C Circulator

Definition at line 553 of file circulator.h.

typedef C::difference_type difference_type

Definition at line 559 of file circulator.h.

Definition at line 547 of file circulator.h.

typedef I_traits::iterator_category I_Iter_cat
private

Definition at line 546 of file circulator.h.

typedef std::iterator_traits<C> I_traits
private

Definition at line 545 of file circulator.h.

Definition at line 556 of file circulator.h.

typedef C::pointer pointer

Definition at line 562 of file circulator.h.

typedef C::reference reference

Definition at line 561 of file circulator.h.

typedef Iterator_from_circulator<C,Ref,Ptr> Self

Definition at line 554 of file circulator.h.

typedef C::size_type size_type

Definition at line 560 of file circulator.h.

typedef C::value_type value_type

Definition at line 558 of file circulator.h.

Constructor & Destructor Documentation

Definition at line 567 of file circulator.h.

Iterator_from_circulator ( const C *  circ,
int  n 
)
inline

Definition at line 569 of file circulator.h.

570  : m_anchor( circ), current( *circ), m_winding(n) {}
const NT & n
Iterator_from_circulator ( const Iterator_from_circulator< CC, CREF, CPTR > &  c)
inline

Definition at line 575 of file circulator.h.

577  : m_anchor( c.anchor()), current( c.current_circulator()),
578  m_winding(c.winding()) {}
Circulator current_circulator() const
Definition: circulator.h:684
const C * anchor() const
Definition: circulator.h:682

Member Function Documentation

const C* anchor ( ) const
inline

Definition at line 682 of file circulator.h.

References Iterator_from_circulator< C, Ref, Ptr >::m_anchor.

682 { return m_anchor;}
Circulator current_circulator ( ) const
inline

Definition at line 684 of file circulator.h.

References Iterator_from_circulator< C, Ref, Ptr >::current.

684 { return current;}
bool operator!= ( const Self i) const
inline

Definition at line 587 of file circulator.h.

References i.

587  {
588  return !(*this == i);
589  }
blockLoc i
Definition: read.cpp:79
Ref operator* ( ) const
inline
Self operator+ ( difference_type  n) const
inline

Definition at line 636 of file circulator.h.

References n.

636  {
637  Self tmp = *this;
638  return tmp += n;
639  }
const NT & n
Iterator_from_circulator< C, Ref, Ptr > Self
Definition: circulator.h:554
Self& operator++ ( )
inline
Self operator++ ( int  )
inline

Definition at line 608 of file circulator.h.

608  {
609  Self tmp = *this;
610  ++*this;
611  return tmp;
612  }
Iterator_from_circulator< C, Ref, Ptr > Self
Definition: circulator.h:554
Self& operator+= ( difference_type  n)
inline

Definition at line 626 of file circulator.h.

References CGAL_assertion, CGAL_CIRC_NULL, Iterator_from_circulator< C, Ref, Ptr >::current, Iterator_from_circulator< C, Ref, Ptr >::m_anchor, Iterator_from_circulator< C, Ref, Ptr >::m_winding, and n.

Referenced by Iterator_from_circulator< C, Ref, Ptr >::operator-=().

626  {
629  if ( n < 0 && current == *m_anchor) // We are leaving the anchor.
630  --m_winding;
631  current += n;
632  if ( n > 0 && current == *m_anchor) // Back again at the anchor.
633  ++m_winding;
634  return *this;
635  }
#define CGAL_assertion(EX)
Definition: assertions.h:87
#define CGAL_CIRC_NULL
Definition: circulator.h:81
const NT & n

Here is the caller graph for this function:

Self operator- ( difference_type  n) const
inline

Definition at line 643 of file circulator.h.

References n.

643  {
644  Self tmp = *this;
645  return tmp += -n;
646  }
const NT & n
Iterator_from_circulator< C, Ref, Ptr > Self
Definition: circulator.h:554
C::difference_type operator- ( const Self i) const

Definition at line 698 of file circulator.h.

References CGAL_assertion, CGAL_CIRC_NULL, Iterator_from_circulator< C, Ref, Ptr >::current, I_min_circulator_size(), Iterator_from_circulator< C, Ref, Ptr >::m_anchor, and Iterator_from_circulator< C, Ref, Ptr >::m_winding.

698  {
701  CGAL_assertion( m_anchor == i.m_anchor);
702  if ( m_winding != i.m_winding) {
704  return (current - *m_anchor) - (i.current - *m_anchor)
705  + s * (m_winding - i.m_winding);
706  }
707  return (current - *m_anchor) - (i.current - *m_anchor);
708 }
#define CGAL_assertion(EX)
Definition: assertions.h:87
double s
Definition: blastest.C:80
C::difference_type difference_type
Definition: circulator.h:559
#define CGAL_CIRC_NULL
Definition: circulator.h:81
blockLoc i
Definition: read.cpp:79
C::size_type I_min_circulator_size(const C &c)
Definition: circulator.h:403

Here is the call graph for this function:

Self& operator-- ( )
inline
Self operator-- ( int  )
inline

Definition at line 621 of file circulator.h.

621  {
622  Self tmp = *this;
623  --*this;
624  return tmp;
625  }
Iterator_from_circulator< C, Ref, Ptr > Self
Definition: circulator.h:554
Self& operator-= ( difference_type  n)
inline

Definition at line 640 of file circulator.h.

References Iterator_from_circulator< C, Ref, Ptr >::operator+=().

640  {
641  return operator+=( -n);
642  }
Self & operator+=(difference_type n)
Definition: circulator.h:626
const NT & n

Here is the call graph for this function:

Ptr operator-> ( ) const
inline

Definition at line 595 of file circulator.h.

References CGAL_assertion, CGAL_CIRC_NULL, Iterator_from_circulator< C, Ref, Ptr >::current, and Iterator_from_circulator< C, Ref, Ptr >::m_anchor.

595  {
598  return Ptr(current.operator->());
599  }
#define CGAL_assertion(EX)
Definition: assertions.h:87
#define CGAL_CIRC_NULL
Definition: circulator.h:81
bool operator< ( const Self i) const
inline

Definition at line 668 of file circulator.h.

References CGAL_assertion, CGAL_CIRC_NULL, Iterator_from_circulator< C, Ref, Ptr >::current, Iterator_from_circulator< C, Ref, Ptr >::m_anchor, and Iterator_from_circulator< C, Ref, Ptr >::m_winding.

668  {
671  CGAL_assertion( m_anchor == i.m_anchor);
672  return ( (m_winding < i.m_winding)
673  || ( (m_winding == i.m_winding)
674  && (current - *m_anchor) < (i.current - *m_anchor)
675  )
676  );
677  }
#define CGAL_assertion(EX)
Definition: assertions.h:87
#define CGAL_CIRC_NULL
Definition: circulator.h:81
blockLoc i
Definition: read.cpp:79
bool operator<= ( const Self i) const
inline

Definition at line 679 of file circulator.h.

679 { return !(i < *this); }
blockLoc i
Definition: read.cpp:79
bool operator== ( const Self i) const
inline

Definition at line 583 of file circulator.h.

References CGAL_assertion, Iterator_from_circulator< C, Ref, Ptr >::current, Iterator_from_circulator< C, Ref, Ptr >::m_anchor, and Iterator_from_circulator< C, Ref, Ptr >::m_winding.

583  {
584  CGAL_assertion( m_anchor == i.m_anchor); // same anchor?
585  return ( current == i.current) && ( m_winding == i.m_winding);
586  }
#define CGAL_assertion(EX)
Definition: assertions.h:87
blockLoc i
Definition: read.cpp:79
bool operator> ( const Self i) const
inline

Definition at line 678 of file circulator.h.

678 { return i < *this; }
blockLoc i
Definition: read.cpp:79
bool operator>= ( const Self i) const
inline

Definition at line 680 of file circulator.h.

References i.

680 { return !(*this < i); }
blockLoc i
Definition: read.cpp:79
Ref operator[] ( difference_type  n) const
inline

Definition at line 663 of file circulator.h.

References n.

663  {
664  Self tmp = *this;
665  tmp += n;
666  return tmp.operator*();
667  }
const NT & n
Iterator_from_circulator< C, Ref, Ptr > Self
Definition: circulator.h:554
int winding ( ) const
inline

Definition at line 683 of file circulator.h.

References Iterator_from_circulator< C, Ref, Ptr >::m_winding.

683 { return m_winding;}

Member Data Documentation


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