Public Types | Public Member Functions | Public Attributes | Private Attributes

XIterator0< X, container_type > Class Template Reference

Random Access LOGN Iterator for XIndexedSkipList and XMultiAutoSkipList. More...

#include <CSCompositeSkipList.h>

List of all members.

Public Types

typedef std::iterator
< std::random_access_iterator_tag,
typename
container_type::value_type > 
baseclass
typedef
baseclass::iterator_category 
iterator_category
typedef baseclass::value_type value_type
typedef baseclass::difference_type difference_type
typedef baseclass::pointer pointer
typedef baseclass::reference reference
typedef container_type::data_type data_type
typedef container_type::node_type node_type
typedef container_type::size_type size_type
typedef container_type::mapped_type mapped_type
typedef
container_type::const_mapped_type 
const_mapped_type
typedef
container_type::mapped_type_reference 
mapped_type_reference
typedef
container_type::const_mapped_type_reference 
const_mapped_type_reference
typedef container_type::T0 T0
typedef container_type::T1 T1
typedef XIterator0< X,
container_type > 
self_type

Public Member Functions

 XIterator0 ()
 Default constructor. O(1) (Trivial Iterator)
 XIterator0 (const T0 &t0)
 Copy constructor. O(1) (Output Iterator)
 XIterator0 (const T1 &t1)
 Copy constructor. O(1) (Output Iterator)
 XIterator0 (data_type *data, node_type *p)
 Custom constructor. O(logn)
 XIterator0 (data_type *data, node_type *p, size_type index)
 Custom constructor. O(1)
template<unsigned int nX, class ncontainer_type >
 XIterator0 (const XIterator0< nX, ncontainer_type > &t0)
 Conversion constructor. O(logn)
template<unsigned int nX, class ncontainer_type >
 XIterator0 (const XIterator1< nX, ncontainer_type > &t1)
 Conversion constructor. O(logn)
template<unsigned int nX, class ncontainer_type >
 XIterator0 (const YIterator0< nX, ncontainer_type > &t0)
 Conversion constructor. O(logn)
template<unsigned int nX, class ncontainer_type >
 XIterator0 (const YIterator1< nX, ncontainer_type > &t1)
 Conversion constructor. O(logn)
template<unsigned int nX, class ncontainer_type >
T0 & operator= (const XIterator0< nX, ncontainer_type > &t0)
 Assignment operator. O(logn)
template<unsigned int nX, class ncontainer_type >
T0 & operator= (const XIterator1< nX, ncontainer_type > &t1)
 Assignment operator. O(logn)
template<unsigned int nX, class ncontainer_type >
T0 & operator= (const YIterator0< nX, ncontainer_type > &t0)
 Assignment operator. O(logn)
template<unsigned int nX, class ncontainer_type >
T0 & operator= (const YIterator1< nX, ncontainer_type > &t1)
 Assignment operator. O(logn)
node_type * getNode () const
 Returns internal node. Only use for converting iterators. O(1)
void setNode (node_type *n)
 Set internal node. Internal use only. O(1)
container_type * getContainer () const
 Get current container for this iterator. O(1)
bool operator== (const T0 &other) const
 Equality Operator. O(1) (Trivial Iterator)
bool operator!= (const T0 &other) const
 Not Equal Operator. O(1) (Trivial Iterator)
bool operator== (const T1 &other) const
 Equality Operator. O(1) (Trivial Iterator)
bool operator!= (const T1 &other) const
 Not Equal Operator. O(1) (Trivial Iterator)
T0 & operator++ ()
 Pre Increment Operator. O(1) (Forward Iterator)
T0 operator++ (int)
 Post Increment Operator. O(1) (Forward Iterator)
T0 & operator-- ()
 Pre Decrement Operator. O(1) (Bidirectional Iterator)
T0 operator-- (int)
 Post Decrement Operator. O(1) (Bidirectional Iterator)
reference operator* () const
 Dereference Operator. O(1) (Trivial Iterator)
pointer operator-> () const
 Pointer Operator. O(1) (Trivial Iterator)
bool operator< (const T0 &other) const
 LessThan Operator. O(1) (Random Access Iterator LOGN)
bool operator<= (const T0 &other) const
 LessThanOrEqual Operator. O(1) (Random Access Iterator LOGN)
bool operator> (const T0 &other) const
 GreaterThan Operator. O(1) (Random Access Iterator LOGN)
bool operator>= (const T0 &other) const
 GreaterThanOrEqual Operator. O(1) (Random Access Iterator LOGN)
bool operator< (const T1 &other) const
 LessThan Operator. O(1) (Random Access Iterator LOGN)
