ATLAS Offline Software
Public Member Functions | Private Member Functions | Private Attributes | Friends | List of all members
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. More...
 
referenceoperator= (const reference &r) noexcept
 Copy the value of another referenced bit. More...
 
 operator bool () const noexcept
 Return the value of the referenced bit. More...
 
bool operator~ () const noexcept
 Return the complement of the value of the referenced bit. More...
 
referenceflip () noexcept
 Invert the referenced bit. More...
 

Private Member Functions

 reference (Impl &impl, bit_t bit)
 Constructor. More...
 

Private Attributes

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

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 585 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.

Friends And Related Function Documentation

◆ ConcurrentBitset

friend class ConcurrentBitset
friend

Definition at line 588 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 641 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 644 of file ConcurrentBitset.h.


The documentation for this class was generated from the following file:
CxxUtils::ConcurrentBitset::reference::ConcurrentBitset
friend class ConcurrentBitset
Definition: ConcurrentBitset.h:588