diff options
author | Chris Robinson <[email protected]> | 2019-06-29 22:38:38 -0700 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2019-06-29 22:38:38 -0700 |
commit | ada86d2fcf0731fb328c04be9166de659377de59 (patch) | |
tree | 548c18b50a356703e00bd00f040e518f679a3737 /Alc/alcontext.h | |
parent | 7303e22d895e64fb24b257c3b65a1744ac4020ba (diff) |
Hold references in the global device and context lists
Diffstat (limited to 'Alc/alcontext.h')
-rw-r--r-- | Alc/alcontext.h | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/Alc/alcontext.h b/Alc/alcontext.h index 0e3b864e..cf956079 100644 --- a/Alc/alcontext.h +++ b/Alc/alcontext.h @@ -182,8 +182,8 @@ public: operator bool() const noexcept { return mCtx != nullptr; } - ALCcontext* operator->() noexcept { return mCtx; } - ALCcontext* get() noexcept { return mCtx; } + ALCcontext* operator->() const noexcept { return mCtx; } + ALCcontext* get() const noexcept { return mCtx; } ALCcontext* release() noexcept { @@ -193,6 +193,13 @@ public: } }; +inline bool operator==(const ContextRef &lhs, const ALCcontext *rhs) noexcept +{ return lhs.get() == rhs; } +inline bool operator!=(const ContextRef &lhs, const ALCcontext *rhs) noexcept +{ return !(lhs == rhs); } +inline bool operator<(const ContextRef &lhs, const ALCcontext *rhs) noexcept +{ return lhs.get() < rhs; } + ContextRef GetContextRef(void); |