Workspace 6.21.5
Public Member Functions | Protected Member Functions | List of all members
MeshModelSource::LockableRef Class Reference

Reference to the MeshModelSource that is aware of the lifespan of the MeshModelSource and can provide a "lock" on the source for the duration of the scope.

#include <Mesh/DataStructures/meshmodelsource.h>

Public Member Functions

 LockableRef ()
 
 LockableRef (const LockableRef &)=delete
 
 LockableRef (LockableRef &&other)
 
 LockableRef (MeshModelSourceImpl &impl)
 
 ~LockableRef ()
 
LockableRefoperator= (const LockableRef &)=delete
 
LockableRefoperator= (LockableRef &&)
 
bool ownsLock () const
 
LockedPtr< false > scopedLock ()
 
LockedPtr< true > scopedLock () const
 
bool sourceDeleted () const
 

Protected Member Functions

MeshModelSourcelock ()
 
const MeshModelSourcelock () const
 
void unlock ()
 
void unlock () const
 

Constructor & Destructor Documentation

◆ LockableRef() [1/4]

Default constructor for a LockableRef. The ref is invalid when constructed using this constructor,

◆ LockableRef() [2/4]

LockableRef ( MeshModelSourceImpl &  impl)

Constructs a LockableRef that points to the MeshModelSource implementation specified.

◆ LockableRef() [3/4]

LockableRef ( const LockableRef )
delete

◆ LockableRef() [4/4]

LockableRef ( LockableRef &&  other)

Move constructor for a lockable ref. Copying is disabled, but moving is not.

◆ ~LockableRef()

~LockableRef ( )
default

Member Function Documentation

◆ lock() [1/2]

MeshModelSource * lock ( )
protected
Returns
Pointer to the MeshModelSource referenced by this LockableRef object. If the Ref object is invalid, then nullptr will be returned.

Locks the MeshModelSource referred to by this Ref and returns a pointer to it.

◆ lock() [2/2]

const MeshModelSource * lock ( ) const
protected

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

◆ operator=() [1/2]

LockableRef & operator= ( const LockableRef )
delete

◆ operator=() [2/2]

MeshModelSource::LockableRef & operator= ( LockableRef &&  rhs)

Move-assignment operator for LockableRef.

◆ ownsLock()

bool ownsLock ( ) const

◆ scopedLock() [1/2]

MeshModelSource::LockedPtr< false > scopedLock ( )
Returns
A LockedPtr object that maintains a lock on the MeshModelSource as long as it is alive. As soon as the last LockedPtr object goes out of scope, the MeshModelSource is unlocked again.
Note
LockedPtr objects should be destroyed before this object is destroyed.

◆ scopedLock() [2/2]

MeshModelSource::LockedPtr< true > scopedLock ( ) const
Returns
A LockedPtr object that maintains a lock on the MeshModelSource as long as it is alive. As soon as the last LockedPtr object goes out of scope, the MeshModelSource is unlocked again. This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Note
LockedPtr objects should be destroyed before this object is destroyed.

◆ sourceDeleted()

bool sourceDeleted ( ) const
Returns
true if the MeshModelSource referenced by this object is deleted or in the process of being deleted.

◆ unlock() [1/2]

void unlock ( )
protected

Unlocks the MeshModelSource, returning control to others using it.

◆ unlock() [2/2]

void unlock ( ) const
protected

Unlocks the MeshModelSource, returning control to others using it.