#ifndef AL_UINTMAP_H #define AL_UINTMAP_H #include #include #include "AL/al.h" template class ThrSafeMap { std::unordered_map mValues; std::mutex mLock; public: void InsertEntry(T0 key, T1 value) noexcept { std::lock_guard _{mLock}; mValues[key] = value; } T1 RemoveKey(T0 key) noexcept { T1 retval{}; std::lock_guard _{mLock}; auto iter = mValues.find(key); if(iter != mValues.end()) retval = iter->second; mValues.erase(iter); return retval; } }; #endif /* AL_UINTMAP_H */