Base: Clean up explicit uses of namespaces in places where they're not necessary.

This commit covers all of the common and base classes.
This commit is contained in:
Tim Wojtulewicz 2020-08-21 09:29:37 -07:00
parent 9f802b2a4d
commit fe0c22c789
240 changed files with 6823 additions and 6787 deletions

View file

@ -18,32 +18,32 @@ namespace zeek::detail {
class CompositeHash {
public:
explicit CompositeHash(zeek::TypeListPtr composite_type);
explicit CompositeHash(TypeListPtr composite_type);
~CompositeHash();
// Compute the hash corresponding to the given index val,
// or nullptr if it fails to typecheck.
std::unique_ptr<zeek::detail::HashKey> MakeHashKey(const zeek::Val& v, bool type_check) const;
std::unique_ptr<HashKey> MakeHashKey(const Val& v, bool type_check) const;
[[deprecated("Remove in v4.1. Use MakeHashKey().")]]
zeek::detail::HashKey* ComputeHash(const zeek::Val* v, bool type_check) const
HashKey* ComputeHash(const Val* v, bool type_check) const
{ return MakeHashKey(*v, type_check).release(); }
// Given a hash key, recover the values used to create it.
zeek::ListValPtr RecoverVals(const zeek::detail::HashKey& k) const;
ListValPtr RecoverVals(const HashKey& k) const;
[[deprecated("Remove in v4.1. Pass in zeek::detail::HashKey& instead.")]]
zeek::ListValPtr RecoverVals(const zeek::detail::HashKey* k) const
[[deprecated("Remove in v4.1. Pass in HashKey& instead.")]]
ListValPtr RecoverVals(const HashKey* k) const
{ return RecoverVals(*k); }
unsigned int MemoryAllocation() const { return padded_sizeof(*this) + zeek::util::pad_size(size); }
unsigned int MemoryAllocation() const { return padded_sizeof(*this) + util::pad_size(size); }
protected:
std::unique_ptr<zeek::detail::HashKey> ComputeSingletonHash(const zeek::Val* v, bool type_check) const;
std::unique_ptr<HashKey> ComputeSingletonHash(const Val* v, bool type_check) const;
// Computes the piece of the hash for Val*, returning the new kp.
// Used as a helper for ComputeHash in the non-singleton case.
char* SingleValHash(bool type_check, char* kp, zeek::Type* bt, zeek::Val* v,
char* SingleValHash(bool type_check, char* kp, Type* bt, Val* v,
bool optional) const;
// Recovers just one Val of possibly many; called from RecoverVals.
@ -51,8 +51,8 @@ protected:
// Returns and updated kp for the next Val. Calls reporter->InternalError()
// upon errors, so there is no return value for invalid input.
const char* RecoverOneVal(
const zeek::detail::HashKey& k, const char* kp, const char* const k_end,
zeek::Type* t, zeek::ValPtr* pval, bool optional) const;
const HashKey& k, const char* kp, const char* const k_end,
Type* t, ValPtr* pval, bool optional) const;
// Rounds the given pointer up to the nearest multiple of the
// given size, if not already a multiple.
@ -88,14 +88,14 @@ protected:
// the value is computed for the particular list of values.
// Returns 0 if the key has an indeterminant size (if v not given),
// or if v doesn't match the index type (if given).
int ComputeKeySize(const zeek::Val* v, bool type_check,
int ComputeKeySize(const Val* v, bool type_check,
bool calc_static_size) const;
int SingleTypeKeySize(zeek::Type*, const zeek::Val*,
int SingleTypeKeySize(Type*, const Val*,
bool type_check, int sz, bool optional,
bool calc_static_size) const;
zeek::TypeListPtr type;
TypeListPtr type;
char* key; // space for composite key
int size;
bool is_singleton; // if just one type in index
@ -103,7 +103,7 @@ protected:
// If one type, but not normal "singleton", e.g. record.
bool is_complex_type;
zeek::InternalTypeTag singleton_tag;
InternalTypeTag singleton_tag;
};
} // namespace zeek::detail