BitVect.h
Go to the documentation of this file.00001
00002
00003
00004
00005
00006 #ifndef __RD_BITVECT_H__
00007 #define __RD_BITVECT_H__
00008
00009 #include <vector>
00010 #include <string>
00011
00012 using std::vector;
00013 typedef vector<int> IntVect;
00014 typedef IntVect::iterator IntVectIter;
00015 typedef vector<double> DoubleVect;
00016 typedef DoubleVect::iterator DoubleVectIter;
00017 const int ci_BITVECT_VERSION=0x0020;
00018
00019
00020 class BitVect{
00021 public:
00022 virtual ~BitVect() = 0;
00023
00024 virtual bool SetBit(const unsigned int which) = 0;
00025
00026 virtual bool UnSetBit(const unsigned int which) = 0;
00027
00028 virtual bool GetBit(const unsigned int which) const = 0;
00029
00030 virtual const unsigned int GetNumBits() const = 0;
00031
00032 virtual const unsigned int GetNumOnBits() const = 0;
00033
00034 virtual const unsigned int GetNumOffBits() const =0;
00035
00036 virtual void GetOnBits (IntVect& v) const = 0;
00037
00038 virtual void ClearBits() = 0;
00039
00040
00041
00042
00043
00044
00045
00046
00047
00048
00049
00050
00051 void InitFromText(const char *data,const unsigned int dataLen,
00052 bool isBase64=false,bool allowOldFormat=false);
00053
00054
00055 virtual std::string ToString() const = 0;
00056
00057 virtual bool operator[] (const unsigned int which) const = 0;
00058
00059 private:
00060 virtual void _InitForSize(const unsigned int size) = 0;
00061 };
00062
00063
00064 #endif