GBitArray Class Reference

[libgfc Index] [libgfc Hierarchy] [Headers]


GBitArray provides an array of bits More...

#include <utils/src/gbitarray.h>

Public Members


Detailed Description

GBitArray provides an array of bits. The main methods are bit setting/clearing/testing. operator[] is only defined for read-only access, for simplicity.


void resize(int new_size) [public]

reset the size to new_size bits. If new_size is smaller than the current one, the memory is usually not shrinked. Only the size information is updated.

void fill(bool v, int size=-1) [public]

fill the first 'size' bits with value 'v'. If size<0 fill every bits in the array. If size > current size then only the current_size bits will be filled; the array will not be automatically resized to accomodate the bigger size.

bool test(int idx) const [public]

test wether bit at idx is true. Return true if bit is true; otherwise return false.

void set(int idx) [public]

set bit at idx to 1.

void clear(int idx) [public]

clear bit at idx to 0.

bool toggle(int idx) [public]

toggle the bit. return the NEW bit value.

void toggleAll() [public]

toggle every bit in the array.


Documentation generated by lqian@lqian-sun on Wed Jul 14 09:36:10 EDT 1999
Kdoc