smjg.libs.util.bitarray.BitPointer Union Reference

The smjg.libs.util.bitarray.BitPointer union implements a bit pointer that can point to any bit within a byte. More...

List of all members.

Public Member Functions

Properties
bool value ()
 Dereferences the bit pointer.
bool value (bool b)
 Dereferences the bit pointer and assigns a value into it.
bool value ()
 Dereferences the bit pointer.
bool value (bool b)
 Dereferences the bit pointer and assigns a value to it.
Operators
bool opIndex (int i)
 Returns the bit with the given index relative to this bit pointer.
bool opIndexAssign (bool b, int i)
 Sets the bit at the given index relative to this bit pointer.
BitArray opSlice (int begin, int end)
 Returns an in-place BitArray slice relative to this bit pointer.
BitArray opSliceAssign (bool value, int begin, int end)
 Assigns a bit to a slice relative to this bit pointer.
BitArray opSliceAssign (BitArray value, int begin, int end)
 Assigns a BitArray to a slice relative to this bit pointer.
BitPointer opAdd (int i)
 Returns this pointer incremented by a number of bits.
BitPointer opSub (int i)
 Returns this pointer decremented by a number of bits.
int opSub (BitPointer p)
 Returns the displacement in bits between this BitPointer and another.
int opCmp (BitPointer p)
 Compares this BitPointer with another in the address to which they point.
ubyte * bytePointer ()
 Returns the address of the byte within which this BitPointer points.
ubyte bitOffset ()
 Returns the offset of the bit pointed to within this byte.

Static Public Member Functions

static assert (ulong.sizeof==uint.sizeof+(ubyte *).sizeof)
Pseudo-Constructors
static BitPointer opCall (BitArray data)
 Constructs a new BitPointer to point to the beginning of a BitArray.
static BitPointer opCall (void *data)
 Constructs a new BitPointer to point to the first bit of a byte.
static BitPointer opCall (void[] data)
 Constructs a new BitPointer to point to the first bit of a byte.


Detailed Description

The smjg.libs.util.bitarray.BitPointer union implements a bit pointer that can point to any bit within a byte.


Member Function Documentation

static smjg.libs.util.bitarray.BitPointer.assert ( ulong.  sizeof = =uint.sizeof+(ubyte *).sizeof  )  [static]

static BitPointer smjg.libs.util.bitarray.BitPointer.opCall ( BitArray  data  )  [static]

Constructs a new BitPointer to point to the beginning of a BitArray.

static BitPointer smjg.libs.util.bitarray.BitPointer.opCall ( void *  data  )  [static]

Constructs a new BitPointer to point to the first bit of a byte.

static BitPointer smjg.libs.util.bitarray.BitPointer.opCall ( void[]  data  )  [static]

Constructs a new BitPointer to point to the first bit of a byte.

bool smjg.libs.util.bitarray.BitPointer.value (  ) 

Dereferences the bit pointer.

Returns:
bit pointed to by this BitPointer.

bool smjg.libs.util.bitarray.BitPointer.value ( bool  b  ) 

Dereferences the bit pointer and assigns a value into it.

Parameters:
b value to set.
Returns:
the bit value that was set.

bool smjg.libs.util.bitarray.BitPointer.value (  ) 

Dereferences the bit pointer.

Returns:
bit pointed to by this BitPointer.
Status:
test

bool smjg.libs.util.bitarray.BitPointer.value ( bool  b  ) 

Dereferences the bit pointer and assigns a value to it.

Parameters:
b value to set.
Returns:
the bit value that was set.
Status:
test

bool smjg.libs.util.bitarray.BitPointer.opIndex ( int  i  ) 

Returns the bit with the given index relative to this bit pointer.

(Implementation of (*this)[i].)

bool smjg.libs.util.bitarray.BitPointer.opIndexAssign ( bool  b,
int  i 
)

Sets the bit at the given index relative to this bit pointer.

(Implementation of (*this)[i] = b.)

BitArray smjg.libs.util.bitarray.BitPointer.opSlice ( int  begin,
int  end 
)

Returns an in-place BitArray slice relative to this bit pointer.

(Implementation of (*this)[begin..end].)

BitArray smjg.libs.util.bitarray.BitPointer.opSliceAssign ( bool  value,
int  begin,
int  end 
)

Assigns a bit to a slice relative to this bit pointer.

(Implementation of (*this)[begin..end] = value.)

Todo:
optimise

BitArray smjg.libs.util.bitarray.BitPointer.opSliceAssign ( BitArray  value,
int  begin,
int  end 
)

Assigns a BitArray to a slice relative to this bit pointer.

(Implementation of (*this)[begin..end] = value.)

BitPointer smjg.libs.util.bitarray.BitPointer.opAdd ( int  i  ) 

Returns this pointer incremented by a number of bits.

(Implementation of *this + i.)

BitPointer smjg.libs.util.bitarray.BitPointer.opSub ( int  i  ) 

Returns this pointer decremented by a number of bits.

(Implementation of *this - i.)

int smjg.libs.util.bitarray.BitPointer.opSub ( BitPointer  p  ) 

Returns the displacement in bits between this BitPointer and another.

(Implementation of *this - p.)

int smjg.libs.util.bitarray.BitPointer.opCmp ( BitPointer  p  ) 

Compares this BitPointer with another in the address to which they point.

ubyte* smjg.libs.util.bitarray.BitPointer.bytePointer (  ) 

Returns the address of the byte within which this BitPointer points.

Returns the address of the byte within which this BitPointer points.

Since:
0.03

ubyte smjg.libs.util.bitarray.BitPointer.bitOffset (  ) 

Returns the offset of the bit pointed to within this byte.

Returns:
the bit offset, which is between 0 and 7.
Since:
0.03


Member Data Documentation

uint smjg.libs.util.bitarray.BitPointer._bitOffset

ubyte* smjg.libs.util.bitarray.BitPointer._bytePointer

ubyte* smjg.libs.util.bitarray.BitPointer._bytePointer


The documentation for this union was generated from the following file:
Generated on Sun Sep 13 19:50:32 2009 for Stewart's Utility Library by  doxygen 1.5.4