Botan 3.13.0
Crypto and TLS for C&
Botan::bitvector_base< AllocatorT >::bitref< BlockT > Class Template Referencefinal

#include <bitvector.h>

Public Member Functions

template<std::unsigned_integral T>
constexpr T as () const noexcept
constexpr CT::Choice as_choice () const noexcept
constexpr bool is_set () const noexcept
constexpr operator bool () const noexcept

Protected Attributes

BlockT & m_block
BlockT m_mask

Detailed Description

template<template< typename > typename AllocatorT>
template<typename BlockT>
class Botan::bitvector_base< AllocatorT >::bitref< BlockT >

Wraps a constant reference into the bitvector. Bit can be accessed but not modified.

Definition at line 308 of file bitvector.h.

Member Function Documentation

◆ as()

template<template< typename > typename AllocatorT>
template<typename BlockT>
template<std::unsigned_integral T>
T Botan::bitvector_base< AllocatorT >::bitref_base< BlockT >::as ( ) const
inlineconstexprnoexceptinherited

Definition at line 289 of file bitvector.h.

289 {
290 return static_cast<T>(is_set());
291 }

◆ as_choice()

template<template< typename > typename AllocatorT>
template<typename BlockT>
CT::Choice Botan::bitvector_base< AllocatorT >::bitref_base< BlockT >::as_choice ( ) const
inlineconstexprnoexceptinherited

Definition at line 293 of file bitvector.h.

293 {
294 return CT::Choice::from_int(static_cast<BlockT>(m_block & m_mask));
295 }
static constexpr Choice from_int(T v)
Definition ct_utils.h:268

◆ is_set()

template<template< typename > typename AllocatorT>
template<typename BlockT>
bool Botan::bitvector_base< AllocatorT >::bitref_base< BlockT >::is_set ( ) const
inlineconstexprnoexceptinherited

Definition at line 286 of file bitvector.h.

286{ return (m_block & m_mask) > 0; }

◆ operator bool()

template<template< typename > typename AllocatorT>
template<typename BlockT>
Botan::bitvector_base< AllocatorT >::bitref_base< BlockT >::operator bool ( ) const
inlineconstexprnoexceptinherited

Definition at line 284 of file bitvector.h.

284{ return is_set(); }

Member Data Documentation

◆ m_block

template<template< typename > typename AllocatorT>
template<typename BlockT>
BlockT& Botan::bitvector_base< AllocatorT >::bitref_base< BlockT >::m_block
protectedinherited

Definition at line 298 of file bitvector.h.

◆ m_mask

template<template< typename > typename AllocatorT>
template<typename BlockT>
BlockT Botan::bitvector_base< AllocatorT >::bitref_base< BlockT >::m_mask
protectedinherited

Definition at line 299 of file bitvector.h.


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