13 #include <solv/bitmap.h> 17 #include <zypp/base/LogTools.h> 18 #include <zypp/base/String.h> 33 ::map_init_clone( ret, const_cast<sat::detail::CMap *>(rhs) );
44 : _pimpl( new detail::
CMap )
48 : _pimpl( new detail::
CMap )
52 : _pimpl( new detail::
CMap )
59 {
return(
_pimpl->size == 0 ); }
62 {
return _pimpl->size << 3; }
79 #define M_RANGE_CKECK(IDX,LOC) if ( ((IDX) >> 3) >= size_type(_pimpl->size) ) throw std::out_of_range( "zypp::sat::Map::" LOC ) 97 { MAPSET(
_pimpl, idx_r ); }
99 { MAPCLR(
_pimpl, idx_r ); }
105 return MAPTST(
_pimpl, idx_r );
111 return std::string();
113 std::string ret(
size(), off_r );
123 {
return _pimpl.get(); }
129 return( l == r || ( l->size == r->size && ::memcmp( l->map, r->map, l->size ) == 0 ) );
static constexpr PoolSizeType poolSize
An object indicating the bitmap should match the current pools capacity.
Type to indicate the bitmap should match the current pools capacity.
void clear(size_type idx_r)
Clear bit idx_r.
bool operator==(const Map &lhs, const Map &rhs)
std::string asString(const char on_r='1', const char off_r='0') const
String representation.
#define M_RANGE_CKECK(IDX, LOC)
#define for_(IT, BEG, END)
Convenient for-loops using iterator.
void set(size_type idx_r)
Set bit idx_r.
size_type capacity() const
Internal array size for stats only.
Map()
Default ctor: empty Map.
static Pool instance()
Singleton ctor.
void clearAll()
Clear all bits.
::s_Map CMap
Wrapped libsolv C data type exposed as backdoor.
bool empty() const
Whether Map is empty.
RWCOW_pointer< detail::CMap > _pimpl
Pointer to implementation.
void setAll()
Set all bits.
size_type size() const
Size of the Map.
void assign(size_type idx_r, bool val_r)
Assign val_r to bit idx_r.
bool test(size_type idx_r) const
Test bit idx_r.
void grow(size_type size_r)
Grow the Map if necessary.
Libsolv (bit)Map wrapper.
Easy-to use interface to the ZYPP dependency resolver.
void assignAll(bool val_r)
Assign val_r to all bits.