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

#include <circulator.h>

Public Types

typedef
Circulator_from_container
< Ctnr > 
Self
 
typedef Ctnr Container
 
typedef Ctnr::iterator iterator
 
typedef Ctnr::value_type value_type
 
typedef Ctnr::reference reference
 
typedef value_typepointer
 
typedef Ctnr::size_type size_type
 
typedef Ctnr::difference_type difference_type
 
typedef std::iterator_traits
< iterator
ITraits
 
typedef ITraits::iterator_category Icategory
 
typedef
I_Circulator_from_iterator_traits
< Icategory
CTraits
 
typedef CTraits::iterator_category iterator_category
 

Public Member Functions

 Circulator_from_container ()
 
 Circulator_from_container (Ctnr *c)
 
 Circulator_from_container (Ctnr *c, iterator j)
 
Selfoperator= (const Self &c)
 
bool operator== (CGAL_NULL_TYPE p) const
 
bool operator!= (CGAL_NULL_TYPE p) const
 
bool operator== (const Self &c) const
 
bool operator!= (const Self &c) const
 
reference operator* () const
 
pointer 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 &c) const
 
reference operator[] (difference_type n) const
 
iterator current_iterator () const
 
Self min_circulator () const
 
Ctnr * container () const
 

Private Attributes

Ctnr * ctnr
 
iterator i
 

Detailed Description

template<class Ctnr>
class Circulator_from_container< Ctnr >

Definition at line 768 of file circulator.h.

Member Typedef Documentation

typedef Ctnr Container

Definition at line 773 of file circulator.h.

Definition at line 783 of file circulator.h.

typedef Ctnr::difference_type difference_type

Definition at line 779 of file circulator.h.

typedef ITraits::iterator_category Icategory

Definition at line 782 of file circulator.h.

typedef Ctnr::iterator iterator

Definition at line 774 of file circulator.h.

Definition at line 784 of file circulator.h.

typedef std::iterator_traits<iterator> ITraits

Definition at line 781 of file circulator.h.

typedef value_type* pointer

Definition at line 777 of file circulator.h.

typedef Ctnr::reference reference

Definition at line 776 of file circulator.h.

Definition at line 772 of file circulator.h.

typedef Ctnr::size_type size_type

Definition at line 778 of file circulator.h.

typedef Ctnr::value_type value_type

Definition at line 775 of file circulator.h.

Constructor & Destructor Documentation

Definition at line 793 of file circulator.h.

793 : ctnr(NULL) {}
Circulator_from_container ( Ctnr *  c)
inline

Definition at line 794 of file circulator.h.

794 : ctnr(c), i(c->begin()) {}
Circulator_from_container ( Ctnr *  c,
iterator  j 
)
inline

Definition at line 795 of file circulator.h.

795 : ctnr(c), i(j) {}
j indices j
Definition: Indexing.h:6

Member Function Documentation

Ctnr* container ( ) const
inline

Definition at line 887 of file circulator.h.

References Circulator_from_container< Ctnr >::ctnr.

887 { return ctnr; }
iterator current_iterator ( ) const
inline

Definition at line 885 of file circulator.h.

References Circulator_from_container< Ctnr >::i.

885 { return i;}
Self min_circulator ( ) const
inline

Definition at line 886 of file circulator.h.

References Circulator_from_container< Ctnr >::ctnr.

886 { return Self(ctnr); }
Circulator_from_container< Ctnr > Self
Definition: circulator.h:772
bool operator!= ( CGAL_NULL_TYPE  p) const
inline

Definition at line 810 of file circulator.h.

810 { return !(*this == p); }
bool operator!= ( const Self c) const
inline

Definition at line 812 of file circulator.h.

812 { return !(*this == c); }
reference operator* ( ) const
inline

Definition at line 813 of file circulator.h.

References CGAL_assertion, Circulator_from_container< Ctnr >::ctnr, and Circulator_from_container< Ctnr >::i.

813  {
814  CGAL_assertion( ctnr != NULL);
815  CGAL_assertion( i != ctnr->end());
816  return *i;
817  }
#define CGAL_assertion(EX)
Definition: assertions.h:87
Self operator+ ( difference_type  n) const
inline

Definition at line 866 of file circulator.h.

References n.

866  {
867  Self tmp = *this;
868  return tmp += n;
869  }
const NT & n
Circulator_from_container< Ctnr > Self
Definition: circulator.h:772
Self& operator++ ( )
inline

Definition at line 823 of file circulator.h.

References CGAL_assertion, Circulator_from_container< Ctnr >::ctnr, and Circulator_from_container< Ctnr >::i.

823  {
824  CGAL_assertion( ctnr != NULL);
825  CGAL_assertion( i != ctnr->end());
826  ++i;
827  if ( i == ctnr->end())
828  i = ctnr->begin();
829  return *this;
830  }
#define CGAL_assertion(EX)
Definition: assertions.h:87
Self operator++ ( int  )
inline

