@ -316,24 +316,37 @@ const Comparator* BytewiseComparatorWithU64Ts() {
return & comp_with_u64_ts ;
return & comp_with_u64_ts ;
}
}
const Comparator * ReverseBytewiseComparatorWithU64Ts ( ) {
STATIC_AVOID_DESTRUCTION (
ComparatorWithU64TsImpl < ReverseBytewiseComparatorImpl > , comp_with_u64_ts ) ;
return & comp_with_u64_ts ;
}
static int RegisterBuiltinComparators ( ObjectLibrary & library ,
static int RegisterBuiltinComparators ( ObjectLibrary & library ,
const std : : string & /*arg*/ ) {
const std : : string & /*arg*/ ) {
library . AddFactory < const Comparator > (
library . AddFactory < const Comparator > (
BytewiseComparatorImpl : : kClassName ( ) ,
BytewiseComparatorImpl : : kClassName ( ) ,
[ ] ( const std : : string & /*uri*/ ,
[ ] ( const std : : string & /*uri*/ ,
std : : unique_ptr < const Comparator > * /*guard */ ,
std : : unique_ptr < const Comparator > * /*guard*/ ,
std : : string * /* errmsg */ ) { return BytewiseComparator ( ) ; } ) ;
std : : string * /*errmsg*/ ) { return BytewiseComparator ( ) ; } ) ;
library . AddFactory < const Comparator > (
library . AddFactory < const Comparator > (
ReverseBytewiseComparatorImpl : : kClassName ( ) ,
ReverseBytewiseComparatorImpl : : kClassName ( ) ,
[ ] ( const std : : string & /*uri*/ ,
[ ] ( const std : : string & /*uri*/ ,
std : : unique_ptr < const Comparator > * /*guard */ ,
std : : unique_ptr < const Comparator > * /*guard*/ ,
std : : string * /* errmsg */ ) { return ReverseBytewiseComparator ( ) ; } ) ;
std : : string * /*errmsg*/ ) { return ReverseBytewiseComparator ( ) ; } ) ;
library . AddFactory < const Comparator > (
library . AddFactory < const Comparator > (
ComparatorWithU64TsImpl < BytewiseComparatorImpl > : : kClassName ( ) ,
ComparatorWithU64TsImpl < BytewiseComparatorImpl > : : kClassName ( ) ,
[ ] ( const std : : string & /*uri*/ ,
[ ] ( const std : : string & /*uri*/ ,
std : : unique_ptr < const Comparator > * /*guard */ ,
std : : unique_ptr < const Comparator > * /*guard*/ ,
std : : string * /* errmsg */ ) { return BytewiseComparatorWithU64Ts ( ) ; } ) ;
std : : string * /*errmsg*/ ) { return BytewiseComparatorWithU64Ts ( ) ; } ) ;
return 3 ;
library . AddFactory < const Comparator > (
ComparatorWithU64TsImpl < ReverseBytewiseComparatorImpl > : : kClassName ( ) ,
[ ] ( const std : : string & /*uri*/ ,
std : : unique_ptr < const Comparator > * /*guard*/ ,
std : : string * /*errmsg*/ ) {
return ReverseBytewiseComparatorWithU64Ts ( ) ;
} ) ;
return 4 ;
}
}
Status Comparator : : CreateFromString ( const ConfigOptions & config_options ,
Status Comparator : : CreateFromString ( const ConfigOptions & config_options ,
@ -357,6 +370,9 @@ Status Comparator::CreateFromString(const ConfigOptions& config_options,
} else if ( id = =
} else if ( id = =
ComparatorWithU64TsImpl < BytewiseComparatorImpl > : : kClassName ( ) ) {
ComparatorWithU64TsImpl < BytewiseComparatorImpl > : : kClassName ( ) ) {
* result = BytewiseComparatorWithU64Ts ( ) ;
* result = BytewiseComparatorWithU64Ts ( ) ;
} else if ( id = = ComparatorWithU64TsImpl <
ReverseBytewiseComparatorImpl > : : kClassName ( ) ) {
* result = ReverseBytewiseComparatorWithU64Ts ( ) ;
} else if ( value . empty ( ) ) {
} else if ( value . empty ( ) ) {
// No Id and no options. Clear the object
// No Id and no options. Clear the object
* result = nullptr ;
* result = nullptr ;