Autonomy Software C++ 24.5.1
Welcome to the Autonomy Software repository of the Mars Rover Design Team (MRDT) at Missouri University of Science and Technology (Missouri S&T)! API reference contains the source code and other resources for the development of the autonomy software for our Mars rover. The Autonomy Software project aims to compete in the University Rover Challenge (URC) by demonstrating advanced autonomous capabilities and robust navigation algorithms.
Loading...
Searching...
No Matches
duckdb::dtime_tz_t Struct Reference

Public Member Functions

 dtime_tz_t (dtime_t t, int32_t offset)
 
 dtime_tz_t (uint64_t bits_p)
 
dtime_t time () const
 
int32_t offset () const
 
uint64_t sort_key () const
 
bool operator== (const dtime_tz_t &rhs) const
 
bool operator!= (const dtime_tz_t &rhs) const
 
bool operator<= (const dtime_tz_t &rhs) const
 
bool operator< (const dtime_tz_t &rhs) const
 
bool operator> (const dtime_tz_t &rhs) const
 
bool operator>= (const dtime_tz_t &rhs) const
 

Static Public Member Functions

static uint64_t encode_offset (int32_t offset)
 
static int32_t decode_offset (uint64_t bits)
 
static uint64_t encode_micros (int64_t micros)
 
static uint64_t encode_micros (uint64_t micros)
 
static int64_t decode_micros (uint64_t bits)
 

Public Attributes

uint64_t bits
 

Static Public Attributes

static constexpr const int TIME_BITS = 40
 
static constexpr const int OFFSET_BITS = 24
 
static constexpr const uint64_t OFFSET_MASK = ~uint64_t(0) >> TIME_BITS
 
static constexpr const int32_t MAX_OFFSET = 16 * 60 * 60 - 1
 
static constexpr const int32_t MIN_OFFSET = -MAX_OFFSET
 
static constexpr const uint64_t OFFSET_MICROS = 1000000
 

Constructor & Destructor Documentation

◆ dtime_tz_t() [1/2]

duckdb::dtime_tz_t::dtime_tz_t ( dtime_t  t,
int32_t  offset 
)
inline
4565 : bits(encode_micros(t.micros) | encode_offset(offset)) {
4566 }

◆ dtime_tz_t() [2/2]

duckdb::dtime_tz_t::dtime_tz_t ( uint64_t  bits_p)
inlineexplicit
4567 : bits(bits_p) {
4568 }

Member Function Documentation

◆ encode_offset()

static uint64_t duckdb::dtime_tz_t::encode_offset ( int32_t  offset)
inlinestatic
4546 { // NOLINT
4547 return uint64_t(MAX_OFFSET - offset);
4548 }
::uint64_t uint64_t

◆ decode_offset()

static int32_t duckdb::dtime_tz_t::decode_offset ( uint64_t  bits)
inlinestatic
4549 { // NOLINT
4550 return MAX_OFFSET - int32_t(bits & OFFSET_MASK);
4551 }
::int32_t int32_t

◆ encode_micros() [1/2]

static uint64_t duckdb::dtime_tz_t::encode_micros ( int64_t  micros)
inlinestatic
4553 { // NOLINT
4554 return encode_micros(UnsafeNumericCast<uint64_t>(micros));
4555 }

◆ encode_micros() [2/2]

static uint64_t duckdb::dtime_tz_t::encode_micros ( uint64_t  micros)
inlinestatic
4556 { // NOLINT
4557 return micros << OFFSET_BITS;
4558 }

◆ decode_micros()

static int64_t duckdb::dtime_tz_t::decode_micros ( uint64_t  bits)
inlinestatic
4559 { // NOLINT
4560 return int64_t(bits >> OFFSET_BITS);
4561 }
::int64_t int64_t

◆ time()

dtime_t duckdb::dtime_tz_t::time ( ) const
inline
4570 { // NOLINT
4571 return dtime_t(decode_micros(bits));
4572 }

◆ offset()

int32_t duckdb::dtime_tz_t::offset ( ) const
inline
4574 { // NOLINT
4575 return decode_offset(bits);
4576 }

◆ sort_key()

uint64_t duckdb::dtime_tz_t::sort_key ( ) const
inline
4581 { // NOLINT
4582 return bits + encode_micros((bits & OFFSET_MASK) * OFFSET_MICROS);
4583 }

◆ operator==()

bool duckdb::dtime_tz_t::operator== ( const dtime_tz_t rhs) const
inline
4586 {
4587 return bits == rhs.bits;
4588 };

◆ operator!=()

bool duckdb::dtime_tz_t::operator!= ( const dtime_tz_t rhs) const
inline
4589 {
4590 return bits != rhs.bits;
4591 };

◆ operator<=()

bool duckdb::dtime_tz_t::operator<= ( const dtime_tz_t rhs) const
inline
4592 {
4593 return sort_key() <= rhs.sort_key();
4594 };

◆ operator<()

bool duckdb::dtime_tz_t::operator< ( const dtime_tz_t rhs) const
inline
4595 {
4596 return sort_key() < rhs.sort_key();
4597 };

◆ operator>()

bool duckdb::dtime_tz_t::operator> ( const dtime_tz_t rhs) const
inline
4598 {
4599 return sort_key() > rhs.sort_key();
4600 };

◆ operator>=()

bool duckdb::dtime_tz_t::operator>= ( const dtime_tz_t rhs) const
inline
4601 {
4602 return sort_key() >= rhs.sort_key();
4603 };

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