ReactOS Fundraising Campaign 2012
 
€ 11,198 / € 30,000

Information | Donate

Home | Info | Community | Development | myReactOS | Contact Us

  1. Home
  2. Community
  3. Development
  4. myReactOS
  5. Fundraiser 2012

  1. Main Page
  2. Alphabetical List
  3. Data Structures
  4. Directories
  5. File List
  6. Data Fields
  7. Globals
  8. Related Pages

ReactOS Development > Doxygen

template<class _CharT , class _Alloc >
void _Rope_iterator_base< _CharT, _Alloc >::_S_setcache_for_incr ( _Rope_iterator_base< _CharT, _Alloc > &  __x) [static]

Definition at line 208 of file _rope.c.

                                         {
  int __current_index = __x._M_leaf_index;
  const _RopeRep* __current_node = __x._M_path_end._M_data[__current_index];
  size_t __len = __current_node->_M_size._M_data;
  size_t __node_start_pos = __x._M_leaf_pos;
  unsigned char __dirns = __x._M_path_directions;
  const _RopeConcat* __c;

  _STLP_ASSERT(__x._M_current_pos <= __x._M_root->_M_size._M_data)
  if (__x._M_current_pos - __node_start_pos < __len) {
    /* More stuff in this leaf, we just didn't cache it. */
    _S_setbuf(__x);
    return;
  }
  _STLP_ASSERT(__node_start_pos + __len == __x._M_current_pos)
    //  node_start_pos is starting position of last_node.
  while (--__current_index >= 0) {
    if (!(__dirns & 1) /* Path turned left */)
      break;
    __current_node = __x._M_path_end._M_data[__current_index];
    __c = __STATIC_CAST(const _RopeConcat*, __current_node);
    // Otherwise we were in the right child.  Thus we should pop
    // the concatenation node.
    __node_start_pos -= __c->_M_left->_M_size._M_data;
    __dirns >>= 1;
  }
  if (__current_index < 0) {
    // We underflowed the cache. Punt.
    _S_setcache(__x);
    return;
  }
  __current_node = __x._M_path_end._M_data[__current_index];
  __c = __STATIC_CAST(const _RopeConcat*, __current_node);
  // current_node is a concatenation node.  We are positioned on the first
  // character in its right child.
  // node_start_pos is starting position of current_node.
  __node_start_pos += __c->_M_left->_M_size._M_data;
  __current_node = __c->_M_right;
  __x._M_path_end._M_data[++__current_index] = __current_node;
  __dirns |= 1;
  while (_RopeRep::_S_concat == __current_node->_M_tag) {
    ++__current_index;
    if (_S_path_cache_len == __current_index) {
      int __i;
      for (__i = 0; __i < _S_path_cache_len-1; ++__i) {
        __x._M_path_end._M_data[__i] = __x._M_path_end._M_data[__i+1];
      }
      --__current_index;
    }
    __current_node = __STATIC_CAST(const _RopeConcat*, __current_node)->_M_left;
    __x._M_path_end._M_data[__current_index] = __current_node;
    __dirns <<= 1;
    // node_start_pos is unchanged.
  }
  __x._M_leaf_index = __current_index;
  __x._M_leaf_pos = __node_start_pos;
  __x._M_path_directions = __dirns;
  _S_setbuf(__x);
}

Generated on Thu Oct 25 2012 06:34:21 for ReactOS by doxygen 1.7.6.1

ReactOS is a registered trademark or a trademark of ReactOS Foundation in the United States and other countries.