![]() |
ezEngine Release 26.3
|
RAII wrapper providing thread-safe access to an object with automatic lock management. More...
#include <LockedObject.h>
Public Member Functions | |
| EZ_ALWAYS_INLINE | ezLockedObject (T &ref_lock, O *pObject) |
| EZ_ALWAYS_INLINE | ezLockedObject (ezLockedObject< T, O > &&rhs) |
| ezLockedObject (const ezLockedObject< T, O > &rhs)=delete | |
| void | operator= (const ezLockedObject< T, O > &&rhs) |
| void | operator= (const ezLockedObject< T, O > &rhs)=delete |
| EZ_ALWAYS_INLINE bool | isValid () const |
| Whether the encapsulated object exists at all or is nullptr. | |
| O * | Borrow () |
| const O * | Borrow () const |
| O * | operator-> () |
| const O * | operator-> () const |
| O & | operator* () |
| const O & | operator* () const |
| bool | operator== (const O *rhs) const |
| bool | operator!= (const O *rhs) const |
| bool | operator! () const |
| operator bool () const | |
RAII wrapper providing thread-safe access to an object with automatic lock management.
Combines object access with lock acquisition/release in a single type. The lock is acquired in the constructor and automatically released in the destructor, ensuring exception-safe critical sections. Only move semantics are supported to prevent accidental lock duplication.
Template parameters:
Typical usage involves creating this as a temporary object to access shared data safely.