Main Page   Packages   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members   Search  

C:/temp/src/j2k/Beta/Math/BitVector.hpp

Go to the documentation of this file.
00001 #ifndef __J2K__BitVector_HPP__
00002 #define __J2K__BitVector_HPP__
00003 
00004 #include <j2k/Fred/Basic.hpp>
00005 #include <j2k/Fred/StdTypes.hpp>
00006 
00007 #include <limits.h>   // CHAR_BIT = # bits in char
00008 
00009 class BitVector {
00010 public:
00011   BitVector();
00012   // Default: 0 size
00013 
00014   // init points to an array of bytes
00015   // size is measured in bytes
00016   BitVector(UCHAR* init, int size = 8);
00017 
00018   // binary is a string of 1s and 0s
00019   BitVector(char* binary);
00020   virtual ~BitVector();
00021 
00022   void set(   int bit );
00023   void clear( int bit );
00024   int  read(  int bit );
00025 
00026   int  bits();            // Number of bits in the vector
00027   void bits(int sz);      // Set number of bits
00028 
00029   void print(const char* msg = "");
00030 
00031 private:
00032   UCHAR* bytes;
00033   int Bits;
00034   int numBytes;
00035 };
00036 
00037 #endif

Generated on Sun Oct 14 18:46:12 2001 for Standard J2K Library by doxygen1.2.11.1 written by Dimitri van Heesch, © 1997-2001