|
ATLAS Offline Software
|
Go to the documentation of this file.
27 : m_impl (
new (nbits)
Impl (nbits))
61 auto max_it = std::max_element (
l.begin(),
l.end());
62 if (max_it !=
l.end()) {
86 other.m_impl =
nullptr;
110 if (
this != &
other) {
113 (*m_impl).assign (*otherImpl);
128 if (
this != &
other) {
130 other.emptyGarbage();
133 other.m_impl =
nullptr;
167 bit_t nbits = (*m_impl).nbits();
168 if (new_nbits > nbits) {
189 #if defined(__x86_64__) && HAVE_FUNCTION_MULTIVERSIONING
198 for (bit_t
i=0;
i<m_nblocks;
i++) {
224 for (
bit_t i = 0;
i < m_nblocks;
i++) {
236 if (m_nblocks == 0) {
241 for (
bit_t i = 0;
i < m_nblocks-1;
i++) {
245 if (
m_data[m_nblocks] != ones<Block_t> (m_nbits - (m_nblocks-1)*
BLOCKSIZE)) {
261 m_data[
i].store (~
static_cast<Block_t>(0), std::memory_order_relaxed);
263 std::atomic_thread_fence (std::memory_order_seq_cst);
279 m_data[
i] ^= ~static_cast<Block_t>(0);
size_t m_nblocks
Number of blocks in the container.
Variable-sized bitset allowing (mostly) concurrent access.
Variable-sized bitset allowing (mostly) concurrent access.
unsigned long Block_t
Internal type used to hold the bitset data.
size_t bit_t
A bit number.
bool all() const
Return true if all bits in the set are 1.
void flip()
Flip the state of all bits in the set.
std::atomic< Impl * > m_impl
The current implementation object.
ConcurrentBitset(bit_t nbits=0)
Constructor.
void expandOol(bit_t new_nbits)
Expand the container: out-of-line portion.
std::lock_guard< mutex_t > lock_t
bool none() const
Return true if there are no 1 bits in the set.
void set()
Turn on all bits in the set.
std::atomic< Block_t > m_data[1]
The set data.
constexpr unsigned count_ones(unsigned x)
Count number of set bits.
static const size_t MASK
Mask to select out the bit offset within one Block_t.
~ConcurrentBitset()
Destructor.
static const size_t BLOCKSIZE
Size, in bits, of Block_t.
void expand(bit_t new_nbits)
Expand the container.
bit_t nbits() const
Return the number of bits in the set.
std::vector< Impl * > m_garbage
Old implementation objects, pending deletion.
ConcurrentBitset & set()
Turn on all bits in the set.
__attribute__((always_inline)) inline uint16_t TileCalibDrawerBase
ConcurrentBitset & operator=(const ConcurrentBitset &other)
Assignment.
void emptyGarbage()
Clean up old versions of the set.