00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 #ifndef CODING_VECTOR_H
00022 #define CODING_VECTOR_H
00023
00024
00025 #include<simple-ref-count.h>
00026 #include<vector>
00027 #include<ostream>
00028
00029 namespace Binc {
00030
00041 class CodingVector : public SimpleRefCount<CodingVector>
00042 {
00043 public:
00044
00045 CodingVector ();
00046 virtual ~CodingVector ();
00047
00056 CodingVector (unsigned int position);
00057
00058
00064 CodingVector(const std::vector<unsigned int>& v);
00065
00066
00073 bool operator== (const CodingVector& rhs) const;
00074
00075
00082 bool operator!= (const CodingVector& rhs) const;
00083
00093 CodingVector& operator+= (const CodingVector& rhs);
00094
00095
00100 unsigned int Size () const;
00101
00102
00108 void Print (std::ostream& os) const;
00109
00110
00118 bool At (unsigned int position) const;
00119
00120 bool IsZero () const;
00121
00122
00132 friend CodingVector operator+ (const CodingVector& lhs, const CodingVector& rhs);
00133
00134 private:
00135
00136 void Normalize ();
00137
00138 unsigned int m_start;
00139 std::vector<unsigned int> m_vect;
00140
00141 };
00142
00143
00144
00145
00146
00155 std::ostream& operator << (std::ostream& os, const CodingVector& v);
00156
00157
00158
00159 }
00160
00161 #endif // CODING_VECTOR_H