#ifndef PACKED_INT_ARRAY_H #define PACKED_INT_ARRAY_H #include class PackedIntArray { public: typedef uint_fast8_t Unit; PackedIntArray( Unit iBitWidth ); PackedIntArray( Unit iBitWidth, int iCapacity ); PackedIntArray( const PackedIntArray &rSrc ); virtual ~PackedIntArray(); void clear(); void append( Unit i ); void remove(); Unit operator[]( int idx ) const { return get( idx ); } Unit get( int idx ) const; void set( int idx, Unit i ); int getSize() const { return iCount; } void set( const PackedIntArray &rSrc, int iStart, int iSize ); Bu::String toBitString() const; Bu::String toString() const; private: void checkCapacity(); private: typedef uint_fast32_t Store; Unit iBitWidth; Store *aData; int iCapacity; int iCount; int iMaxSpan; Unit uMask; }; #endif