Games Task Scheduler (GTS)
A multi-processor scheduling framework for games engines
gts::ReadGuard< T, TAccessorSharedMutex, TGrowSharedMutex > Class Template Reference

A read-only item guarded by a mutex. The mutex is released on destruction. More...

#include <Guards.h>

Inherits gts::internal::GuardBase< T, TAccessorSharedMutex, TGrowSharedMutex >.

Public Member Functions

 ReadGuard (ReadGuard const &)=delete
 
 ReadGuard (ReadGuard &&)=default
 
ReadGuardoperator= (ReadGuard const &)=delete
 
ReadGuardoperator= (ReadGuard &&)=default
 
 ReadGuard (T *pItem, TAccessorSharedMutex *pAccessorMutex, TGrowSharedMutex *pGrowMutex)
 
 ~ReadGuard ()
 Unlocks the guarded element.
 
- Public Member Functions inherited from gts::internal::GuardBase< T, TAccessorSharedMutex, TGrowSharedMutex >
 GuardBase (GuardBase const &)=delete
 
GuardBaseoperator= (GuardBase const &)=delete
 
 GuardBase (GuardBase &&other)
 
GuardBaseoperator= (GuardBase &&other)
 
 GuardBase (T *pItem, TAccessorSharedMutex *pAccessorMutex, TGrowSharedMutex *pGrowMutex)
 
T const & get () const
 Gets the contained value. More...
 
bool isValid () const
 Checks if the contained value is valid. More...
 

Additional Inherited Members

- Protected Attributes inherited from gts::internal::GuardBase< T, TAccessorSharedMutex, TGrowSharedMutex >
T * m_pItem
 
TAccessorSharedMutex * m_pAccessorMutex
 
TGrowSharedMutex * m_pGrowMutex
 

Detailed Description

template<typename T, typename TAccessorSharedMutex, typename TGrowSharedMutex>
class gts::ReadGuard< T, TAccessorSharedMutex, TGrowSharedMutex >

A read-only item guarded by a mutex. The mutex is released on destruction.

Remarks
Keeping this object alive will block other threads from writing.