Template Class LockedPtr

Class Documentation

template<typename T>
class LockedPtr

The MutablePtr is a wrapper to a pointer that locks a mutex in the constructor and unlocks it in the destructor. It allows the user to access the reference/pointer and modify the object.

Public Functions

inline LockedPtr(T *obj, Mutex *mutex)
LockedPtr(const LockedPtr&) = delete
LockedPtr &operator=(const LockedPtr&) = delete
inline LockedPtr(LockedPtr&&)
inline LockedPtr &operator=(LockedPtr&&)
inline ~LockedPtr()
inline operator bool() const

True if the object is not nullptr.

inline T &operator*()

Return the reference.

inline T *operator->()

Return the pointer.