CeresEngine 0.2.0
A game development framework
Loading...
Searching...
No Matches
CeresEngine::ResourceStreamLock Class Reference

A lock that allows either reading or writing to the stream. More...

#include <CeresEngine/Resource/ResourceStream.hpp>

Public Member Functions

 ResourceStreamLock (ResourceStreamData &data, ScopedLock &&lock)
 Creates a new ResourceStreamLock for the given resource stream and an acquired scoped lock.
 
bool isExclusive () const noexcept
 Determines if the lock is exclusive (writing) or shared (reading).
 
ResourceStreamData & getStreamData () const noexcept
 The resource stream data instance to which this lock corresponds to.
 

Private Types

using ScopedLock = ResourceStreamLockMutex::Lock
 A type that represents the low-level scoped lock.
 

Private Attributes

ScopedLock mScopedLock
 The low-level scoped lock, usually acquired and managed from the owning ResourceStreamData instance.
 
ResourceStreamDataPtr mData
 The resource stream data instance to which this lock corresponds to.
 

Detailed Description

A lock that allows either reading or writing to the stream.

Member Typedef Documentation

◆ ScopedLock

using CeresEngine::ResourceStreamLock::ScopedLock = ResourceStreamLockMutex::Lock
private

A type that represents the low-level scoped lock.

Constructor & Destructor Documentation

◆ ResourceStreamLock()

CeresEngine::ResourceStreamLock::ResourceStreamLock ( ResourceStreamData &  data,
ScopedLock &&  lock 
)
inline

Creates a new ResourceStreamLock for the given resource stream and an acquired scoped lock.

Member Function Documentation

◆ getStreamData()

ResourceStreamData & CeresEngine::ResourceStreamLock::getStreamData ( ) const
inlinenoexcept

The resource stream data instance to which this lock corresponds to.

◆ isExclusive()

bool CeresEngine::ResourceStreamLock::isExclusive ( ) const
inlinenoexcept

Determines if the lock is exclusive (writing) or shared (reading).

Member Data Documentation

◆ mData

ResourceStreamDataPtr CeresEngine::ResourceStreamLock::mData
private

The resource stream data instance to which this lock corresponds to.

◆ mScopedLock

ScopedLock CeresEngine::ResourceStreamLock::mScopedLock
private

The low-level scoped lock, usually acquired and managed from the owning ResourceStreamData instance.


The documentation for this class was generated from the following file: