RAVENNAKIT
Loading...
Searching...
No Matches
rav::uint48_t Class Reference

Custom 48 bit unsigned integer type. More...

#include <uint48.hpp>

Public Member Functions

 uint48_t ()=default
 uint48_t (uint64_t value)
 Construct an uint48_t from a uint64_t value.
 operator uint64_t () const
 Get a uint64_t representation of the int48_t.
const uint8_t * data () const
uint64_t to_uint64 () const
bool operator== (const uint48_t &other) const
bool operator!= (const uint48_t &other) const
bool operator< (const uint48_t &other) const
bool operator> (const uint48_t &other) const
bool operator<= (const uint48_t &other) const
bool operator>= (const uint48_t &other) const

Detailed Description

Custom 48 bit unsigned integer type.

Primarily used for PTP, but can be used for other purposes.

Definition at line 36 of file uint48.hpp.

Constructor & Destructor Documentation

◆ uint48_t() [1/2]

rav::uint48_t::uint48_t ( )
default

◆ uint48_t() [2/2]

rav::uint48_t::uint48_t ( uint64_t value)
inline

Construct an uint48_t from a uint64_t value.

The value is truncated to 48 bits.

Parameters
valueThe value to store in the uint48_t.

Definition at line 45 of file uint48.hpp.

Member Function Documentation

◆ data()

const uint8_t * rav::uint48_t::data ( ) const
inlinenodiscard
Returns
A pointer to the data stored in the int48_t.

Definition at line 61 of file uint48.hpp.

◆ operator uint64_t()

rav::uint48_t::operator uint64_t ( ) const
inlineexplicit

Get a uint64_t representation of the int48_t.

Definition at line 52 of file uint48.hpp.

◆ operator!=()

bool rav::uint48_t::operator!= ( const uint48_t & other) const
inlinenodiscard

Definition at line 76 of file uint48.hpp.

◆ operator<()

bool rav::uint48_t::operator< ( const uint48_t & other) const
inlinenodiscard

Definition at line 80 of file uint48.hpp.

◆ operator<=()

bool rav::uint48_t::operator<= ( const uint48_t & other) const
inlinenodiscard

Definition at line 88 of file uint48.hpp.

◆ operator==()

bool rav::uint48_t::operator== ( const uint48_t & other) const
inlinenodiscard

Definition at line 72 of file uint48.hpp.

◆ operator>()

bool rav::uint48_t::operator> ( const uint48_t & other) const
inlinenodiscard

Definition at line 84 of file uint48.hpp.

◆ operator>=()

bool rav::uint48_t::operator>= ( const uint48_t & other) const
inlinenodiscard

Definition at line 92 of file uint48.hpp.

◆ to_uint64()

uint64_t rav::uint48_t::to_uint64 ( ) const
inlinenodiscard
Returns
The value stored in the int48_t as an int64_t.

Definition at line 68 of file uint48.hpp.


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