bool operator<= (const T1 &other) const
 LessThanOrEqual Operator. O(1) (Random Access Iterator LOGN)
bool operator> (const T1 &other) const
 GreaterThan Operator. O(1) (Random Access Iterator LOGN)
bool operator>= (const T1 &other) const
 GreaterThanOrEqual Operator. O(1) (Random Access Iterator LOGN)
T0 operator+ (difference_type off) const
 Add Operator. O(logn) (Random Access Iterator LOGN)
T0 operator- (difference_type off) const
 Subtract Operator. O(logn) (Random Access Iterator LOGN)
T0 & operator+= (difference_type off)
 AddEqual Operator. O(logn) (Random Access Iterator LOGN)
T0 & operator-= (difference_type off)
 SubtractEqual Operator. O(logn) (Random Access Iterator LOGN)
difference_type operator- (const T0 &other) const
 Subtract iterator Operator. O(1) (Random Access Iterator LOGN)
difference_type operator- (const T1 &other) const
 Subtract iterator Operator. O(1) (Random Access Iterator LOGN)
size_type refresh ()
 Recalculates iterator index. O(logn)
value_type & operator[] (difference_type off) const
 Array Operator. O(logn) (Random Access Iterator LOGN)
size_type getIndex () const
 Get current index. O(1)

Public Attributes

size_type index
 Property for internal container index within node_type. (READ-ONLY)

Private Attributes

data_type * data
 Shared data where list is stored.
size_type Findex
 Index of this iterator.
node_type * FNode
 Node pointed to by this iterator.

Detailed Description

template<unsigned int X, class container_type>
class XIterator0< X, container_type >

Random Access LOGN Iterator for XIndexedSkipList and XMultiAutoSkipList.

Iterators after a deletion or insertion are invalidated (and only for iterators following the inserted or deleted location), but can be revalidated by calling refresh() on the iterator. Iterator preceding the inserted or deleted location remain valid.

The following operations are always valid even on invalidated iterators of this type.

Template Parameters:
XIndex of the internal container within data_type for this iterator.
container_typeType that represents the internal container for this iterator.

Constructor & Destructor Documentation

template<unsigned int X, class container_type>
XIterator0< X, container_type >::XIterator0 ( const T0 &  t0) [inline]

Copy constructor. O(1) (Output Iterator)

Parameters:
t0iterator to copy.
template<unsigned int X, class container_type>
XIterator0< X, container_type >::XIterator0 ( const T1 &  t1) [inline]

Copy constructor. O(1) (Output Iterator)

Parameters:
t1const_iterator to copy.
template<unsigned int X, class container_type>
XIterator0< X, container_type >::XIterator0 ( data_type *  data,
node_type *  p 
) [inline]

Custom constructor. O(logn)

Performance: Index is automatically generated in O(logn).

Parameters:
dataShared data that contains all the elements.
pNode pointed to by this iterator.
template<unsigned int X, class container_type>
XIterator0< X, container_type >::XIterator0 ( data_type *  data,
node_type *  p,
size_type  index 
) [inline]

Custom constructor. O(1)

Performance: Index is automatically generated in O(logn).

Parameters:
dataShared data that contains all the elements.
pNode pointed to by this iterator.
indexIndex of the current node.
template<unsigned int X, class container_type>
template<unsigned int nX, class ncontainer_type >
XIterator0< X, container_type >::XIterator0 ( const XIterator0< nX, ncontainer_type > &  t0) [inline]

Conversion constructor. O(logn)

Converts an iterator from another delegate container within the same composite container.

Template Parameters:
nXIndex of the other delegate container for t0.
ncontainer_typeType that represents the other delegate container for t0.
Parameters:
t0Iterator to convert.
template<unsigned int X, class container_type>
template<unsigned int nX, class ncontainer_type >
XIterator0< X, container_type >::XIterator0 ( const XIterator1< nX, ncontainer_type > &  t1) [inline]

Conversion constructor. O(logn)

Converts a const_iterator from another delegate container within the same composite container.

Template Parameters:
nXIndex of the other delegate container for t0.
ncontainer_typeType that represents the other delegate container for t0.
Parameters:
t1Const_iterator to convert.
template<unsigned int X, class container_type>
template<unsigned int nX, class ncontainer_type >
XIterator0< X, container_type >::XIterator0 ( const YIterator0< nX, ncontainer_type > &  t0) [inline]

Conversion constructor. O(logn)

Converts an iterator from another delegate container within the same composite container.

Template Parameters:
nXIndex of the other delegate container for t0.
ncontainer_typeType that represents the other delegate container for t0.
Parameters:
t0Iterator to convert.
template<unsigned int X, class container_type>
template<unsigned int nX, class ncontainer_type >
XIterator0< X, container_type >::XIterator0 ( const YIterator1< nX, ncontainer_type > &  t1) [inline]

