Tweaks and fixes for TypeLibrary

This commit is contained in:
2020-02-29 16:06:36 +01:00
parent 671077259e
commit 70ad3eb838
3 changed files with 19 additions and 8 deletions

View File

@@ -47,16 +47,18 @@ namespace CreatureLib::Library {
return true;
}
inline const T* Get(const Arbutils::CaseInsensitiveConstString& name) const {
[[nodiscard]] inline const T* Get(const Arbutils::CaseInsensitiveConstString& name) const {
return _values.at(name.GetHash());
}
inline const T* Get(uint32_t hashedKey) const { return _values.at(hashedKey); }
[[nodiscard]] inline const T* Get(uint32_t hashedKey) const { return _values.at(hashedKey); }
inline const T* operator[](const Arbutils::CaseInsensitiveConstString& name) const { return Get(name); }
inline const T* operator[](uint32_t hashedKey) const { return Get(hashedKey); }
inline const std::unordered_map<uint32_t, const T*>& GetIterator() const { return _values; }
[[nodiscard]] inline const T* operator[](const Arbutils::CaseInsensitiveConstString& name) const {
return Get(name);
}
[[nodiscard]] inline const T* operator[](uint32_t hashedKey) const { return Get(hashedKey); }
[[nodiscard]] inline const std::unordered_map<uint32_t, const T*>& GetIterator() const { return _values; }
size_t GetCount() const { return _values.size(); }
[[nodiscard]] size_t GetCount() const { return _values.size(); }
};
}