ALib C++ Library
Library Version: 2510 R0
Documentation generated by doxygen
Loading...
Searching...
No Matches
alib::lang::TBitSet< TInterface, TEnd, TBegin >::Reference< TBitSetCM > Class Template Reference

Description:

template<typename TInterface, TInterface TEnd, TInterface TBegin = 0>
template<typename TBitSetCM>
class alib::lang::TBitSet< TInterface, TEnd, TBegin >::Reference< TBitSetCM >

A publicly accessible nested class, used as a proxy object to allow users to interact with individual bits of a bitset. The primary use of this type is to provide a lvalue that can be returned from operator[].

Template Parameters
TBitSetCMA constant or mutable TBitSet.

Definition at line 157 of file bitset.inl.

Public Method Index:

constexpr Reference (const Reference &) noexcept=default
 Defaulted copy constructor.
 
constexpr Reference (TBitSetCM &set, TInterface b) noexcept
 
 ~Reference () noexcept
 Destructor. (Is declared constexpr with C++23.)
 
constexpr TInterface Bit () const noexcept
 
constexpr ReferenceFlip () noexcept
 
constexpr operator bool () noexcept
 
constexpr Referenceoperator= (bool val) noexcept
 
Referenceoperator= (const Reference &other) noexcept=default
 
constexpr bool operator== (const Reference &rhs) const noexcept=default
 
constexpr bool operator~ () noexcept
 
constexpr const class TBitSetTBitSet () const noexcept
 
constexpr class TBitSetTBitSet () noexcept
 

Protected Field Index:

TInterface bit
 The bit number in bitSet this reference addresses.
 
TBitSetCM * bitSet
 The TBitSet this reference addresses.
 

Field Details:

◆ bit

template<typename TInterface, TInterface TEnd, TInterface TBegin = 0>
template<typename TBitSetCM>
TInterface alib::lang::TBitSet< TInterface, TEnd, TBegin >::Reference< TBitSetCM >::bit
protected

The bit number in bitSet this reference addresses.

Definition at line 164 of file bitset.inl.

◆ bitSet

template<typename TInterface, TInterface TEnd, TInterface TBegin = 0>
template<typename TBitSetCM>
TBitSetCM* alib::lang::TBitSet< TInterface, TEnd, TBegin >::Reference< TBitSetCM >::bitSet
protected

The TBitSet this reference addresses.

Definition at line 165 of file bitset.inl.

Constructor(s) / Destructor Details:

◆ Reference()

template<typename TInterface, TInterface TEnd, TInterface TBegin = 0>
template<typename TBitSetCM>
alib::lang::TBitSet< TInterface, TEnd, TBegin >::Reference< TBitSetCM >::Reference ( TBitSetCM & set,
TInterface b )
inlineconstexprnoexcept

Constructor.

Note
In contrast to the constructor of std::bitset::reference, this constructor is public to allow easy external construction.
Parameters
setThe parent TBitSet.
bThe bit to represent in the TBitSet.

Definition at line 173 of file bitset.inl.

◆ ~Reference()

template<typename TInterface, TInterface TEnd, TInterface TBegin = 0>
template<typename TBitSetCM>
alib::lang::TBitSet< TInterface, TEnd, TBegin >::Reference< TBitSetCM >::~Reference ( )
inlinenoexcept

Destructor. (Is declared constexpr with C++23.)

Definition at line 181 of file bitset.inl.

Method Details:

◆ Bit()

template<typename TInterface, TInterface TEnd, TInterface TBegin = 0>
template<typename TBitSetCM>
TInterface alib::lang::TBitSet< TInterface, TEnd, TBegin >::Reference< TBitSetCM >::Bit ( ) const
inlineconstexprnoexcept

Returns the represented bit number.

Returns
The bit that this object refers to.

Definition at line 191 of file bitset.inl.

◆ Flip()

template<typename TInterface, TInterface TEnd, TInterface TBegin = 0>
template<typename TBitSetCM>
Reference & alib::lang::TBitSet< TInterface, TEnd, TBegin >::Reference< TBitSetCM >::Flip ( )
inlineconstexprnoexcept

Flips the represented bit.

Returns
A reference to this.

Definition at line 222 of file bitset.inl.

◆ operator bool()

template<typename TInterface, TInterface TEnd, TInterface TBegin = 0>
template<typename TBitSetCM>
alib::lang::TBitSet< TInterface, TEnd, TBegin >::Reference< TBitSetCM >::operator bool ( )
inlineconstexprnoexcept

Implicit conversion to bool.

Returns
The value of the represented bit.

Definition at line 212 of file bitset.inl.

◆ operator=() [1/2]

template<typename TInterface, TInterface TEnd, TInterface TBegin = 0>
template<typename TBitSetCM>
Reference & alib::lang::TBitSet< TInterface, TEnd, TBegin >::Reference< TBitSetCM >::operator= ( bool val)
inlineconstexprnoexcept

Sets or resets the represented bit.

Parameters
valThe value to assign to the represented bit.
Returns
A reference to this.

Definition at line 207 of file bitset.inl.

◆ operator=() [2/2]

template<typename TInterface, TInterface TEnd, TInterface TBegin = 0>
template<typename TBitSetCM>
Reference & alib::lang::TBitSet< TInterface, TEnd, TBegin >::Reference< TBitSetCM >::operator= ( const Reference< TBitSetCM > & other)
defaultnoexcept

Copy assignment operator. (Defaulted, as otherwise implicitly deleted due to user-provided destructor.)

Parameters
otherThe object to copy.
Returns
A reference to this.

◆ operator==()

template<typename TInterface, TInterface TEnd, TInterface TBegin = 0>
template<typename TBitSetCM>
bool alib::lang::TBitSet< TInterface, TEnd, TBegin >::Reference< TBitSetCM >::operator== ( const Reference< TBitSetCM > & rhs) const
constexprdefaultnoexcept

Compares this object to another.

Parameters
rhsThe right hand side of the comparison.
Returns
true if the objects reference the same bit in the same bitset, false otherwise

◆ operator~()

template<typename TInterface, TInterface TEnd, TInterface TBegin = 0>
template<typename TBitSetCM>
bool alib::lang::TBitSet< TInterface, TEnd, TBegin >::Reference< TBitSetCM >::operator~ ( )
inlineconstexprnoexcept

Does not manipulate the bit, but returns its negated value.

Returns
The negated value of the represented bit.

Definition at line 217 of file bitset.inl.

◆ TBitSet() [1/2]

template<typename TInterface, TInterface TEnd, TInterface TBegin = 0>
template<typename TBitSetCM>
const class TBitSet & alib::lang::TBitSet< TInterface, TEnd, TBegin >::Reference< TBitSetCM >::TBitSet ( ) const
inlineconstexprnoexcept

Returns the underlying bitset.

Returns
The TBitSet that this object refers to.

Definition at line 201 of file bitset.inl.

◆ TBitSet() [2/2]

template<typename TInterface, TInterface TEnd, TInterface TBegin = 0>
template<typename TBitSetCM>
class TBitSet & alib::lang::TBitSet< TInterface, TEnd, TBegin >::Reference< TBitSetCM >::TBitSet ( )
inlineconstexprnoexcept

Returns the underlying bitset.

Returns
The TBitSet that this object refers to.

Definition at line 196 of file bitset.inl.


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