Conversion constructor. O(logn)

Converts a const_iterator from another delegate container within the same composite container.

Template Parameters:
nXIndex of the other delegate container for t0.
ncontainer_typeType that represents the other delegate container for t0.
Parameters:
t1Const_iterator to convert.

Member Function Documentation

template<unsigned int X, class container_type>
template<unsigned int nX, class ncontainer_type >
T0& XIterator0< X, container_type >::operator= ( const XIterator0< nX, ncontainer_type > &  t0) [inline]

Assignment operator. O(logn)

Converts an iterator from another delegate container within the same composite container.

Template Parameters:
nXIndex of the other delegate container for t0.
ncontainer_typeType that represents the other delegate container for t0.
Parameters:
t0Iterator to convert.
Returns:
self reference.
template<unsigned int X, class container_type>
template<unsigned int nX, class ncontainer_type >
T0& XIterator0< X, container_type >::operator= ( const XIterator1< nX, ncontainer_type > &  t1) [inline]

Assignment operator. O(logn)

Converts a const_iterator from another delegate container within the same composite container.

Template Parameters:
nXIndex of the other delegate container for t0.
ncontainer_typeType that represents the other delegate container for t0.
Parameters:
t1Const_iterator to convert.
Returns:
self reference.
template<unsigned int X, class container_type>
template<unsigned int nX, class ncontainer_type >
T0& XIterator0< X, container_type >::operator= ( const YIterator0< nX, ncontainer_type > &  t0) [inline]

Assignment operator. O(logn)

Converts an iterator from another delegate container within the same composite container.

Template Parameters:
nXIndex of the other delegate container for t0.
ncontainer_typeType that represents the other delegate container for t0.
Parameters:
t0Iterator to convert.
Returns:
self reference.
template<unsigned int X, class container_type>
template<unsigned int nX, class ncontainer_type >
T0& XIterator0< X, container_type >::operator= ( const YIterator1< nX, ncontainer_type > &  t1) [inline]

Assignment operator. O(logn)

Converts a const_iterator from another delegate container within the same composite container.

Template Parameters:
nXIndex of the other delegate container for t0.
ncontainer_typeType that represents the other delegate container for t0.
Parameters:
t1Const_iterator to convert.
Returns:
self reference.
template<unsigned int X, class container_type>
bool XIterator0< X, container_type >::operator== ( const T0 &  other) const [inline]

Equality Operator. O(1) (Trivial Iterator)

Parameters:
otheriterator to compare against.
template<unsigned int X, class container_type>
bool XIterator0< X, container_type >::operator!= ( const T0 &  other) const [inline]

Not Equal Operator. O(1) (Trivial Iterator)

Parameters:
otheriterator to compare against.
template<unsigned int X, class container_type>
bool XIterator0< X, container_type >::operator== ( const T1 &  other) const [inline]

Equality Operator. O(1) (Trivial Iterator)

Parameters:
otherconst_iterator to compare against.
template<unsigned int X, class container_type>
bool XIterator0< X, container_type >::operator!= ( const T1 &  other) const [inline]

Not Equal Operator. O(1) (Trivial Iterator)

Parameters:
otherconst_iterator to compare against.
template<unsigned int X, class container_type>
T0& XIterator0< X, container_type >::operator++ ( ) [inline]

Pre Increment Operator. O(1) (Forward Iterator)

iterator points to next node in the list.

Returns:
self reference to iterator after being incremented.
template<unsigned int X, class container_type>
T0 XIterator0< X, container_type >::operator++ ( int  ) [inline]

Post Increment Operator. O(1) (Forward Iterator)

iterator points to next node in the list.

Returns:
incremented copy of iterator.
template<unsigned int X, class container_type>
T0& XIterator0< X, container_type >::operator-- ( ) [inline]

Pre Decrement Operator. O(1) (Bidirectional Iterator)

iterator points to previous node in the list.

Returns:
self reference to iterator after being decremented.
template<unsigned int X, class container_type>
T0 XIterator0< X, container_type >::operator-- ( int  ) [inline]

Post Decrement Operator. O(1) (Bidirectional Iterator)

iterator points to previous node in the list.

Returns:
decremented copy of iterator.
template<unsigned int X, class container_type>
reference XIterator0< X, container_type >::operator* ( ) const [inline]

Dereference Operator. O(1) (Trivial Iterator)

Gain access to value that the iterator points to.

Returns:
Value reference pointed to by this iterator.
template<unsigned int X, class container_type>
pointer XIterator0< X, container_type >::operator-> ( ) const [inline]