Definition at line 831 of file circulator.h.

831  {
832  Self tmp= *this;
833  ++*this;
834  return tmp;
835  }
Circulator_from_container< Ctnr > Self
Definition: circulator.h:772
Circulator_from_container< Ctnr > & operator+= ( typename Ctnr::difference_type  n)

Definition at line 903 of file circulator.h.

References CGAL_assertion, j, and non_negative_mod().

Referenced by Circulator_from_container< Ctnr >::operator-=().

903  {
904  CGAL_assertion( ctnr != NULL);
905  CGAL_assertion( i != ctnr->end());
906  typename Ctnr::difference_type j = i - ctnr->begin();
907  typename Ctnr::difference_type size = ctnr->size();
908  CGAL_assertion( j >= 0);
909  CGAL_assertion( size >= 0);
910  j = non_negative_mod( j + n, size);
911  CGAL_assertion( j >= 0);
912  CGAL_assertion( j < size);
913  i = ctnr->begin() + j;
914  return *this;
915 }
#define CGAL_assertion(EX)
Definition: assertions.h:87
const NT & n
I non_negative_mod(I n, U m)
Definition: circulator.h:523
j indices j
Definition: Indexing.h:6

Here is the call graph for this function:

Here is the caller graph for this function:

Self operator- ( difference_type  n) const
inline

Definition at line 871 of file circulator.h.

References n.

871  {
872  Self tmp = *this;
873  return tmp += -n;
874  }
const NT & n
Circulator_from_container< Ctnr > Self
Definition: circulator.h:772
difference_type operator- ( const Self c) const
inline

Definition at line 875 of file circulator.h.

References CGAL_assertion, Circulator_from_container< Ctnr >::ctnr, and Circulator_from_container< Ctnr >::i.

875  {
876  CGAL_assertion( ctnr != NULL);
877  CGAL_assertion( c.ctnr != NULL);
878  return i - c.i;
879  }
#define CGAL_assertion(EX)
Definition: assertions.h:87
Self& operator-- ( )
inline

Definition at line 836 of file circulator.h.

References CGAL_assertion, Circulator_from_container< Ctnr >::ctnr, and Circulator_from_container< Ctnr >::i.

836  {
837  CGAL_assertion( ctnr != NULL);
838  CGAL_assertion( i != ctnr->end());
839  if ( i == ctnr->begin())
840  i = ctnr->end();
841  --i;
842  return *this;
843  }
#define CGAL_assertion(EX)
Definition: assertions.h:87
Self operator-- ( int  )
inline

Definition at line 844 of file circulator.h.

844  {
845  Self tmp = *this;
846  --*this;
847  return tmp;
848  }
Circulator_from_container< Ctnr > Self
Definition: circulator.h:772
Self& operator-= ( difference_type  n)
inline

Definition at line 870 of file circulator.h.

References Circulator_from_container< Ctnr >::operator+=().

870 { return operator+=( -n); }
Self & operator+=(difference_type n)
Definition: circulator.h:903
const NT & n

Here is the call graph for this function:

pointer operator-> ( ) const
inline

Definition at line 818 of file circulator.h.

References CGAL_assertion, and Circulator_from_container< Ctnr >::ctnr.

818  {
819  CGAL_assertion( ctnr != NULL);
820  CGAL_assertion( i != ctnr->end());
821  return i.operator->();
822  }
#define CGAL_assertion(EX)
Definition: assertions.h:87
Self& operator= ( const Self c)
inline

Definition at line 798 of file circulator.h.

References Circulator_from_container< Ctnr >::ctnr, and Circulator_from_container< Ctnr >::i.

798  {
799  ctnr = c.ctnr;
800  i = c.i;
801  return *this;
802  }
bool operator== ( CGAL_NULL_TYPE  p) const
inline

Definition at line 806 of file circulator.h.

References CGAL_assertion, CGAL_CIRC_NULL, and Circulator_from_container< Ctnr >::ctnr.

806  {
808  return (ctnr == NULL) || (ctnr->begin() == ctnr->end());
809  }
#define CGAL_assertion(EX)
Definition: assertions.h:87
#define CGAL_CIRC_NULL
Definition: circulator.h:81
bool operator== ( const Self c) const
inline

Definition at line 811 of file circulator.h.

References Circulator_from_container< Ctnr >::i.

811 { return i == c.i; }
reference operator[] ( difference_type  n) const
inline

Definition at line 880 of file circulator.h.

References n.

880  {
881  Self tmp = *this;
882  tmp += n;
883  return *tmp;
884  }
const NT & n
Circulator_from_container< Ctnr > Self
Definition: circulator.h:772

Member Data Documentation


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