The base for the list's iterator classes. More...
Public Types | |
typedef Value | value_type |
typedef value_type * | pointer |
typedef value_type & | reference |
typedef std::bidirectional_iterator_tag | iterator_category |
typedef ptrdiff_t | difference_type |
Public Member Functions | |
~iterator_base () | |
Destructor (Not virtual, since the derived classes are mere shells.) More... | |
iterator_base & | operator= (const iterator_base &that) |
bool | operator== (const iterator_base &that) const |
bool | operator!= (const iterator_base &that) const |
reference | operator* () const |
pointer | operator-> () const |
iterator_base & | operator++ () |
iterator_base & | operator-- () |
iterator_base | operator++ (int) |
iterator_base | operator-- (int) |
bool | derefable () const |
Test for being in a list, rather than past-the-end (or unassigned). More... | |
Protected Member Functions | |
iterator_base () | |
Default constructor. More... | |
iterator_base (node_t *ptr) | |
Initialized constructor. More... | |
template<class V , bool R> | |
iterator_base (const iterator_base< V, R > &that) | |
Conversion constructors. More... | |
iterator_base (const iterator_base &that) | |
Copy constructor (the default overrides the conversion template). More... | |
Private Types | |
typedef smart_list< Data >::node_t | node_t |
Private Member Functions | |
void | advance (bool reverse) |
Advances our pointer to an unflagged node, possibly in the reverse direction. More... | |
void | inc (bool reverse) |
Advances our pointer one step, possibly in the reverse direction. More... | |
void | skip_flagged (bool reverse=Reversed) |
Make sure we are not pointing to a flagged node. More... | |
void | refer () const |
Add a reference. More... | |
Static Private Member Functions | |
static bool | derefable (node_t *ptr) |
Test for being in a list, rather than past-the-end (or unassigned). More... | |
static void | unref (node_t *old_ptr) |
Remove a reference. More... | |
Private Attributes | |
node_t * | ptr_ |
Friends | |
class | smart_list< Data > |
The base for the list's iterator classes.
Value is the value type of this iterator. Reversed is true for the reverse iterators. The actual iterators must have neither data nor destructors.
Definition at line 83 of file smart_list.hpp.
typedef ptrdiff_t utils::smart_list< Data >::iterator_base< Value, Reversed >::difference_type |
Definition at line 94 of file smart_list.hpp.
typedef std::bidirectional_iterator_tag utils::smart_list< Data >::iterator_base< Value, Reversed >::iterator_category |
Definition at line 93 of file smart_list.hpp.
|
private |
Definition at line 86 of file smart_list.hpp.
typedef value_type* utils::smart_list< Data >::iterator_base< Value, Reversed >::pointer |
Definition at line 91 of file smart_list.hpp.
typedef value_type& utils::smart_list< Data >::iterator_base< Value, Reversed >::reference |
Definition at line 92 of file smart_list.hpp.
typedef Value utils::smart_list< Data >::iterator_base< Value, Reversed >::value_type |
Definition at line 90 of file smart_list.hpp.
|
inlineprotected |
Default constructor.
Definition at line 98 of file smart_list.hpp.
|
inlineexplicitprotected |
Initialized constructor.
Definition at line 100 of file smart_list.hpp.
|
inlineprotected |
Conversion constructors.
Definition at line 104 of file smart_list.hpp.
|
inlineprotected |
Copy constructor (the default overrides the conversion template).
Definition at line 107 of file smart_list.hpp.
|
inline |
Destructor (Not virtual, since the derived classes are mere shells.)
Definition at line 112 of file smart_list.hpp.
|
inlineprivate |
Advances our pointer to an unflagged node, possibly in the reverse direction.
This will advance at least one step, and will not stop on a flagged node. In addition, this takes care of updating reference counts. (This is the code shared by increments and decrements.)
Definition at line 782 of file smart_list.hpp.
Referenced by utils::smart_list< Data >::iterator_base< Data, false >::operator++(), and utils::smart_list< Data >::iterator_base< Data, false >::operator--().
|
inline |
Test for being in a list, rather than past-the-end (or unassigned).
Definition at line 159 of file smart_list.hpp.
Referenced by utils::smart_list< Data >::iterator_base< Data, false >::derefable(), utils::smart_list< Data >::smart_list(), and utils::smart_list< Data >::splice().
|
inlinestaticprivate |
Test for being in a list, rather than past-the-end (or unassigned).
Definition at line 164 of file smart_list.hpp.
|
inlineprivate |
Advances our pointer one step, possibly in the reverse direction.
Definition at line 168 of file smart_list.hpp.
|
inline |
Definition at line 132 of file smart_list.hpp.
|
inline |
Definition at line 135 of file smart_list.hpp.
|
inline |
Definition at line 139 of file smart_list.hpp.
|
inline |
Definition at line 141 of file smart_list.hpp.
|
inline |
Definition at line 140 of file smart_list.hpp.
|
inline |
Definition at line 149 of file smart_list.hpp.
|
inline |
Definition at line 136 of file smart_list.hpp.
|
inline |
Definition at line 115 of file smart_list.hpp.
|
inline |
Definition at line 131 of file smart_list.hpp.
|
inlineprivate |
Add a reference.
Add a reference to that to which we point.
Definition at line 809 of file smart_list.hpp.
Referenced by utils::smart_list< Data >::iterator_base< Data, false >::iterator_base(), and utils::smart_list< Data >::iterator_base< Data, false >::operator=().
|
inlineprivate |
Make sure we are not pointing to a flagged node.
Definition at line 800 of file smart_list.hpp.
Referenced by utils::smart_list< Data >::iterator_base< Data, false >::iterator_base().
|
inlinestaticprivate |
Remove a reference.
May delete old_ptr. So call this after updating ptr_ to a new value.
Definition at line 821 of file smart_list.hpp.
References utils::smart_list< Data >::check_erase(), and utils::smart_list< Data >::node_t::ref_count.
Referenced by utils::smart_list< Data >::iterator_base< Data, false >::operator=(), and utils::smart_list< Data >::iterator_base< Data, false >::~iterator_base().
Definition at line 85 of file smart_list.hpp.
|
private |
Definition at line 177 of file smart_list.hpp.
Referenced by utils::smart_list< Data >::iterator_base< Data, false >::derefable(), utils::smart_list< Data >::iterator_base< Data, false >::inc(), utils::smart_list< Data >::iterator_base< Data, false >::operator!=(), utils::smart_list< Data >::iterator_base< Data, false >::operator*(), utils::smart_list< Data >::iterator_base< Data, false >::operator->(), utils::smart_list< Data >::iterator_base< Data, false >::operator=(), utils::smart_list< Data >::iterator_base< Data, false >::operator==(), and utils::smart_list< Data >::iterator_base< Data, false >::~iterator_base().