API for defining binary Index keys for B-Trees.
More...
#include <string.h>
Go to the source code of this file.
|
|
typedef unsigned long | machine_uint_t |
| | word size data unit used for binary keys.
|
|
typedef unsigned short | machine_uhalf_t |
| | data unit used to store copy and compare lengths.
|
|
typedef struct SASIndexKey_t | SASIndexKey_t |
| | Index Key Handle structure for binary index B-trees.
|
|
|
const unsigned long | machine_sign_mask = (0x80000000) |
| | mask use to invert the signbit.
|
|
const unsigned long | double_exp_mask = (0x7ff00000) |
| | mask use to invert the exponent.
|
|
const unsigned long | double_mask = (0xffffffff) |
| | mask use to invert the sign and exponent.
|
API for defining binary Index keys for B-Trees.
Intialize the SASIndexKey_t structure with a sequence of values to be used as keys for SASIndex_t BTrees.
- Todo
- Enhance this API to build larger (multi-part) keys via a streams interface similar to interface in sphlfentry.h. We have enough to here to implement SPHContext_t but a generalized API would make SASIndex_t more useful.
◆ SASIndexKeyCompare()
binary key compare logic for Index B-Tree keys.
Optimized for comparing unsigned long integer word values that are the size of address pointers (void*) Also optimized for early (in the first or only word of the key) misscompare.
- Parameters
-
- Returns
- an integer value -1 for op_a < op_b, 0 for op_a == op_b, and +1 for op_a > op_b.
◆ SASIndexKeyCopy()
Copy a binary key from source to destination.
Use the copy_size to copy the required header and the significant words of key data.
- Parameters
-
◆ SASIndexKeyInitDouble()
| void SASIndexKeyInitDouble |
( |
SASIndexKey_t * | dest, |
|
|
double | value ) |
|
inlinestatic |
Initial a binary key @ destination with a signed 64-bit integer value.
- Note
- Need to flip the sign bit to get the correct ordering with a mix of signed and unsigned key values.
- Parameters
-
| dest | Handle of the destination SASIndexKey_t. |
| value | signed long long value which will be the key. |
◆ SASIndexKeyInitInt64()
| void SASIndexKeyInitInt64 |
( |
SASIndexKey_t * | dest, |
|
|
signed long long | value ) |
|
inlinestatic |
Initial a binary key @ destination with a signed 64-bit integer value.
- Note
- Need to flip the sign bit to get the correct ordering with a mix of signed and unsigned key values.
- Parameters
-
| dest | Handle of the destination SASIndexKey_t. |
| value | signed long long value which will be the key. |
◆ SASIndexKeyInitRef()
Initial a binary key @ destination with a address value.
- Parameters
-
| dest | Handle of the destination SASIndexKey_t. |
| value | Address value which will be the key. |
◆ SASIndexKeyInitUInt64()
| void SASIndexKeyInitUInt64 |
( |
SASIndexKey_t * | dest, |
|
|
unsigned long long | value ) |
|
inlinestatic |
Initial a binary key @ destination with a unsigned 64-bit integer value.
- Parameters
-
| dest | Handle of the destination SASIndexKey_t. |
| value | unsigned long long value which will be the key. |
◆ SASIndexKeyReturn1stDouble()
Return the value of the 1st binary key as a signed 64-bit integer value.
- Parameters
-
- Returns
- value of the 1st key element as a unsigned 64-bit integer.
◆ SASIndexKeyReturn1stInt64()
Return the value of the 1st binary key as a signed 64-bit integer value.
- Parameters
-
- Returns
- value of the 1st key element as a unsigned 64-bit integer.
◆ SASIndexKeyReturn1stUInt64()
| unsigned long long SASIndexKeyReturn1stUInt64 |
( |
SASIndexKey_t * | dest | ) |
|
|
inlinestatic |
Return the value of the 1st binary key as a unsigned 64-bit integer value.
- Parameters
-
- Returns
- value of the 1st key element as a unsigned 64-bit integer.
◆ SASIndexKeySize()
Return the binary index key copy_size.
Use the copy_size to copy the required header and the significant words of key data.
- Parameters
-
- Returns
- current copy_size of the referenced key.