Gaia-ECS v0.9.3
A simple and powerful entity component system
Loading...
Searching...
No Matches
gaia::core::lock_scope< T > Struct Template Reference

RAII helper that calls lock() on construction and unlock() on destruction. More...

#include <utility.h>

Public Member Functions

 lock_scope (T &ctx)
 Acquires the lock represented by ctx.
 
 ~lock_scope ()
 Releases the guarded lock.
 
 lock_scope (const lock_scope &)=delete
 Copy construction is disabled because the lock ownership is scoped.
 
lock_scopeoperator= (const lock_scope &)=delete
 Copy assignment is disabled because the lock ownership is scoped.
 
 lock_scope (lock_scope &&)=delete
 Move construction is disabled because the lock ownership is scoped.
 
lock_scopeoperator= (lock_scope &&)=delete
 Move assignment is disabled because the lock ownership is scoped.
 

Public Attributes

T & m_ctx
 Guarded lockable object.
 

Detailed Description

template<typename T>
struct gaia::core::lock_scope< T >

RAII helper that calls lock() on construction and unlock() on destruction.

Template Parameters
TLockable type exposing lock() and unlock().

Constructor & Destructor Documentation

◆ lock_scope()

template<typename T >
gaia::core::lock_scope< T >::lock_scope ( T &  ctx)
inline

Acquires the lock represented by ctx.

Parameters
ctxLockable object to guard for the lifetime of this scope.

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