Bitcoin Core 31.0.0
P2P Digital Currency
Loading...
Searching...
No Matches
BitsInt< I, BITS > Class Template Reference

#include <int_utils.h>

Public Types

typedef I Repr

Static Public Member Functions

static void Swap (I &a, I &b)
static constexpr bool IsZero (I a)
static constexpr bool IsOne (I a)
static constexpr I Mask (I val)
static constexpr I Shift (I val, int bits)
static constexpr I UnsafeShift (I val, int bits)
template<int Offset, int Count>
static constexpr int MidBits (I val)
template<int Count>
static constexpr int TopBits (I val)
static constexpr I CondXorWith (I val, bool cond, I v)
template<I MOD>
static constexpr I CondXorWith (I val, bool cond)
static int Bits (I val, int max)

Static Public Attributes

static constexpr int SIZE = BITS

Static Private Attributes

static constexpr I MASK = Mask<BITS, I>()

Detailed Description

template<typename I, int BITS>
class BitsInt< I, BITS >

Definition at line 179 of file int_utils.h.

Member Typedef Documentation

◆ Repr

template<typename I, int BITS>
typedef I BitsInt< I, BITS >::Repr

Definition at line 188 of file int_utils.h.

Member Function Documentation

◆ Bits()

template<typename I, int BITS>
int BitsInt< I, BITS >::Bits ( I val,
int max )
inlinestatic

Definition at line 225 of file int_utils.h.

◆ CondXorWith() [1/2]

template<typename I, int BITS>
template<I MOD>
constexpr I BitsInt< I, BITS >::CondXorWith ( I val,
bool cond )
inlinestaticconstexpr

Definition at line 221 of file int_utils.h.

◆ CondXorWith() [2/2]

template<typename I, int BITS>
constexpr I BitsInt< I, BITS >::CondXorWith ( I val,
bool cond,
I v )
inlinestaticconstexpr

Definition at line 216 of file int_utils.h.

◆ IsOne()

template<typename I, int BITS>
constexpr bool BitsInt< I, BITS >::IsOne ( I a)
inlinestaticconstexpr

Definition at line 197 of file int_utils.h.

◆ IsZero()

template<typename I, int BITS>
constexpr bool BitsInt< I, BITS >::IsZero ( I a)
inlinestaticconstexpr

Definition at line 196 of file int_utils.h.

◆ Mask()

template<typename I, int BITS>
constexpr I BitsInt< I, BITS >::Mask ( I val)
inlinestaticconstexpr

Definition at line 198 of file int_utils.h.

◆ MidBits()

template<typename I, int BITS>
template<int Offset, int Count>
constexpr int BitsInt< I, BITS >::MidBits ( I val)
inlinestaticconstexpr

Definition at line 203 of file int_utils.h.

◆ Shift()

template<typename I, int BITS>
constexpr I BitsInt< I, BITS >::Shift ( I val,
int bits )
inlinestaticconstexpr

Definition at line 199 of file int_utils.h.

◆ Swap()

template<typename I, int BITS>
void BitsInt< I, BITS >::Swap ( I & a,
I & b )
inlinestatic

Definition at line 192 of file int_utils.h.

◆ TopBits()

template<typename I, int BITS>
template<int Count>
constexpr int BitsInt< I, BITS >::TopBits ( I val)
inlinestaticconstexpr

Definition at line 210 of file int_utils.h.

◆ UnsafeShift()

template<typename I, int BITS>
constexpr I BitsInt< I, BITS >::UnsafeShift ( I val,
int bits )
inlinestaticconstexpr

Definition at line 200 of file int_utils.h.

Member Data Documentation

◆ MASK

template<typename I, int BITS>
I BitsInt< I, BITS >::MASK = Mask<BITS, I>()
staticconstexprprivate

Definition at line 184 of file int_utils.h.

◆ SIZE

template<typename I, int BITS>
int BitsInt< I, BITS >::SIZE = BITS
staticconstexpr

Definition at line 190 of file int_utils.h.


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