5 for(
size_t w = source.
find_first(
true, 0, sourceCount); w < sourceCount; w = source.
find_next(
true, w, sourceCount ) ) {
16 }
else if (count > 0) {
18 if (v == NULL || *v > start+count)
return start + count;
20 }
else if (count < 0) {
22 if (v == NULL || *v < start+count)
return start + count;
34 m_content.prealloc( 1024 );
38 m_content.append_single_val( n );
43 return _find( n, dummy );
51 if (count==0)
return start;
54 if (!_findNearestDown( start, idx ) || m_content[idx] < start+count)
return start + count;
55 return m_content[idx];
58 if (!_findNearestUp( start, idx ) || m_content[idx] > start+count)
return start + count;
59 return m_content[idx];
65 if (_find( val, idx )) { outIdx = idx;
return true; }
67 PFC_ASSERT ( idx == 0 || m_content [ idx - 1 ] < val );
68 PFC_ASSERT ( idx == m_content.get_size() || m_content[ idx ] > val );
69 if (idx == m_content.get_size())
return false;
75 if (_find( val, idx )) { outIdx = idx;
return true; }
77 PFC_ASSERT ( idx == 0 || m_content [ idx - 1 ] < val );
78 PFC_ASSERT ( idx == m_content.get_size() || m_content[ idx ] > val );
79 if (idx == 0)
return false;
85 pfc::sort_t( m_content, pfc::compare_t< size_t, size_t >, m_content.get_size( ) );
void set(t_size n, bool val)
t_size find(bool val, t_size start, t_ssize count) const
Returns the first occurance of val between start and start+count (excluding start+count), or start+count if not found; count may be negative to search back rather than forward. Can be overridden by bit_array implementations for improved speed in specific cases.
bool _findNearestUp(size_t val, size_t &outIdx) const
t_size find_next(bool val, t_size previous, t_size max) const
const t_storage * find_nearest_item(const t_search &p_search) const
t_size find_first(bool val, t_size start, t_size max) const
virtual t_size find(bool val, t_size start, t_ssize count) const
Returns the first occurance of val between start and start+count (excluding start+count), or start+count if not found; count may be negative to search back rather than forward. Can be overridden by bit_array implementations for improved speed in specific cases.
Bit array interface class, constant version (you can only retrieve values). Range of valid indexes d...
bool have_item(const t_param &p_item) const
Same as contains().
bool _findNearestDown(size_t val, size_t &outIdx) const
t_size find(bool val, t_size start, t_ssize count) const
Returns the first occurance of val between start and start+count (excluding start+count), or start+count if not found; count may be negative to search back rather than forward. Can be overridden by bit_array implementations for improved speed in specific cases.
avltree_t< t_size > m_data
static void sort_t(t_container &p_data, t_compare p_compare, t_size p_count)
pfc::sized_int_t< sizeof(size_t) >::t_signed t_ssize
bit_array_flatIndexList()