reflex::Bits::Bitref Struct Reference

updated Tue Oct 29 2024 by Robert van Engelen
 
Public Member Functions | Public Attributes | List of all members
reflex::Bits::Bitref Struct Reference

References a single bit, returned by operator[]. More...

#include <bits.h>

Public Member Functions

 Bitref (size_t n, uint64_t *p)
 
 operator bool () const
 Returns bit value. More...
 
const Bitrefoperator= (bool b) const
 Assign bit value. More...
 
bool operator|= (bool b) const
 Bit-or bit value. More...
 
bool operator&= (bool b) const
 Bit-and bit value. More...
 
bool operator^= (bool b) const
 Bit-xor bit value. More...
 

Public Attributes

uint64_t m
 mask m = 2^n More...
 
uint64_t * p
 

Detailed Description

References a single bit, returned by operator[].

Constructor & Destructor Documentation

reflex::Bits::Bitref::Bitref ( size_t  n,
uint64_t *  p 
)
inline
Parameters
nn'th bit
pin this word

Member Function Documentation

reflex::Bits::Bitref::operator bool ( ) const
inline

Returns bit value.

Returns
bit value true or false.
bool reflex::Bits::Bitref::operator&= ( bool  b) const
inline

Bit-and bit value.

Returns
result value true or false.
Parameters
bbit-and with this bit
const Bitref& reflex::Bits::Bitref::operator= ( bool  b) const
inline

Assign bit value.

Returns
result value true or false.
Parameters
bbit to assign
bool reflex::Bits::Bitref::operator^= ( bool  b) const
inline

Bit-xor bit value.

Returns
result value true or false.
Parameters
bbit-xor with this bit
bool reflex::Bits::Bitref::operator|= ( bool  b) const
inline

Bit-or bit value.

Returns
result value true or false.
Parameters
bbit-or with this bit

Member Data Documentation

uint64_t reflex::Bits::Bitref::m

mask m = 2^n

uint64_t* reflex::Bits::Bitref::p

in this word


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