diff options
author | mcheshkov <mcheshkov@yandex-team.ru> | 2022-02-10 16:46:15 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:46:15 +0300 |
commit | e9d19cec64684c9c1e6b0c98297e5b895cf904fe (patch) | |
tree | 2768b1223e96a8a0610a93d18425d9647c1123c8 /contrib/libs/icu/common/hash.h | |
parent | 60040c91ffe701a84689b2c6310ff845e65cff42 (diff) | |
download | ydb-e9d19cec64684c9c1e6b0c98297e5b895cf904fe.tar.gz |
Restoring authorship annotation for <mcheshkov@yandex-team.ru>. Commit 1 of 2.
Diffstat (limited to 'contrib/libs/icu/common/hash.h')
-rw-r--r-- | contrib/libs/icu/common/hash.h | 122 |
1 files changed, 61 insertions, 61 deletions
diff --git a/contrib/libs/icu/common/hash.h b/contrib/libs/icu/common/hash.h index f02cb7087a..b0ddc6e331 100644 --- a/contrib/libs/icu/common/hash.h +++ b/contrib/libs/icu/common/hash.h @@ -1,4 +1,4 @@ -// © 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ****************************************************************************** @@ -33,81 +33,81 @@ class U_COMMON_API Hashtable : public UMemory { inline void init(UHashFunction *keyHash, UKeyComparator *keyComp, UValueComparator *valueComp, UErrorCode& status); - inline void initSize(UHashFunction *keyHash, UKeyComparator *keyComp, UValueComparator *valueComp, int32_t size, UErrorCode& status); - + inline void initSize(UHashFunction *keyHash, UKeyComparator *keyComp, UValueComparator *valueComp, int32_t size, UErrorCode& status); + public: /** * Construct a hashtable * @param ignoreKeyCase If true, keys are case insensitive. * @param status Error code */ - inline Hashtable(UBool ignoreKeyCase, UErrorCode& status); - - /** - * Construct a hashtable - * @param ignoreKeyCase If true, keys are case insensitive. - * @param size initial size allocation - * @param status Error code - */ - inline Hashtable(UBool ignoreKeyCase, int32_t size, UErrorCode& status); + inline Hashtable(UBool ignoreKeyCase, UErrorCode& status); /** * Construct a hashtable + * @param ignoreKeyCase If true, keys are case insensitive. + * @param size initial size allocation + * @param status Error code + */ + inline Hashtable(UBool ignoreKeyCase, int32_t size, UErrorCode& status); + + /** + * Construct a hashtable * @param keyComp Comparator for comparing the keys * @param valueComp Comparator for comparing the values * @param status Error code */ - inline Hashtable(UKeyComparator *keyComp, UValueComparator *valueComp, UErrorCode& status); + inline Hashtable(UKeyComparator *keyComp, UValueComparator *valueComp, UErrorCode& status); /** * Construct a hashtable * @param status Error code */ - inline Hashtable(UErrorCode& status); + inline Hashtable(UErrorCode& status); /** * Construct a hashtable, _disregarding any error_. Use this constructor * with caution. */ - inline Hashtable(); + inline Hashtable(); /** * Non-virtual destructor; make this virtual if Hashtable is subclassed * in the future. */ - inline ~Hashtable(); - - inline UObjectDeleter *setValueDeleter(UObjectDeleter *fn); + inline ~Hashtable(); - inline int32_t count() const; + inline UObjectDeleter *setValueDeleter(UObjectDeleter *fn); - inline void* put(const UnicodeString& key, void* value, UErrorCode& status); + inline int32_t count() const; - inline int32_t puti(const UnicodeString& key, int32_t value, UErrorCode& status); + inline void* put(const UnicodeString& key, void* value, UErrorCode& status); - inline void* get(const UnicodeString& key) const; + inline int32_t puti(const UnicodeString& key, int32_t value, UErrorCode& status); - inline int32_t geti(const UnicodeString& key) const; + inline void* get(const UnicodeString& key) const; - inline void* remove(const UnicodeString& key); + inline int32_t geti(const UnicodeString& key) const; - inline int32_t removei(const UnicodeString& key); + inline void* remove(const UnicodeString& key); - inline void removeAll(void); - - inline const UHashElement* find(const UnicodeString& key) const; + inline int32_t removei(const UnicodeString& key); + inline void removeAll(void); + + inline const UHashElement* find(const UnicodeString& key) const; + /** * @param pos - must be UHASH_FIRST on first call, and untouched afterwards. * @see uhash_nextElement */ - inline const UHashElement* nextElement(int32_t& pos) const; - - inline UKeyComparator* setKeyComparator(UKeyComparator*keyComp); + inline const UHashElement* nextElement(int32_t& pos) const; - inline UValueComparator* setValueComparator(UValueComparator* valueComp); - - inline UBool equals(const Hashtable& that) const; + inline UKeyComparator* setKeyComparator(UKeyComparator*keyComp); + + inline UValueComparator* setValueComparator(UValueComparator* valueComp); + + inline UBool equals(const Hashtable& that) const; private: Hashtable(const Hashtable &other); // forbid copying of this class Hashtable &operator=(const Hashtable &other); // forbid copying of this class @@ -117,7 +117,7 @@ private: * Implementation ********************************************************************/ -inline void Hashtable::init(UHashFunction *keyHash, UKeyComparator *keyComp, +inline void Hashtable::init(UHashFunction *keyHash, UKeyComparator *keyComp, UValueComparator *valueComp, UErrorCode& status) { if (U_FAILURE(status)) { return; @@ -129,23 +129,23 @@ inline void Hashtable::init(UHashFunction *keyHash, UKeyComparator *keyComp, } } -inline void Hashtable::initSize(UHashFunction *keyHash, UKeyComparator *keyComp, - UValueComparator *valueComp, int32_t size, UErrorCode& status) { - if (U_FAILURE(status)) { - return; - } - uhash_initSize(&hashObj, keyHash, keyComp, valueComp, size, &status); - if (U_SUCCESS(status)) { - hash = &hashObj; - uhash_setKeyDeleter(hash, uprv_deleteUObject); - } -} - -inline Hashtable::Hashtable(UKeyComparator *keyComp, UValueComparator *valueComp, +inline void Hashtable::initSize(UHashFunction *keyHash, UKeyComparator *keyComp, + UValueComparator *valueComp, int32_t size, UErrorCode& status) { + if (U_FAILURE(status)) { + return; + } + uhash_initSize(&hashObj, keyHash, keyComp, valueComp, size, &status); + if (U_SUCCESS(status)) { + hash = &hashObj; + uhash_setKeyDeleter(hash, uprv_deleteUObject); + } +} + +inline Hashtable::Hashtable(UKeyComparator *keyComp, UValueComparator *valueComp, UErrorCode& status) : hash(0) { init( uhash_hashUnicodeString, keyComp, valueComp, status); } - + inline Hashtable::Hashtable(UBool ignoreKeyCase, UErrorCode& status) : hash(0) { @@ -157,17 +157,17 @@ inline Hashtable::Hashtable(UBool ignoreKeyCase, UErrorCode& status) status); } -inline Hashtable::Hashtable(UBool ignoreKeyCase, int32_t size, UErrorCode& status) - : hash(0) -{ - initSize(ignoreKeyCase ? uhash_hashCaselessUnicodeString - : uhash_hashUnicodeString, - ignoreKeyCase ? uhash_compareCaselessUnicodeString - : uhash_compareUnicodeString, - NULL, size, - status); -} - +inline Hashtable::Hashtable(UBool ignoreKeyCase, int32_t size, UErrorCode& status) + : hash(0) +{ + initSize(ignoreKeyCase ? uhash_hashCaselessUnicodeString + : uhash_hashUnicodeString, + ignoreKeyCase ? uhash_compareCaselessUnicodeString + : uhash_compareUnicodeString, + NULL, size, + status); +} + inline Hashtable::Hashtable(UErrorCode& status) : hash(0) { @@ -234,7 +234,7 @@ inline void Hashtable::removeAll(void) { inline UKeyComparator* Hashtable::setKeyComparator(UKeyComparator*keyComp){ return uhash_setKeyComparator(hash, keyComp); } - + inline UValueComparator* Hashtable::setValueComparator(UValueComparator* valueComp){ return uhash_setValueComparator(hash, valueComp); } |