13 #include <solv/bitmap.h>
29 struct ::_Map * rwcowClone<struct ::_Map>(
const struct ::_Map * rhs )
31 struct ::_Map * ret = new ::_Map;
32 ::map_init_clone( ret, const_cast<struct ::_Map *>(rhs) );
41 : _pimpl( new ::_Map )
45 : _pimpl( new ::_Map )
52 {
return(
_pimpl->size == 0 ); }
55 {
return _pimpl->size << 3; }
72 #define M_RANGE_CKECK(IDX,LOC) if ( ((IDX) >> 3) >= size_type(_pimpl->size) ) throw std::out_of_range( "zypp::sat::Map::" LOC )
90 { MAPSET(
_pimpl, idx_r ); }
92 { MAPCLR(
_pimpl, idx_r ); }
98 return MAPTST(
_pimpl, idx_r );
104 return std::string();
106 std::string ret(
size(), off_r );
115 Map::operator struct ::_Map *()
116 {
return _pimpl.get(); }
120 const struct ::_Map * l = lhs;
121 const struct ::_Map * r = rhs;
122 return( l == r || ( l->size == r->size && ::memcmp( l->map, r->map, l->size ) == 0 ) );
RWCOW_pointer< struct::_Map > _pimpl
Pointer to implementation.
void clear(size_type idx_r)
Clear bit idx_r.
size_type size() const
Size of the Map.
bool operator==(const Map &lhs, const Map &rhs)
#define M_RANGE_CKECK(IDX, LOC)
void set(size_type idx_r)
Set bit idx_r.
#define for_(IT, BEG, END)
Convenient for-loops using iterator.
bool test(size_type idx_r) const
Test bit idx_r.
Map()
Default ctor: empty Map.
void clearAll()
Clear all bits.
void setAll()
Set all bits.
void assign(size_type idx_r, bool val_r)
Assign val_r to bit idx_r.
std::string asString(const char on_r= '1', const char off_r= '0') const
String representation.
void grow(size_type size_r)
Grow the Map if necessary.
bool empty() const
Whether Map is empty.
Libsolv (bit)Map wrapper.
void assignAll(bool val_r)
Assign val_r to all bits.