Go to the documentation of this file.
33 #ifndef GOOGLE_PROTOBUF_UTIL_FIELD_COMPARATOR_H__
34 #define GOOGLE_PROTOBUF_UTIL_FIELD_COMPARATOR_H__
41 #include <google/protobuf/stubs/common.h>
42 #include <google/protobuf/port_def.inc>
54 class MessageDifferencer;
60 class PROTOBUF_EXPORT FieldComparator {
63 virtual ~FieldComparator();
117 float_comparison_ = float_comparison;
126 treat_nan_as_equal_ = treat_nan_as_equal;
146 void SetDefaultFractionAndMargin(
double fraction,
double margin);
154 ComparisonResult SimpleCompare(
const Message& message_1,
169 ComparisonResult ResultFromBoolean(
bool boolean_result)
const;
190 return value_1 == value_2;
208 return value_1 == value_2;
213 return value_1 == value_2;
218 return value_1 == value_2;
223 return value_1 == value_2;
228 return value_1 == value_2;
234 template <
typename T>
262 #ifdef PROTOBUF_FUTURE_BREAKING_CHANGES
265 #else // PROTOBUF_FUTURE_BREAKING_CHANGES
267 #endif // PROTOBUF_FUTURE_BREAKING_CHANGES
274 return SimpleCompare(message_1, message_2,
field, index_1, index_2,
283 #include <google/protobuf/port_undef.inc>
285 #endif // GOOGLE_PROTOBUF_UTIL_FIELD_COMPARATOR_H__
Tolerance(double f, double m)
FloatComparison float_comparison() const
#define GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(TypeName)
ComparisonResult Compare(const Message &message_1, const Message &message_2, const FieldDescriptor *field, int index_1, int index_2, const util::FieldContext *field_context) override
bool CompareString(const FieldDescriptor &, const std::string &value_1, const std::string &value_2)
void set_treat_nan_as_equal(bool treat_nan_as_equal)
FloatComparison float_comparison_
#define T(upbtypeconst, upbtype, ctype, default_value)
void set_float_comparison(FloatComparison float_comparison)
Tolerance default_tolerance_
bool CompareUInt64(const FieldDescriptor &, uint64_t value_1, uint64_t value_2)
unsigned __int64 uint64_t
bool CompareInt32(const FieldDescriptor &, int32_t value_1, int32_t value_2)
bool CompareUInt32(const FieldDescriptor &, uint32_t value_1, uint32_t value_2)
bool has_default_tolerance_
const FieldDescriptor * field
ToleranceMap map_tolerance_
int Compare(const BigUnsigned< N > &lhs, const BigUnsigned< M > &rhs)
bool treat_nan_as_equal() const
std::map< const FieldDescriptor *, Tolerance > ToleranceMap
bool CompareBool(const FieldDescriptor &, bool value_1, bool value_2)
bool CompareInt64(const FieldDescriptor &, int64_t value_1, int64_t value_2)
grpc
Author(s):
autogenerated on Fri May 16 2025 02:58:22