BitSet Class Reference

#include <BitSet.h>

List of all members.

Public Member Functions

 BitSet ()
 BitSet (unsigned int size)
 ~BitSet ()
void setSize (unsigned int size)
uint32 getBits (unsigned int pos, unsigned int n)
void setBits (unsigned int pos, unsigned int n, uint32 bits)
void save (ODataSource *ods)
bool load (IDataSource *ids, uint32 version)

Private Attributes

unsigned int size
unsigned int bytes
uint8data


Detailed Description

Definition at line 25 of file BitSet.h.


Constructor & Destructor Documentation

BitSet::BitSet (  ) 

Definition at line 25 of file BitSet.cpp.

BitSet::BitSet ( unsigned int  size  ) 

Definition at line 31 of file BitSet.cpp.

References data, and setSize().

BitSet::~BitSet (  ) 

Definition at line 37 of file BitSet.cpp.

References data.


Member Function Documentation

uint32 BitSet::getBits ( unsigned int  pos,
unsigned int  n 
)

get a value

Parameters:
pos zero-based position (in bits)
n number of bits (no greater than 32)
Returns:
the value these bits represent

Definition at line 56 of file BitSet.cpp.

References data, and size.

Referenced by UCMachine::ConCmd_getGlobal(), UCMachine::ConCmd_setGlobal(), and UCMachine::execProcess().

bool BitSet::load ( IDataSource ids,
uint32  version 
)

Definition at line 126 of file BitSet.cpp.

References bytes, data, IDataSource::read(), IDataSource::read4(), and setSize().

Referenced by UCMachine::loadGlobals().

void BitSet::save ( ODataSource ods  ) 

Definition at line 120 of file BitSet.cpp.

References bytes, data, size, ODataSource::write(), and ODataSource::write4().

Referenced by UCMachine::saveGlobals().

void BitSet::setBits ( unsigned int  pos,
unsigned int  n,
uint32  bits 
)

set a value

Parameters:
pos zero-based position (in bits)
n number of bits (no greater than 32)
bits the value to set

Definition at line 88 of file BitSet.cpp.

References data, and size.

Referenced by UCMachine::ConCmd_setGlobal(), and UCMachine::execProcess().

void BitSet::setSize ( unsigned int  size  ) 

set the size. The old value is cleared

Parameters:
size the new size (in bits)

Definition at line 42 of file BitSet.cpp.

References bytes, data, and size.

Referenced by BitSet(), load(), and UCMachine::reset().


Member Data Documentation

unsigned int BitSet::bytes [private]

Definition at line 52 of file BitSet.h.

Referenced by load(), save(), and setSize().

uint8* BitSet::data [private]

Definition at line 53 of file BitSet.h.

Referenced by BitSet(), getBits(), load(), save(), setBits(), setSize(), and ~BitSet().

unsigned int BitSet::size [private]

Definition at line 51 of file BitSet.h.

Referenced by getBits(), save(), setBits(), and setSize().


The documentation for this class was generated from the following files:
Generated on Fri Jul 27 22:28:46 2007 for pentagram by  doxygen 1.4.7