OWLNext 7.0
Borland's Object Windows Library for the modern age
|
Simplifies setting and testing bits in a 32 count array of uint8 (32 bytes). More...
#include <owl/bitset.h>
Public Member Functions | |
TBitSet () | |
Constructs a TBitSet object with all bits set to 0. | |
TBitSet (const TBitSet &src) | |
Constructs a TBitSet object as a copy of another TBitSet. | |
bool | Has (T item) const |
Return true if a bit is turned on. | |
TBitSet | operator~ () const |
Negate a bit. | |
void | DisableItem (T item) |
Turn off a specific bit. | |
void | EnableItem (T item) |
Turn on a specific bit. | |
TBitSet & | operator+= (T item) |
Enable a specific bit. | |
TBitSet & | operator-= (T item) |
Disable a specific bit. | |
void | DisableItem (const TBitSet &bs) |
Turn off all the given bits. | |
void | EnableItem (const TBitSet &bs) |
Turn on all the given bits. | |
TBitSet & | operator+= (const TBitSet &bs) |
Enable all the given bits. | |
TBitSet & | operator|= (const TBitSet &bs) |
Enable all the given bits. | |
TBitSet & | operator-= (const TBitSet &bs) |
Disable all the given bits. | |
TBitSet & | operator&= (const TBitSet &bs) |
Logically AND each individual bits. | |
bool | IsEmpty () const |
Return true if all bits are off. | |
Friends | |
TBitSet | operator& (const TBitSet &bs1, const TBitSet &bs2) |
TBitSet | operator| (const TBitSet &bs1, const TBitSet &bs2) |
int | operator== (const TBitSet &bs1, const TBitSet &bs2) |
int | operator!= (const TBitSet &bs1, const TBitSet &bs2) |
opstream & | operator<< (opstream &out, const TBitSet &bs) |
ipstream & | operator>> (ipstream &in, TBitSet &bs) |
Simplifies setting and testing bits in a 32 count array of uint8 (32 bytes).
TBitSet sets or clears a single bit or a group of bits. You can use this class to set and clear option flags and to retrieve information about a set of bits. The class TCharSet performs similar operations for a string of characters.
owl::TBitSet< T >::TBitSet | ( | ) |
Constructs a TBitSet object with all bits set to 0.
Definition at line 21 of file bitset.cpp.
owl::TBitSet< T >::TBitSet | ( | const TBitSet< T > & | src | ) |
Constructs a TBitSet object as a copy of another TBitSet.
Definition at line 31 of file bitset.cpp.
void owl::TBitSet< T >::DisableItem | ( | const TBitSet< T > & | bs | ) |
Turn off all the given bits.
Definition at line 105 of file bitset.cpp.
void owl::TBitSet< T >::DisableItem | ( | T | item | ) |
Turn off a specific bit.
Definition at line 65 of file bitset.cpp.
void owl::TBitSet< T >::EnableItem | ( | const TBitSet< T > & | bs | ) |
Turn on all the given bits.
Definition at line 116 of file bitset.cpp.
void owl::TBitSet< T >::EnableItem | ( | T | item | ) |
Turn on a specific bit.
Definition at line 75 of file bitset.cpp.
bool owl::TBitSet< T >::Has | ( | T | item | ) | const |
Return true if a bit is turned on.
Definition at line 42 of file bitset.cpp.
bool owl::TBitSet< T >::IsEmpty | ( | ) | const |
Return true if all bits are off.
Definition at line 169 of file bitset.cpp.
TBitSet< T > & owl::TBitSet< T >::operator&= | ( | const TBitSet< T > & | bs | ) |
Logically AND each individual bits.
Definition at line 157 of file bitset.cpp.
TBitSet< T > & owl::TBitSet< T >::operator+= | ( | const TBitSet< T > & | bs | ) |
Enable all the given bits.
Definition at line 126 of file bitset.cpp.
TBitSet< T > & owl::TBitSet< T >::operator+= | ( | T | item | ) |
Enable a specific bit.
Definition at line 84 of file bitset.cpp.
TBitSet< T > & owl::TBitSet< T >::operator-= | ( | const TBitSet< T > & | bs | ) |
Disable all the given bits.
Definition at line 146 of file bitset.cpp.
TBitSet< T > & owl::TBitSet< T >::operator-= | ( | T | item | ) |
Disable a specific bit.
Definition at line 94 of file bitset.cpp.
TBitSet< T > & owl::TBitSet< T >::operator|= | ( | const TBitSet< T > & | bs | ) |
Enable all the given bits.
Definition at line 136 of file bitset.cpp.
TBitSet< T > owl::TBitSet< T >::operator~ | ( | ) | const |
Negate a bit.
Definition at line 52 of file bitset.cpp.