* A scoped lock for Objects. */
| 13 | * A scoped lock for Objects. |
| 14 | */ |
| 15 | struct ObjectLock |
| 16 | { |
| 17 | public: |
| 18 | ObjectLock(const Object::Ptr& object); |
| 19 | ObjectLock(const Object::Ptr& object, std::defer_lock_t); |
| 20 | ObjectLock(const Object *object); |
| 21 | |
| 22 | ObjectLock(const ObjectLock&) = delete; |
| 23 | ObjectLock& operator=(const ObjectLock&) = delete; |
| 24 | |
| 25 | ~ObjectLock(); |
| 26 | |
| 27 | bool TryLock() noexcept; |
| 28 | void Lock(); |
| 29 | void Unlock(); |
| 30 | |
| 31 | operator bool() const; |
| 32 | |
| 33 | private: |
| 34 | const Object *m_Object{nullptr}; |
| 35 | bool m_Locked{false}; |
| 36 | }; |
| 37 | |
| 38 | } |
| 39 |
no outgoing calls
no test coverage detected