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
libfsst::Symbol Struct Reference

Public Member Functions

 Symbol (u8 c, u16 code)
 Symbol (const char *begin, const char *end)
 Symbol (const u8 *begin, const u8 *end)
 Symbol (const char *input, u32 len)
void set_code_len (u32 code, u32 len)
u64 load_num () const
void store_num (u64 v)
u32 length () const
u16 code () const
u32 ignoredBits () const
u8 first () const
u16 first2 () const
size_t hash () const

Public Attributes

union { 
   char   str [maxLength] 
   u64   num 
} val
u64 icl

Static Public Attributes

static const unsigned maxLength = 8

Constructor & Destructor Documentation

◆ Symbol() [1/5]

libfsst::Symbol::Symbol ( )
inline
450411: icl(0) { val.num = 0; }

◆ Symbol() [2/5]

libfsst::Symbol::Symbol ( u8 c,
u16 code )
inlineexplicit
450413: icl((1<<28)|(code<<16)|56) { store_num(c); } // single-char symbol

◆ Symbol() [3/5]

libfsst::Symbol::Symbol ( const char * begin,
const char * end )
inlineexplicit
450414: Symbol(begin, (u32) (end-begin)) {}

◆ Symbol() [4/5]

libfsst::Symbol::Symbol ( const u8 * begin,
const u8 * end )
inlineexplicit
450415: Symbol((const char*)begin, (u32) (end-begin)) {}

◆ Symbol() [5/5]

libfsst::Symbol::Symbol ( const char * input,
u32 len )
inlineexplicit
450416 {
450417 val.num = 0;
450418 if (len>=8) {
450419 len = 8;
450420 memcpy(val.str, input, 8);
450421 } else {
450422 memcpy(val.str, input, len);
450423 }
450424 set_code_len(FSST_CODE_MAX, len);
450425 }

Member Function Documentation

◆ set_code_len()

void libfsst::Symbol::set_code_len ( u32 code,
u32 len )
inline
450426{ icl = (len<<28)|(code<<16)|((8-len)*8); }

◆ load_num()

u64 libfsst::Symbol::load_num ( ) const
inline
450428{ return swap64_if_be(val.num); }

◆ store_num()

void libfsst::Symbol::store_num ( u64 v)
inline
450429{ val.num = swap64_if_be(v); }
uint32_t v

◆ length()

u32 libfsst::Symbol::length ( ) const
inline
450431{ return (u32) (icl >> 28); }

◆ code()

u16 libfsst::Symbol::code ( ) const
inline
450432{ return (icl >> 16) & FSST_CODE_MASK; }

◆ ignoredBits()

u32 libfsst::Symbol::ignoredBits ( ) const
inline
450433{ return (u32) icl; }

◆ first()

u8 libfsst::Symbol::first ( ) const
inline
450435{ assert( length() >= 1); return 0xFF & load_num(); }
#define assert(x)
Definition duckdb.cpp:486071

◆ first2()

u16 libfsst::Symbol::first2 ( ) const
inline
450436{ assert( length() >= 2); return 0xFFFF & load_num(); }

◆ hash()

size_t libfsst::Symbol::hash ( ) const
inline
450442{ size_t v = 0xFFFFFF & load_num(); return FSST_HASH(v); } // hash on the next 3 bytes

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