pieceMask64.h
Go to the documentation of this file.
/* pieceMask64.h
*/
#ifndef PIECEMASK64_H
#define PIECEMASK64_H
#include "osl/bits/mask.h"
namespace osl
{
namespace container
{
class PieceMask64
{
protected:
Mask64 mask;
public:
static int numToIndex(int) { return 0; }
static int numToOffset(int num) { return num; }
PieceMask64() { resetAll(); }
explicit PieceMask64(misc::Mask64 const& m) : mask(m) {}
protected:
misc::Mask64& mutableMask(int) { return mask; }
public:
const misc::Mask64& getMask(int) const { return mask; }
void resetAll()
{
mask=misc::Mask64::makeDirect(0uLL);
}
void setAll()
{
mask=misc::Mask64::makeDirect(0xffffffffffuLL);
}
PieceMask64& operator^=(const PieceMask64& o)
{
mask ^= o.mask;
return *this;
}
PieceMask64& operator&=(const PieceMask64& o)
{
mask &= o.mask;
return *this;
}
PieceMask64& operator|=(const PieceMask64& o)
{
mask |= o.mask;
return *this;
}
PieceMask64& operator-=(const PieceMask64& o)
{
mask -= o.mask;
return *this;
}
PieceMask64& operator+=(const PieceMask64& o)
{
mask += o.mask;
return *this;
}
bool none() const { return mask.none(); }
bool hasMultipleBit() const
{
if (none())
return false;
return mask.hasMultipleBit();
}
int countBit2() const
{
if (none())
return 0;
return mask.countBit2();
}
int
#ifdef __GNUC__
__attribute__ ((pure))
#endif
countBit() const
{
return mask.countBit();
}
int takeOneBit()
{
assert(!none());
return mask.takeOneBit();
}
};
} // namespace container
using container::PieceMask64;
} // namespace osl
#endif /* PIECEMASK64_H */
// ;;; Local Variables:
// ;;; mode:c++
// ;;; c-basic-offset:2
// ;;; End:
osl::container::PieceMask64::none
bool none() const
Definition pieceMask64.h:57
osl::container::PieceMask64::numToIndex
static int numToIndex(int)
Definition pieceMask64.h:16
osl::container::PieceMask64::PieceMask64
PieceMask64(misc::Mask64 const &m)
Definition pieceMask64.h:19
osl::container::PieceMask64::takeOneBit
int takeOneBit()
Definition pieceMask64.h:82
osl::container::PieceMask64::mask
Mask64 mask
Definition pieceMask64.h:14
osl::container::PieceMask64::operator^=
PieceMask64 & operator^=(const PieceMask64 &o)
Definition pieceMask64.h:32
osl::container::PieceMask64::numToOffset
static int numToOffset(int num)
Definition pieceMask64.h:17
osl::container::PieceMask64::mutableMask
misc::Mask64 & mutableMask(int)
Definition pieceMask64.h:21
osl::container::PieceMask64::countBit2
int countBit2() const
bit の数を2まで数える
Definition pieceMask64.h:68
osl::container::PieceMask64::operator|=
PieceMask64 & operator|=(const PieceMask64 &o)
Definition pieceMask64.h:42
osl::container::PieceMask64::operator+=
PieceMask64 & operator+=(const PieceMask64 &o)
Definition pieceMask64.h:52
osl::container::PieceMask64::setAll
void setAll()
Definition pieceMask64.h:28
osl::container::PieceMask64::resetAll
void resetAll()
Definition pieceMask64.h:24
osl::container::PieceMask64::hasMultipleBit
bool hasMultipleBit() const
Definition pieceMask64.h:58
osl::container::PieceMask64::getMask
const misc::Mask64 & getMask(int) const
Definition pieceMask64.h:23
osl::container::PieceMask64::operator&=
PieceMask64 & operator&=(const PieceMask64 &o)
Definition pieceMask64.h:37
osl::container::PieceMask64::operator-=
PieceMask64 & operator-=(const PieceMask64 &o)
Definition pieceMask64.h:47
osl::container::PieceMask64::countBit
int countBit() const
Definition pieceMask64.h:78
osl::container::PieceMask64::PieceMask64
PieceMask64()
Definition pieceMask64.h:18
osl::misc::GeneralMask< unsigned long long >::makeDirect
static const GeneralMask makeDirect(unsigned long long value)
Definition mask.h:219
mask.h
osl::container
Definition bitXmask.h:12
osl::misc::Mask64
GeneralMask< unsigned long long > Mask64
Definition mask.h:347
osl
Definition additionalEffect.h:6
osl::__attribute__
const PtypeO PTYPEO_EDGE __attribute__((unused))