libstdc++
GNU C++ library
Loading...
Searching...
No Matches

◆ _S_setcache_for_incr()

template<class _CharT, class _Alloc>
void __gnu_cxx::_Rope_iterator_base< _CharT, _Alloc >::_S_setcache_for_incr ( _Rope_iterator_base< _CharT, _Alloc > & __x)
staticprotected

Definition at line 185 of file ropeimpl.h.

187 {
188 using std::size_t;
191 size_t __len = __current_node->_M_size;
193 unsigned char __dirns = __x._M_path_directions;
195
197 {
198 /* More stuff in this leaf, we just didn't cache it. */
199 _S_setbuf(__x);
200 return;
201 }
202 // node_start_pos is starting position of last_node.
203 while (--__current_index >= 0)
204 {
205 if (!(__dirns & 1) /* Path turned left */)
206 break;
209 // Otherwise we were in the right child. Thus we should pop
210 // the concatenation node.
211 __node_start_pos -= __c->_M_left->_M_size;
212 __dirns >>= 1;
213 }
214 if (__current_index < 0)
215 {
216 // We underflowed the cache. Punt.
218 return;
219 }
222 // current_node is a concatenation node. We are positioned on the first
223 // character in its right child.
224 // node_start_pos is starting position of current_node.
225 __node_start_pos += __c->_M_left->_M_size;
226 __current_node = __c->_M_right;
228 __dirns |= 1;
229 while (__detail::_S_concat == __current_node->_M_tag)
230 {
233 {
234 int __i;
235 for (__i = 0; __i < int(_S_path_cache_len) - 1; __i++)
238 }
242 __dirns <<= 1;
243 // node_start_pos is unchanged.
244 }
248 _S_setbuf(__x);
249 }
_Rope_RopeRep< _CharT, _Alloc > _RopeRep
Definition rope:1089
static void _S_setbuf(_Rope_iterator_base &__x)
Definition ropeimpl.h:62
unsigned char _M_path_directions
Definition rope:1113
std::size_t _M_current_pos
Definition rope:1094
const _RopeRep * _M_path_end[_S_path_cache_len]
Definition rope:1109
static void _S_setcache(_Rope_iterator_base &__x)
Definition ropeimpl.h:108

References _Rope_iterator_base(), _M_current_pos, _M_leaf_index, _M_leaf_pos, __gnu_cxx::_Rope_RopeConcatenation< _CharT, _Alloc >::_M_left, _M_path_directions, _M_path_end, __gnu_cxx::_Rope_RopeConcatenation< _CharT, _Alloc >::_M_right, __gnu_cxx::_Rope_rep_base< _CharT, _Alloc >::_M_size, __gnu_cxx::_Rope_RopeRep< _CharT, _Alloc >::_M_tag, __gnu_cxx::__detail::_S_concat, _S_path_cache_len, _S_setbuf(), and _S_setcache().

Referenced by _M_incr().

Here is the call graph for this function:
Here is the caller graph for this function: