FlatCityBuf C++ reader 0.10.0
Native C++17 reader for FlatCityBuf, the cloud-optimized CityJSON format
Loading...
Searching...
No Matches
fcb::KeyValue Class Reference

A decoded index key. More...

#include <fcb/key.hpp>

Public Member Functions

 KeyValue ()=default
KeyKind kind () const
const std::string & original_string () const
 The original, untruncated string this key was built from.

Static Public Member Functions

static KeyValue from_i8 (std::int8_t v)
static KeyValue from_u8 (std::uint8_t v)
static KeyValue from_i16 (std::int16_t v)
static KeyValue from_u16 (std::uint16_t v)
static KeyValue from_i32 (std::int32_t v)
static KeyValue from_u32 (std::uint32_t v)
static KeyValue from_i64 (std::int64_t v)
static KeyValue from_u64 (std::uint64_t v)
static KeyValue from_f32 (float v)
static KeyValue from_f64 (double v)
static KeyValue from_bool (bool v)
static KeyValue from_datetime (std::int64_t seconds, std::uint32_t nanos)
static KeyValue from_string (KeyKind kind, const std::string &v)

Friends

std::vector< std::uint8_t > encode_key (const KeyValue &v)
KeyValue decode_key (KeyKind kind, bytes_view b)
int compare_keys (const KeyValue &a, const KeyValue &b)
 Three-way comparison.

Detailed Description

A decoded index key.

Ordering is NOT bytewise for floats: the on-disk bytes are the plain IEEE-754 bit pattern, and ordered_float semantics are applied after decoding (see compare_keys).

Definition at line 40 of file key.hpp.

Constructor & Destructor Documentation

◆ KeyValue()

fcb::KeyValue::KeyValue ( )
default

Member Function Documentation

◆ from_bool()

KeyValue fcb::KeyValue::from_bool ( bool v)
static

Definition at line 122 of file key.cpp.

References KeyValue(), and fcb::Bool.

Referenced by fcb::attribute_to_index_entries(), decode_key, fcb::key_max(), and fcb::key_min().

◆ from_datetime()

KeyValue fcb::KeyValue::from_datetime ( std::int64_t seconds,
std::uint32_t nanos )
static

Definition at line 129 of file key.cpp.

References KeyValue(), and fcb::DateTime.

Referenced by fcb::attribute_to_index_entries(), decode_key, fcb::key_max(), and fcb::key_min().

◆ from_f32()

KeyValue fcb::KeyValue::from_f32 ( float v)
static

Definition at line 108 of file key.cpp.

References KeyValue(), and fcb::Float32.

Referenced by fcb::attribute_to_index_entries(), decode_key, fcb::key_max(), and fcb::key_min().

◆ from_f64()

KeyValue fcb::KeyValue::from_f64 ( double v)
static

Definition at line 115 of file key.cpp.

References KeyValue(), and fcb::Float64.

Referenced by fcb::attribute_to_index_entries(), decode_key, fcb::key_max(), and fcb::key_min().

◆ from_i16()

KeyValue fcb::KeyValue::from_i16 ( std::int16_t v)
static

Definition at line 100 of file key.cpp.

References FCB_KV_INT, and from_i16().

Referenced by decode_key, from_i16(), fcb::key_max(), and fcb::key_min().

◆ from_i32()

KeyValue fcb::KeyValue::from_i32 ( std::int32_t v)
static

Definition at line 102 of file key.cpp.

References FCB_KV_INT, and from_i32().

Referenced by fcb::attribute_to_index_entries(), decode_key, from_i32(), fcb::key_max(), and fcb::key_min().

◆ from_i64()

KeyValue fcb::KeyValue::from_i64 ( std::int64_t v)
static

Definition at line 104 of file key.cpp.

References FCB_KV_INT, and from_i64().

Referenced by fcb::attribute_to_index_entries(), decode_key, from_i64(), fcb::key_max(), and fcb::key_min().

◆ from_i8()

KeyValue fcb::KeyValue::from_i8 ( std::int8_t v)
static

Definition at line 98 of file key.cpp.

References from_i8().

Referenced by decode_key, from_i8(), fcb::key_max(), and fcb::key_min().

◆ from_string()

KeyValue fcb::KeyValue::from_string ( KeyKind kind,
const std::string & v )
static

◆ from_u16()

KeyValue fcb::KeyValue::from_u16 ( std::uint16_t v)
static

Definition at line 101 of file key.cpp.

References FCB_KV_INT, and from_u16().

Referenced by decode_key, from_u16(), fcb::key_max(), and fcb::key_min().

◆ from_u32()

KeyValue fcb::KeyValue::from_u32 ( std::uint32_t v)
static

Definition at line 103 of file key.cpp.

References FCB_KV_INT, and from_u32().

Referenced by fcb::attribute_to_index_entries(), decode_key, from_u32(), fcb::key_max(), and fcb::key_min().

◆ from_u64()

KeyValue fcb::KeyValue::from_u64 ( std::uint64_t v)
static

Definition at line 105 of file key.cpp.

References FCB_KV_INT, and from_u64().

Referenced by fcb::attribute_to_index_entries(), decode_key, from_u64(), fcb::key_max(), and fcb::key_min().

◆ from_u8()

KeyValue fcb::KeyValue::from_u8 ( std::uint8_t v)
static

Definition at line 99 of file key.cpp.

References FCB_KV_INT, and from_u8().

Referenced by decode_key, from_u8(), fcb::key_max(), and fcb::key_min().

◆ kind()

KeyKind fcb::KeyValue::kind ( ) const
inline

Definition at line 58 of file key.hpp.

Referenced by KeyValue(), decode_key, and from_string().

◆ original_string()

const std::string & fcb::KeyValue::original_string ( ) const
inline

The original, untruncated string this key was built from.

Needed for post-filtering, since the encoded key keeps only the first N bytes.

Definition at line 62 of file key.hpp.

◆ compare_keys

int compare_keys ( const KeyValue & a,
const KeyValue & b )
friend

Three-way comparison.

Throws if the kinds differ, rather than inventing an ordering between unrelated types.

Definition at line 272 of file key.cpp.

References KeyValue(), fcb::Bool, fcb::DateTime, fcb::encode_key(), fcb::Float32, fcb::Float64, fcb::Int16, fcb::Int32, fcb::Int64, fcb::Int8, fcb::QueryExecutionError, fcb::String100, fcb::String20, fcb::String50, fcb::UInt16, fcb::UInt32, fcb::UInt64, fcb::UInt8, and fcb::UnsupportedColumnType.

◆ decode_key

◆ encode_key


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