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