ATLAS Offline Software
Loading...
Searching...
No Matches
CxxUtils::ConcurrentBitset::reference Class Reference

A reference to one bit in a set. More...

#include <ConcurrentBitset.h>

Collaboration diagram for CxxUtils::ConcurrentBitset::reference:

Public Member Functions

referenceoperator= (bool val) noexcept
 Set the referenced bit to a given value.
referenceoperator= (const reference &r) noexcept
 Copy the value of another referenced bit.
 operator bool () const noexcept
 Return the value of the referenced bit.
bool operator~ () const noexcept
 Return the complement of the value of the referenced bit.
referenceflip () noexcept
 Invert the referenced bit.

Private Member Functions

 reference (Impl &impl, bit_t bit)
 Constructor.

Private Attributes

std::atomic< Block_t > * m_block
 Pointer to the block containing the referenced bit.
Block_t m_mask
 Mask of the referenced bit within the block.

Friends

class ConcurrentBitset

Detailed Description

A reference to one bit in a set.

These references are invalidated by calls to insert() or operator=.

Definition at line 584 of file ConcurrentBitset.h.

Constructor & Destructor Documentation

◆ reference()

CxxUtils::ConcurrentBitset::reference::reference ( Impl & impl,
bit_t bit )
private

Constructor.

Parameters
implConcurrentBitset implementation object.
bitBit number to which this reference refers.

Member Function Documentation

◆ flip()

reference & CxxUtils::ConcurrentBitset::reference::flip ( )
noexcept

Invert the referenced bit.

◆ operator bool()

CxxUtils::ConcurrentBitset::reference::operator bool ( ) const
noexcept

Return the value of the referenced bit.

◆ operator=() [1/2]

reference & CxxUtils::ConcurrentBitset::reference::operator= ( bool val)
noexcept

Set the referenced bit to a given value.

Parameters
valValue to which to set the referenced bit.

◆ operator=() [2/2]

reference & CxxUtils::ConcurrentBitset::reference::operator= ( const reference & r)
noexcept

Copy the value of another referenced bit.

Parameters
rThe other reference.

To allow:

ConcurrentBitset& bs1 = ...;
ConcurrentBitset& bs2 = ...;
bs1[1] = bs2[1];

◆ operator~()

bool CxxUtils::ConcurrentBitset::reference::operator~ ( ) const
noexcept

Return the complement of the value of the referenced bit.

◆ ConcurrentBitset

friend class ConcurrentBitset
friend

Definition at line 587 of file ConcurrentBitset.h.

Member Data Documentation

◆ m_block

std::atomic<Block_t>* CxxUtils::ConcurrentBitset::reference::m_block
private

Pointer to the block containing the referenced bit.

Definition at line 640 of file ConcurrentBitset.h.

◆ m_mask

Block_t CxxUtils::ConcurrentBitset::reference::m_mask
private

Mask of the referenced bit within the block.

Definition at line 643 of file ConcurrentBitset.h.


The documentation for this class was generated from the following file: