MySQL 9.1.0
Source Code Documentation
uca_scanner_900< Mb_wc, LEVELS_FOR_COMPARE > Class Template Reference
Inheritance diagram for uca_scanner_900< Mb_wc, LEVELS_FOR_COMPARE >:
[legend]

Public Member Functions

 uca_scanner_900 (const Mb_wc mb_wc, const CHARSET_INFO *cs_arg, const uint8_t *str, size_t length)
 
int next ()
 
template<class T , class U >
void for_each_weight (T func, U preaccept_data)
 For each weight in sequence, call "func", which should have a function signature of "bool func(int weight, bool is_level_separator)". More...
 
template<class T , class U >
ALWAYS_INLINE void for_each_weight (T func, U preaccept_data)
 
- Public Member Functions inherited from my_uca_scanner
unsigned get_weight_level () const
 Get the level the scanner is currently working on. More...
 

Private Member Functions

int next_raw ()
 
int more_weight ()
 
uint16_t apply_case_first (uint16_t weight)
 
uint16_t apply_reorder_param (uint16_t weight)
 Change a weight according to the reorder parameters. More...
 
int next_implicit (my_wc_t ch)
 
void my_put_jamo_weights (my_wc_t *hangul_jamo, int jamo_cnt)
 
int handle_ja_contraction_quat_wt ()
 Return quaternary weight when running for that level. More...
 
int handle_ja_common_quat_wt (my_wc_t wc)
 Check whether quaternary weight is needed for character with Japanese kana-sensitive collation. More...
 

Private Attributes

const Mb_wc mb_wc
 
bool return_origin_weight {true}
 
bool has_quaternary_weight {false}
 

Additional Inherited Members

- Protected Member Functions inherited from my_uca_scanner
 my_uca_scanner (const CHARSET_INFO *cs_arg, const uint8_t *str, size_t length)
 
const uint16_t * contraction_find (my_wc_t wc0, size_t *chars_skipped)
 Find a contraction in the input stream and return its weight array. More...
 
const uint16_t * previous_context_find (my_wc_t wc0, my_wc_t wc1)
 Find weight for contraction with previous context and return its weight array. More...
 
- Protected Attributes inherited from my_uca_scanner
unsigned weight_lv {0}
 
const uint16_t * wbeg
 
unsigned wbeg_stride {0}
 
const uint8_t * sbeg
 
const uint8_t * send
 
const MY_UCA_INFOuca {nullptr}
 
uint16_t implicit [10] {}
 
my_wc_t prev_char {0}
 
const CHARSET_INFOcs
 
unsigned num_of_ce_left {0}
 
const uint8_t * sbeg_dup
 

Constructor & Destructor Documentation

◆ uca_scanner_900()

template<class Mb_wc , int LEVELS_FOR_COMPARE>
uca_scanner_900< Mb_wc, LEVELS_FOR_COMPARE >::uca_scanner_900 ( const Mb_wc  mb_wc,
const CHARSET_INFO cs_arg,
const uint8_t *  str,
size_t  length 
)
inline

Member Function Documentation

◆ apply_case_first()

template<class Mb_wc , int LEVELS_FOR_COMPARE>
uint16_t uca_scanner_900< Mb_wc, LEVELS_FOR_COMPARE >::apply_case_first ( uint16_t  weight)
private

◆ apply_reorder_param()

template<class Mb_wc , int LEVELS_FOR_COMPARE>
uint16_t uca_scanner_900< Mb_wc, LEVELS_FOR_COMPARE >::apply_reorder_param ( uint16_t  weight)
private

Change a weight according to the reorder parameters.

Parameters
weightThe weight to change
Return values
reorderedweight

◆ for_each_weight() [1/2]

template<class Mb_wc , int LEVELS_FOR_COMPARE>
template<class T , class U >
void uca_scanner_900< Mb_wc, LEVELS_FOR_COMPARE >::for_each_weight ( func,
U  preaccept_data 
)
inline

For each weight in sequence, call "func", which should have a function signature of "bool func(int weight, bool is_level_separator)".

Stops the iteration early if "func" returns false.

This is morally equivalent to

int weight; while ((weight= next()) >= 0) { if (!func(weight, weight == 0)) break; }

except that it might employ optimizations internally to speed up the process. These optimizations will not modify the number of calls to func() (or their order), but might affect the internal scanner state during the calls, so func() should not try to read from the scanner except by calling public member functions.

As a special optimization, if "bool preaccept_data(int num_weights)" returns true, the next "num_weights" calls to func() must return true. This is so that bounds checking costs can be amortized over fewer calls.

◆ for_each_weight() [2/2]

template<class Mb_wc , int LEVELS_FOR_COMPARE>
template<class T , class U >
ALWAYS_INLINE void uca_scanner_900< Mb_wc, LEVELS_FOR_COMPARE >::for_each_weight ( func,
U  preaccept_data 
)

◆ handle_ja_common_quat_wt()

template<class Mb_wc , int LEVELS_FOR_COMPARE>
ALWAYS_INLINE int uca_scanner_900< Mb_wc, LEVELS_FOR_COMPARE >::handle_ja_common_quat_wt ( my_wc_t  wc)
private

Check whether quaternary weight is needed for character with Japanese kana-sensitive collation.

If it is, return quaternary weight when running for that level.

Return values
0- Quaternary weight check is done.
-1- There is no quaternary weight for this character.
others- Quaternary weight for this character.

◆ handle_ja_contraction_quat_wt()

template<class Mb_wc , int LEVELS_FOR_COMPARE>
ALWAYS_INLINE int uca_scanner_900< Mb_wc, LEVELS_FOR_COMPARE >::handle_ja_contraction_quat_wt
private

Return quaternary weight when running for that level.

Return values
0- Do not return quaternary weight.
others- Quaternary weight for this character.

◆ more_weight()

template<class Mb_wc , int LEVELS_FOR_COMPARE>
int uca_scanner_900< Mb_wc, LEVELS_FOR_COMPARE >::more_weight
inlineprivate

◆ my_put_jamo_weights()

template<class Mb_wc , int LEVELS_FOR_COMPARE>
void uca_scanner_900< Mb_wc, LEVELS_FOR_COMPARE >::my_put_jamo_weights ( my_wc_t hangul_jamo,
int  jamo_cnt 
)
private

◆ next()

template<class Mb_wc , int LEVELS_FOR_COMPARE>
ALWAYS_INLINE int uca_scanner_900< Mb_wc, LEVELS_FOR_COMPARE >::next ( void  )
inline

◆ next_implicit()

template<class Mb_wc , int LEVELS_FOR_COMPARE>
ALWAYS_INLINE int uca_scanner_900< Mb_wc, LEVELS_FOR_COMPARE >::next_implicit ( my_wc_t  ch)
inlineprivate

◆ next_raw()

template<class Mb_wc , int LEVELS_FOR_COMPARE>
ALWAYS_INLINE int uca_scanner_900< Mb_wc, LEVELS_FOR_COMPARE >::next_raw
inlineprivate

Member Data Documentation

◆ has_quaternary_weight

template<class Mb_wc , int LEVELS_FOR_COMPARE>
bool uca_scanner_900< Mb_wc, LEVELS_FOR_COMPARE >::has_quaternary_weight {false}
private

◆ mb_wc

template<class Mb_wc , int LEVELS_FOR_COMPARE>
const Mb_wc uca_scanner_900< Mb_wc, LEVELS_FOR_COMPARE >::mb_wc
private

◆ return_origin_weight

template<class Mb_wc , int LEVELS_FOR_COMPARE>
bool uca_scanner_900< Mb_wc, LEVELS_FOR_COMPARE >::return_origin_weight {true}
private

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