mirror of https://github.com/lianthony/NT4.0
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
59 lines
1.7 KiB
59 lines
1.7 KiB
/* --------------------------------------------------------------------
|
|
|
|
Microsoft OS/2 LAN Manager
|
|
Copyright(c) Microsoft Corp., 1990
|
|
|
|
-------------------------------------------------------------------- */
|
|
/* --------------------------------------------------------------------
|
|
|
|
File : bitset.hxx
|
|
|
|
Title : Bit vector implementation of a set.
|
|
|
|
History :
|
|
|
|
mikemon ??-??-?? Beginning of this file as we know it.
|
|
mikemon 11-13-90 Commented the file.
|
|
|
|
-------------------------------------------------------------------- */
|
|
|
|
#ifndef __BITSET_HXX__
|
|
#define __BITSET_HXX__
|
|
|
|
// Implementation of a set using a bit vector. Other than available memory,
|
|
// and the maximum value of a signed integer, there are no constraints on
|
|
// the size of the bitset.
|
|
|
|
class BITSET
|
|
{
|
|
private:
|
|
|
|
unsigned int * pBits; // The array of bits making up the bit vector.
|
|
|
|
int cBits; // This is the number of unsigned ints in the bit vector,
|
|
// rather than the number of bits; the number of bits is
|
|
// cBits*sizeof(int)*8.
|
|
|
|
public:
|
|
|
|
BITSET ( // Constructor.
|
|
) {pBits = (unsigned int *) 0; cBits = 0;}
|
|
|
|
~BITSET ( // Destructor.
|
|
);
|
|
|
|
int // Indicates success (0), or an error. A return value of one (1),
|
|
// means that a memory allocation error occured. NOTE: If an error
|
|
// does occur, the bitset is left in the same state as before the
|
|
// Insert operation was attempted.
|
|
Insert ( // Indicate that the key is now a member of the bitset.
|
|
int Key
|
|
);
|
|
|
|
int // Indicates whether the key is a member (1) or not (0).
|
|
MemberP ( // Tests whether a key is a member of the set or not.
|
|
int Key
|
|
);
|
|
};
|
|
|
|
#endif // __BITSET_HXX__
|