EMAN2
Public Member Functions | Private Attributes | Friends | List of all members
EMAN::BitReader< T, BIT_OVERFLOW, U > Class Template Reference

#include <eerio.h>

Collaboration diagram for EMAN::BitReader< T, BIT_OVERFLOW, U >:
Collaboration graph
[legend]

Public Member Functions

 operator decltype (val) const ()
 

Private Attributes

const decltype(T) num_bits = T
 
const decltype(T) max_val = (1 << num_bits) - 1
 
uintmax_t val = 0
 

Friends

BitStream< U > & operator>> (BitStream< U > &in, BitReader< T, BIT_OVERFLOW, U > &obj)
 

Detailed Description

template<unsigned int T, bool BIT_OVERFLOW, class U>
class EMAN::BitReader< T, BIT_OVERFLOW, U >

Definition at line 85 of file eerio.h.

Member Function Documentation

◆ operator decltype()

template<unsigned int T, bool BIT_OVERFLOW, class U >
EMAN::BitReader< T, BIT_OVERFLOW, U >::operator decltype ( val  ) const
inline

Definition at line 92 of file eerio.h.

92 {
93 return val;
94 }
uintmax_t val
Definition: eerio.h:89

References EMAN::BitReader< T, BIT_OVERFLOW, U >::val.

Friends And Related Function Documentation

◆ operator>>

template<unsigned int T, bool BIT_OVERFLOW, class U >
BitStream< U > & operator>> ( BitStream< U > &  in,
BitReader< T, BIT_OVERFLOW, U > &  obj 
)
friend

Definition at line 96 of file eerio.h.

96 {
97 decltype(val) count;
98 obj.val = 0;
99 do {
100 count = in.get_bits(obj.num_bits);
101 obj.val += count;
102 } while(BIT_OVERFLOW && count == obj.max_val);
103
104 return in;
105 }

Member Data Documentation

◆ max_val

template<unsigned int T, bool BIT_OVERFLOW, class U >
const decltype(T) EMAN::BitReader< T, BIT_OVERFLOW, U >::max_val = (1 << num_bits) - 1
private

Definition at line 88 of file eerio.h.

◆ num_bits

template<unsigned int T, bool BIT_OVERFLOW, class U >
const decltype(T) EMAN::BitReader< T, BIT_OVERFLOW, U >::num_bits = T
private

Definition at line 87 of file eerio.h.

◆ val

template<unsigned int T, bool BIT_OVERFLOW, class U >
uintmax_t EMAN::BitReader< T, BIT_OVERFLOW, U >::val = 0
private

Definition at line 89 of file eerio.h.

Referenced by EMAN::BitReader< T, BIT_OVERFLOW, U >::operator decltype().


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