Pointer Operator. O(1) (Trivial Iterator)

Gain access to members of of the value pointed to by this iterator.

Returns:
Value pointer pointed to by this iterator.
template<unsigned int X, class container_type>
bool XIterator0< X, container_type >::operator< ( const T0 &  other) const [inline]

LessThan Operator. O(1) (Random Access Iterator LOGN)

Parameters:
otheriterator to compare against.
template<unsigned int X, class container_type>
bool XIterator0< X, container_type >::operator<= ( const T0 &  other) const [inline]

LessThanOrEqual Operator. O(1) (Random Access Iterator LOGN)

Parameters:
otheriterator to compare against.
template<unsigned int X, class container_type>
bool XIterator0< X, container_type >::operator> ( const T0 &  other) const [inline]

GreaterThan Operator. O(1) (Random Access Iterator LOGN)

Parameters:
otheriterator to compare against.
template<unsigned int X, class container_type>
bool XIterator0< X, container_type >::operator>= ( const T0 &  other) const [inline]

GreaterThanOrEqual Operator. O(1) (Random Access Iterator LOGN)

Parameters:
otheriterator to compare against.
template<unsigned int X, class container_type>
bool XIterator0< X, container_type >::operator< ( const T1 &  other) const [inline]

LessThan Operator. O(1) (Random Access Iterator LOGN)

Parameters:
otherconst_iterator to compare against.
template<unsigned int X, class container_type>
bool XIterator0< X, container_type >::operator<= ( const T1 &  other) const [inline]

LessThanOrEqual Operator. O(1) (Random Access Iterator LOGN)

Parameters:
otherconst_iterator to compare against.
template<unsigned int X, class container_type>
bool XIterator0< X, container_type >::operator> ( const T1 &  other) const [inline]

GreaterThan Operator. O(1) (Random Access Iterator LOGN)

Parameters:
otherconst_iterator to compare against.
template<unsigned int X, class container_type>
bool XIterator0< X, container_type >::operator>= ( const T1 &  other) const [inline]

GreaterThanOrEqual Operator. O(1) (Random Access Iterator LOGN)

Parameters:
otherconst_iterator to compare against.
template<unsigned int X, class container_type>
T0 XIterator0< X, container_type >::operator+ ( difference_type  off) const [inline]

Add Operator. O(logn) (Random Access Iterator LOGN)

Parameters:
offoffset from current index.
Returns:
iterator that points to the new location.
template<unsigned int X, class container_type>
T0 XIterator0< X, container_type >::operator- ( difference_type  off) const [inline]

Subtract Operator. O(logn) (Random Access Iterator LOGN)

Parameters:
offnegative offset from current index.
Returns:
iterator that points to the new location.
template<unsigned int X, class container_type>
T0& XIterator0< X, container_type >::operator+= ( difference_type  off) [inline]

AddEqual Operator. O(logn) (Random Access Iterator LOGN)

Parameters:
offoffset from current index.
Returns:
iterator that points to the new location.
template<unsigned int X, class container_type>
T0& XIterator0< X, container_type >::operator-= ( difference_type  off) [inline]

SubtractEqual Operator. O(logn) (Random Access Iterator LOGN)

Parameters:
offnegative offset from current index.
Returns:
iterator that points to the new location.
template<unsigned int X, class container_type>
difference_type XIterator0< X, container_type >::operator- ( const T0 &  other) const [inline]

Subtract iterator Operator. O(1) (Random Access Iterator LOGN)

Parameters:
otheriterator position to subtract.
Returns:
Distance between iterators.
template<unsigned int X, class container_type>
difference_type XIterator0< X, container_type >::operator- ( const T1 &  other) const [inline]

Subtract iterator Operator. O(1) (Random Access Iterator LOGN)

Parameters:
otherconst_iterator position to subtract.
Returns:
Distance between iterators.
template<unsigned int X, class container_type>
size_type XIterator0< X, container_type >::refresh ( ) [inline]

Recalculates iterator index. O(logn)

Use refresh() to recalculate index after performing a destructive operation on the SkipList.

Returns:
Corrected index.
template<unsigned int X, class container_type>
value_type& XIterator0< X, container_type >::operator[] ( difference_type  off) const [inline]

Array Operator. O(logn) (Random Access Iterator LOGN)

Parameters:
offoffset from current index.
Returns:
reference to value at the new location.
template<unsigned int X, class container_type>
size_type XIterator0< X, container_type >::getIndex ( ) const [inline]

Get current index. O(1)

Returns:
Current index.

The documentation for this class was generated from the following file:
 All Classes Files Functions Variables Typedefs