本文整理汇总了C++中TypedValue::getDataPtr方法的典型用法代码示例。如果您正苦于以下问题:C++ TypedValue::getDataPtr方法的具体用法?C++ TypedValue::getDataPtr怎么用?C++ TypedValue::getDataPtr使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TypedValue
的用法示例。
在下文中一共展示了TypedValue::getDataPtr方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: getUpperBoundCodeForUntypedValue
/**
* @brief Find the first code which is greater than the specified typed
* value, similar to std::upper_bound().
* @warning value must not be NULL.
*
* @param value A typed value, which can be either the exact same Type as
* the values in this dictionary, or another Type which is comparable
* according to LessComparison.
* @param value_type The Type that value belongs to.
* @return The first code whose corresponding uncompressed value is greater
* than value. May return numberOfCodes() if every value in the
* dictionary is less than or equal to value.
**/
std::uint32_t getUpperBoundCodeForTypedValue(const TypedValue &value,
const Type &value_type) const {
DCHECK(!value.isNull());
if (value_type.isSubsumedBy(type_)) {
return getUpperBoundCodeForUntypedValue(value.getDataPtr());
} else {
return getUpperBoundCodeForDifferentTypedValue(value, value_type);
}
}
示例2: getLowerBoundCodeForUntypedValue
/**
* @brief Find the first code which is not less than the specified typed
* value, similar to std::lower_bound().
* @warning value must not be NULL.
*
* @param value A typed value, which can be either the exact same Type as
* the values in this dictionary, or another Type which is comparable
* according to LessComparison.
* @param value_type The Type that value belongs to.
* @return The first code whose corresponding uncompressed value is not less
* than value. May return numberOfCodes() if every value in the
* dictionary is less than value.
**/
std::uint32_t getLowerBoundCodeForTypedValue(const TypedValue &value,
const Type &value_type,
const bool ignore_null_code = false) const {
DCHECK(!value.isNull());
if (value_type.isSubsumedBy(type_)) {
return getLowerBoundCodeForUntypedValue(value.getDataPtr(), ignore_null_code);
} else {
return getLowerBoundCodeForDifferentTypedValue(value, value_type, ignore_null_code);
}
}
示例3: getLimitCodesForComparisonUntyped
/**
* @brief Determine the range of codes that match a specified comparison with
* a specified typed value.
*
* @param comp The comparison to evaluate.
* @param value A typed value, which can be either the exact same Type as
* the values in this dictionary, or another Type which is comparable
* according to LessComparison.
* @param value_type The Type that value belongs to.
* @return The limits of the range of codes which match the predicate
* "coded-value comp value". The range is [first, second) (i.e. it
* is inclusive of first but not second).
**/
std::pair<std::uint32_t, std::uint32_t> getLimitCodesForComparisonTyped(
const ComparisonID comp,
const TypedValue &value,
const Type &value_type) const {
if (value_type.isSubsumedBy(type_)) {
return getLimitCodesForComparisonUntyped(comp,
value.isNull() ? nullptr : value.getDataPtr());
} else {
return getLimitCodesForComparisonDifferentTyped(comp, value, value_type);
}
}
示例4: getNullCode
/**
* @brief Get the compressed code that represents the specified typed value.
* @note This uses a binary search to find the appropriate code. It runs in
* O(log(n)) time.
*
* @param value A typed value, which can be either the exact same Type as
* the values in this dictionary, or another Type which is comparable
* according to LessComparison.
* @param value_type The Type that value belongs to.
* @return The code for value in this dictionary, or the value of
* numberOfCodes() (the maximum code plus one) if value is not
* contained in this dictionary.
**/
std::uint32_t getCodeForTypedValue(const TypedValue &value,
const Type &value_type) const {
if (value.isNull()) {
return getNullCode() == std::numeric_limits<std::uint32_t>::max() ? number_of_codes_including_null_
: getNullCode();
} else if (value_type.isSubsumedBy(type_)) {
return getCodeForUntypedValue(value.getDataPtr());
} else {
return getCodeForDifferentTypedValue(value, value_type);
}
}