#include <vecincaccess.h>
Public Member Functions | |
_Data * | inc_search (Index index) |
Protected Member Functions | |
iterator (VecIncAccess< _Data > *p, typename std::vector< Node >::iterator it) | |
bool | checkIncSearch (const typename std::vector< Node >::const_iterator &it, unsigned index) const |
Protected Attributes | |
VecIncAccess< _Data > * | p |
std::vector< Node >::iterator | it |
Friends | |
class | VecIncAccess< _Data > |
Definition at line 42 of file vecincaccess.h.
VecIncAccess< _Data >::iterator::iterator | ( | VecIncAccess< _Data > * | p, | |
typename std::vector< Node >::iterator | it | |||
) | [inline, protected] |
Definition at line 52 of file vecincaccess.h.
bool VecIncAccess< _Data >::iterator::checkIncSearch | ( | const typename std::vector< Node >::const_iterator & | it, | |
unsigned | index | |||
) | const [inline, protected] |
Definition at line 57 of file vecincaccess.h.
00058 { 00059 if (index == INDEX_MAX) 00060 return false; 00061 00062 if (it == p->m_list.end()) 00063 return false; 00064 00065 if (it != p->m_list.begin()) 00066 { 00067 typename std::vector<Node>::const_iterator itprev=it; 00068 itprev--; 00069 if (index < itprev->index) 00070 return false; 00071 } 00072 return true; 00073 }
_Data* VecIncAccess< _Data >::iterator::inc_search | ( | Index | index | ) | [inline] |
Definition at line 80 of file vecincaccess.h.
00081 { 00082 assert(checkIncSearch(it,index)); 00083 if (index < it->index) 00084 return NULL; 00085 else if (index == it->index) 00086 return &(it->data); 00087 else 00088 { 00089 it++; 00090 if (index < it->index) 00091 return NULL; 00092 else 00093 { 00094 assert(index == it->index); 00095 return &(it->data); 00096 } 00097 } 00098 00099 }
friend class VecIncAccess< _Data > [friend] |
Definition at line 44 of file vecincaccess.h.
std::vector<Node>::iterator VecIncAccess< _Data >::iterator::it [protected] |
Definition at line 49 of file vecincaccess.h.
VecIncAccess<_Data>* VecIncAccess< _Data >::iterator::p [protected] |
Definition at line 48 of file vecincaccess.h.