Go to the documentation of this file.
15 #ifndef ABSL_HASH_INTERNAL_SPY_HASH_STATE_H_
16 #define ABSL_HASH_INTERNAL_SPY_HASH_STATE_H_
23 #include "absl/hash/hash.h"
24 #include "absl/strings/match.h"
25 #include "absl/strings/str_format.h"
26 #include "absl/strings/str_join.h"
30 namespace hash_internal {
60 other.moved_from_ =
true;
69 other.moved_from_ =
true;
72 template <
typename A,
typename...
Args>
84 *
s.error_ =
"AbslHashValue should not be invoked directly.";
85 }
else if (
s.moved_from_) {
86 *
s.error_ =
"Used moved-from instance of the hash state object.";
104 return !(lhs == rhs);
149 const unsigned char*
begin,
152 if (
size > large_chunk_stride) {
156 while (
size >= large_chunk_stride) {
159 begin += large_chunk_stride;
160 size -= large_chunk_stride;
165 reinterpret_cast<const char*
>(
begin),
size);
169 using SpyHashStateImpl::HashStateBase::combine_contiguous;
171 template <
typename CombinerT>
173 CombinerT combiner) {
178 std::sort(
cb.element_hash_representations.begin(),
179 cb.element_hash_representations.end());
180 state.hash_representation_.insert(
state.hash_representation_.end(),
181 cb.element_hash_representations.begin(),
182 cb.element_hash_representations.end());
183 if (
cb.error &&
cb.error->has_value()) {
191 return "Returned a moved-from instance of the hash state object.";
197 template <
typename U>
202 std::shared_ptr<absl::optional<std::string>>
error;
205 template <
typename U>
209 if (inner.
error_->has_value()) {
225 std::shared_ptr<absl::optional<std::string>>
error_;
229 template <
typename T>
238 template <
void (*)()>
244 template <
void (*f)()>
248 typename T,
typename U,
257 int = RunOnStartup<SpyHashStateImpl<T>::SetDirectAbslHashValueError>
::run>
266 #endif // ABSL_HASH_INTERNAL_SPY_HASH_STATE_H_
static void SetDirectAbslHashValueError()
static SpyHashStateImpl combine(SpyHashStateImpl s, const A &a, const Args &... args)
absl::optional< std::string > error() const
void operator()(SpyHashStateImpl< U > &inner)
static SpyHashStateImpl RunCombineUnordered(SpyHashStateImpl state, CombinerT combiner)
static constexpr OdrUse< run > kOdrUse
typename std::enable_if< B, T >::type enable_if_t
#define ABSL_NAMESPACE_END
#define T(upbtypeconst, upbtype, ctype, default_value)
SpyHashStateImpl & operator=(const SpyHashStateImpl &)=delete
#define ABSL_NAMESPACE_BEGIN
constexpr absl::remove_reference_t< T > && move(T &&t) noexcept
std::string StrJoin(Iterator start, Iterator end, absl::string_view sep, Formatter &&fmt)
friend bool operator==(const SpyHashStateImpl &lhs, const SpyHashStateImpl &rhs)
static bool direct_absl_hash_value_error_
ABSL_MUST_USE_RESULT str_format_internal::Streamable StreamFormat(const FormatSpec< Args... > &format, const Args &... args)
friend bool operator!=(const SpyHashStateImpl &lhs, const SpyHashStateImpl &rhs)
std::vector< std::string > element_hash_representations
std::enable_if< std::is_same< B, bool >::value, H >::type AbslHashValue(H hash_state, B value)
SpyHashStateImpl(SpyHashStateImpl< U > &&other)
constexpr size_t PiecewiseChunkSize()
static SpyHashStateImpl combine_contiguous(SpyHashStateImpl hash_state, const unsigned char *begin, size_t size)
static CompareResult Compare(const SpyHashStateImpl &a, const SpyHashStateImpl &b)
friend std::ostream & operator<<(std::ostream &out, const SpyHashStateImpl &hash_state)
friend class SpyHashStateImpl
static SpyHashStateImpl combine(SpyHashStateImpl s)
SpyHashStateImpl & operator=(SpyHashStateImpl &&other) noexcept
std::shared_ptr< absl::optional< std::string > > error_
std::shared_ptr< absl::optional< std::string > > error
bool EndsWith(absl::string_view text, absl::string_view suffix) noexcept
OPENSSL_EXPORT pem_password_cb * cb
std::vector< std::string > hash_representation_
static struct rpc_state state
SpyHashStateImpl(SpyHashStateImpl &&other) noexcept
grpc
Author(s):
autogenerated on Fri May 16 2025 03:00:15