YACLib
C++ library for concurrent tasks execution
Loading...
Searching...
No Matches
yaclib::detail::Guard< M, Shared > Class Template Reference

#include <guard.hpp>

Inheritance diagram for yaclib::detail::Guard< M, Shared >:
[legend]
Collaboration diagram for yaclib::detail::Guard< M, Shared >:
[legend]

Public Member Functions

 Guard () noexcept=default
 
 Guard (Guard &&other) noexcept
 
 Guard (M &m, std::defer_lock_t) noexcept
 
 Guard (M &m, std::try_to_lock_t) noexcept
 
 Guard (M &m, std::adopt_lock_t) noexcept
 
 ~Guard () noexcept
 
Guardoperator= (Guard &&other) noexcept
 
auto Lock () noexcept
 
bool TryLock () noexcept
 
auto Unlock () noexcept
 
auto UnlockOn (IExecutor &e) noexcept
 
void UnlockHere () noexcept
 
void Swap (Guard &other) noexcept
 
MRelease () noexcept
 
MMutex () const noexcept
 
bool OwnsLock () const noexcept
 
 operator bool () const noexcept
 

Additional Inherited Members

- Protected Member Functions inherited from yaclib::detail::GuardState
 GuardState () noexcept=default
 
 GuardState (void *ptr, bool owns) noexcept
 
 GuardState (GuardState &&other) noexcept
 
GuardStateoperator= (GuardState &&other) noexcept
 
void Swap (GuardState &other) noexcept
 
voidPtr () const
 
bool Owns () const noexcept
 
voidLockState () noexcept
 
voidUnlockState () noexcept
 
voidReleaseState () noexcept
 
- Protected Attributes inherited from yaclib::detail::GuardState
std::uintptr_t _state = 0
 

Detailed Description

template<typename M, bool Shared>
class yaclib::detail::Guard< M, Shared >

Definition at line 12 of file guard.hpp.

Constructor & Destructor Documentation

◆ Guard() [1/5]

template<typename M , bool Shared>
yaclib::detail::Guard< M, Shared >::Guard ( )
defaultnoexcept

◆ Guard() [2/5]

template<typename M , bool Shared>
yaclib::detail::Guard< M, Shared >::Guard ( Guard< M, Shared > &&  other)
inlinenoexcept

Definition at line 15 of file guard.hpp.

References yaclib::MakeContract().

◆ Guard() [3/5]

template<typename M , bool Shared>
yaclib::detail::Guard< M, Shared >::Guard ( M m,
std::defer_lock_t   
)
inlineexplicitnoexcept

Definition at line 17 of file guard.hpp.

References yaclib::MakeContract().

◆ Guard() [4/5]

template<typename M , bool Shared>
yaclib::detail::Guard< M, Shared >::Guard ( M m,
std::try_to_lock_t   
)
inlineexplicitnoexcept

Definition at line 19 of file guard.hpp.

References yaclib::MakeContract().

◆ Guard() [5/5]

template<typename M , bool Shared>
yaclib::detail::Guard< M, Shared >::Guard ( M m,
std::adopt_lock_t   
)
inlineexplicitnoexcept

Definition at line 21 of file guard.hpp.

References yaclib::MakeContract().

◆ ~Guard()

template<typename M , bool Shared>
yaclib::detail::Guard< M, Shared >::~Guard ( )
inlinenoexcept

Definition at line 24 of file guard.hpp.

References yaclib::detail::Guard< M, Shared >::UnlockHere().

Member Function Documentation

◆ Lock()

template<typename M , bool Shared>
auto yaclib::detail::Guard< M, Shared >::Lock ( )
inlinenoexcept

Definition at line 35 of file guard.hpp.

References yaclib::detail::GuardState::LockState(), and yaclib::MakeContract().

◆ Mutex()

template<typename M , bool Shared>
M * yaclib::detail::Guard< M, Shared >::Mutex ( ) const
inlinenoexcept

Definition at line 88 of file guard.hpp.

References yaclib::MakeContract(), and yaclib::detail::GuardState::Ptr().

◆ operator bool()

template<typename M , bool Shared>
yaclib::detail::Guard< M, Shared >::operator bool ( ) const
inlineexplicitnoexcept

Definition at line 96 of file guard.hpp.

References yaclib::detail::Guard< M, Shared >::OwnsLock().

◆ operator=()

template<typename M , bool Shared>
Guard & yaclib::detail::Guard< M, Shared >::operator= ( Guard< M, Shared > &&  other)
inlinenoexcept

Definition at line 30 of file guard.hpp.

References yaclib::MakeContract(), and yaclib::detail::Guard< M, Shared >::Swap().

◆ OwnsLock()

template<typename M , bool Shared>
bool yaclib::detail::Guard< M, Shared >::OwnsLock ( ) const
inlinenoexcept

◆ Release()

template<typename M , bool Shared>
M * yaclib::detail::Guard< M, Shared >::Release ( )
inlinenoexcept

Definition at line 84 of file guard.hpp.

References yaclib::MakeContract(), and yaclib::detail::GuardState::ReleaseState().

◆ Swap()

template<typename M , bool Shared>
void yaclib::detail::Guard< M, Shared >::Swap ( Guard< M, Shared > &  other)
inlinenoexcept

◆ TryLock()

template<typename M , bool Shared>
bool yaclib::detail::Guard< M, Shared >::TryLock ( )
inlinenoexcept

◆ Unlock()

template<typename M , bool Shared>
auto yaclib::detail::Guard< M, Shared >::Unlock ( )
inlinenoexcept

Definition at line 53 of file guard.hpp.

References yaclib::MakeContract(), and yaclib::detail::GuardState::UnlockState().

◆ UnlockHere()

template<typename M , bool Shared>
void yaclib::detail::Guard< M, Shared >::UnlockHere ( )
inlinenoexcept

◆ UnlockOn()

template<typename M , bool Shared>
auto yaclib::detail::Guard< M, Shared >::UnlockOn ( IExecutor e)
inlinenoexcept

Definition at line 62 of file guard.hpp.

References yaclib::MakeContract(), and yaclib::detail::GuardState::UnlockState().


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