foobar2000 SDK  2015-08-03
Public Member Functions | Private Attributes
bit_array_one

#include <bit_array_impl.h>

+ Inheritance diagram for bit_array_one:

Public Member Functions

 bit_array_one (t_size p_val)
 
virtual t_size find (bool p_val, t_size start, t_ssize count) const
 
virtual bool get (t_size n) const
 
- Public Member Functions inherited from pfc::bit_array
t_size calc_count (bool val, t_size start, t_size count, t_size count_max=~0) const
 
t_size find_first (bool val, t_size start, t_size max) const
 
t_size find_next (bool val, t_size previous, t_size max) const
 
bool operator[] (t_size n) const
 

Private Attributes

t_size val
 

Additional Inherited Members

- Protected Member Functions inherited from pfc::bit_array
 bit_array ()
 
 ~bit_array ()
 

Detailed Description

Definition at line 137 of file bit_array_impl.h.

Constructor & Destructor Documentation

bit_array_one::bit_array_one ( t_size  p_val)
inline

Definition at line 141 of file bit_array_impl.h.

141 : val(p_val) {}

Member Function Documentation

virtual t_size bit_array_one::find ( bool  val,
t_size  start,
t_ssize  count 
) const
inlinevirtual

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.

Reimplemented from pfc::bit_array.

Definition at line 144 of file bit_array_impl.h.

145  {
146  if (count==0) return start;
147  else if (p_val)
148  {
149  if (count>0)
150  return (val>=start && val<start+count) ? val : start+count;
151  else
152  return (val<=start && val>start+count) ? val : start+count;
153  }
154  else
155  {
156  if (start == val) return count>0 ? start+1 : start-1;
157  else return start;
158  }
159  }
virtual bool bit_array_one::get ( t_size  n) const
inlinevirtual

Implements pfc::bit_array.

Definition at line 142 of file bit_array_impl.h.

142 {return n==val;}

Field Documentation

t_size bit_array_one::val
private

Definition at line 139 of file bit_array_impl.h.


The documentation for this class was generated from the following file: