SatCat5
satcat5::util::WideUnsigned< W > Struct Template Reference

Detailed Description

template<unsigned W>
struct satcat5::util::WideUnsigned< W >

Template for unsigned integers.

See also
wide_integer.h.

Definition at line 485 of file wide_integer.h.

#include <wide_integer.h>

Inheritance diagram for satcat5::util::WideUnsigned< W >:
[legend]
Collaboration diagram for satcat5::util::WideUnsigned< W >:
[legend]

Public Member Functions

WideUnsigned< W > operator- () const
 Common arithmetic operators. More...
 
WideUnsigned< W > operator+ (const WideInteger< W > &rhs) const
 
WideUnsigned< W > & operator+= (const WideInteger< W > &rhs)
 
WideUnsigned< W > operator- (const WideInteger< W > &rhs) const
 
WideUnsigned< W > & operator-= (const WideInteger< W > &rhs)
 
WideUnsigned< W > operator* (const WideInteger< W > &rhs) const
 
WideUnsigned< W > & operator*= (const WideInteger< W > &rhs)
 
WideUnsigned< W > operator/ (const WideUnsigned< W > &rhs) const
 
WideUnsigned< W > operator% (const WideUnsigned< W > &rhs) const
 
WideUnsigned< W > & operator/= (const WideInteger< W > &rhs)
 
WideUnsigned< W > & operator%= (const WideInteger< W > &rhs)
 
WideUnsigned< W > operator<< (unsigned rhs) const
 
WideUnsigned< W > operator<<= (unsigned rhs)
 
WideUnsigned< W > operator>> (unsigned rhs) const
 
WideUnsigned< W > operator>>= (unsigned rhs)
 
WideUnsigned< W > operator~ () const
 
WideUnsigned< W > & operator|= (const WideInteger< W > &rhs)
 
WideUnsigned< W > & operator&= (const WideInteger< W > &rhs)
 
WideUnsigned< W > & operator^= (const WideInteger< W > &rhs)
 
WideUnsigned< W > operator| (const WideInteger< W > &rhs) const
 
WideUnsigned< W > operator& (const WideInteger< W > &rhs) const
 
WideUnsigned< W > operator^ (const WideInteger< W > &rhs) const
 
WideUnsigned< W > div_round (const WideUnsigned< W > &rhs) const
 
void divmod (const WideUnsigned< W > &rhs, WideUnsigned< W > &div, WideUnsigned< W > &mod) const
 Combined divide + modulo function.
 
unsigned width_bits () const
 Total width in bits.
 
unsigned width_words () const
 Total width in 32-bit words.
 
unsigned msb () const
 Index of most significant '1' bit.
 
constexpr u32 sign_extend () const
 Extend most significant word with either "0" or "FFFF...".
 
void log_to (satcat5::log::LogBuffer &obj) const
 Human-readable logging in hexadecimal format.
 
bool read_from (satcat5::io::Readable *rd)
 Read binary data from a given source.
 
void write_to (satcat5::io::Writeable *wr) const
 Write binary data from a given sink.
 
constexpr WideUnsigned ()
 Constructors for various input formats.
 
constexpr WideUnsigned (u32 rhs)
 Constructors for various input formats.
 
constexpr WideUnsigned (u64 rhs)
 Constructors for various input formats.
 
constexpr WideUnsigned (u32 hi, u32 lo)
 Constructors for various input formats.
 
 WideUnsigned (const satcat5::util::WideInteger< W > &rhs)
 Constructors for various input formats.
 
WideUnsigned< W > & operator= (const WideInteger< W > &rhs)
 Constructors for various input formats.
 
bool operator< (const WideUnsigned< W > &rhs) const
 Comparison operators.
 
bool operator> (const WideUnsigned< W > &rhs) const
 Comparison operators.
 
bool operator<= (const WideUnsigned< W > &rhs) const
 Comparison operators.
 
bool operator>= (const WideUnsigned< W > &rhs) const
 Comparison operators.
 
WideInteger< W > & operator++ ()
 Increment/decrement.
 
WideInteger< W > operator++ (int)
 Increment/decrement.
 
WideInteger< W > & operator-- ()
 Increment/decrement.
 
WideInteger< W > operator-- (int)
 Increment/decrement.
 
bool operator== (const WideInteger< W > &rhs) const
 Equality comparison only. More...
 
bool operator!= (const WideInteger< W > &rhs) const
 Equality comparison only. More...
 
 operator bool () const
 Conversion to other basic types.
 
constexpr operator int32_t () const
 Conversion to other basic types.
 
constexpr operator int64_t () const
 Conversion to other basic types.
 
constexpr operator uint32_t () const
 Conversion to other basic types.
 
constexpr operator uint64_t () const
 Conversion to other basic types.
 

Public Attributes

u32 m_data [W]
 Underlying data vector, LSW-first.
 

Protected Member Functions

template<unsigned W2>
void copy_from (const satcat5::util::WideInteger< W2 > &rhs, u32 ext)
 
WideInteger< W > add (const WideInteger< W > &rhs) const
 
void add_in_place (const WideInteger< W > &rhs)
 
WideInteger< W > subtract (const WideInteger< W > &rhs) const
 
WideInteger< W > multiply (const WideInteger< W > &rhs) const
 
WideInteger< W > shift_left (unsigned rhs) const
 
WideInteger< W > shift_right (unsigned rhs, u32 ext) const
 
WideInteger< W > bitwise_invert () const
 
void bitwise_or (const WideInteger< W > &rhs)
 
void bitwise_and (const WideInteger< W > &rhs)
 
void bitwise_xor (const WideInteger< W > &rhs)
 

Static Protected Member Functions

template<typename T >
static constexpr u32 sign_extend (T x)
 

Member Function Documentation

◆ operator!=()

template<unsigned W>
bool satcat5::util::WideInteger< W >::operator!= ( const WideInteger< W > &  rhs) const
inlineinherited

Equality comparison only.

Greater-than and less-than require signed/unsigned specialization.

Definition at line 104 of file wide_integer.h.

◆ operator-()

template<unsigned W>
WideUnsigned<W> satcat5::util::WideUnsigned< W >::operator- ( ) const
inline

Common arithmetic operators.

Returned type always matches the first argument.

Definition at line 507 of file wide_integer.h.

◆ operator==()

template<unsigned W>
bool satcat5::util::WideInteger< W >::operator== ( const WideInteger< W > &  rhs) const
inlineinherited

Equality comparison only.

Greater-than and less-than require signed/unsigned specialization.

Definition at line 96 of file wide_integer.h.


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