CommonC++Lib RiscOSC++Lib ToolboxC++Lib
Toolbox Library for use with the RiscOS DDE C++/CFront compiler
Loading...
Searching...
No Matches
BitField Class Reference

#include <BitField.h>

Inheritance diagram for BitField:
Object

Public Member Functions

 BitField (void)
 ~BitField (void)
 BitField (int bits)
void setBit (int bit)
void clearBit (int bit)
int isSet (int bit)
int isClear (int bit)
void invert (void)
void clear (void)
void set (void)
unsigned int numBits (void)
void showProperties ()
char * getClassName ()
int getClassType ()
Public Member Functions inherited from Object
 Object ()
 ~Object ()

Detailed Description

Bitfield

CommonC++Lib

Class to create objects containing a single or multiple bytes which can be manipulated or tested at the bit level. Passing an integer value to the constructor will create an object with enough bytes to store the number of bits required as passed to the constructor.

Constructor & Destructor Documentation

◆ BitField() [1/2]

BitField::BitField ( void )

BitField constructor Creates an object with 8 available bits

◆ ~BitField()

BitField::~BitField ( void )

◆ BitField() [2/2]

BitField::BitField ( int bits)

BitField constructor

Parameters
[in]bitsNumber of bits to store in the object

Member Function Documentation

◆ clear()

void BitField::clear ( void )

Clears all the bits in a BitField object

◆ clearBit()

void BitField::clearBit ( int bit)

Clears an individual bit in a BitField object

Parameters
[in]bitOffset to the bit to clear

◆ getClassName()

char * BitField::getClassName ( )
inlinevirtual

Returns the classname of the object Returns a pointer to a zero terminated character field containing "BitField"

Implements Object.

◆ getClassType()

int BitField::getClassType ( )
inlinevirtual

Returns an integer representing a value for an object of class BitField Value returned is 0

Implements Object.

◆ invert()

void BitField::invert ( void )

Inverts all the bits in a BitField object

◆ isClear()

int BitField::isClear ( int bit)

Tests an individual bit in a BitField object

Parameters
[in]bitOffset to the bit to test Returns an integer representing True or False True - the bit is clear False - the bit is set

◆ isSet()

int BitField::isSet ( int bit)

Tests an individual bit in a BitField object

Parameters
[in]bitOffset to the bit to test Returns an integer representing True or False True - the bit is set False - the bit is clear

◆ numBits()

unsigned int BitField::numBits ( void )

Returns the number bits in a BitField object

◆ set()

void BitField::set ( void )

Sets all the bits in a BitField object

◆ setBit()

void BitField::setBit ( int bit)

Sets an individual bit in a BitField object

Parameters
[in]bitOffset to the bit to set

◆ showProperties()

void BitField::showProperties ( )
inlinevirtual

Currently unused

Implements Object.


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