YACLib
C++ library for concurrent tasks execution
Loading...
Searching...
No Matches
yaclib::detail::GuardState Class Reference

#include <guard_state.hpp>

Inheritance diagram for yaclib::detail::GuardState:
[legend]
Collaboration diagram for yaclib::detail::GuardState:
[legend]

Public Member Functions

 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

std::uintptr_t _state = 0
 

Detailed Description

Definition at line 9 of file guard_state.hpp.

Constructor & Destructor Documentation

◆ GuardState() [1/3]

yaclib::detail::GuardState::GuardState ( )
defaultnoexcept

◆ GuardState() [2/3]

yaclib::detail::GuardState::GuardState ( void ptr,
bool  owns 
)
inlineexplicitnoexcept

Definition at line 15 of file guard_state.hpp.

References yaclib::MakeContract().

◆ GuardState() [3/3]

yaclib::detail::GuardState::GuardState ( GuardState &&  other)
inlinenoexcept

Definition at line 18 of file guard_state.hpp.

References yaclib::MakeContract().

Member Function Documentation

◆ LockState()

void * yaclib::detail::GuardState::LockState ( )
inlinenoexcept

◆ operator=()

GuardState & yaclib::detail::GuardState::operator= ( GuardState &&  other)
inlinenoexcept

Definition at line 22 of file guard_state.hpp.

References yaclib::MakeContract(), and Swap().

◆ Owns()

bool yaclib::detail::GuardState::Owns ( ) const
inlinenoexcept

Definition at line 35 of file guard_state.hpp.

References _state.

Referenced by LockState(), yaclib::detail::Guard< M, Shared >::OwnsLock(), and UnlockState().

◆ Ptr()

void * yaclib::detail::GuardState::Ptr ( ) const
inline

Definition at line 31 of file guard_state.hpp.

References _state.

Referenced by LockState(), yaclib::detail::Guard< M, Shared >::Mutex(), ReleaseState(), and UnlockState().

◆ ReleaseState()

void * yaclib::detail::GuardState::ReleaseState ( )
inlinenoexcept

Definition at line 51 of file guard_state.hpp.

References _state, yaclib::MakeContract(), and Ptr().

Referenced by yaclib::detail::Guard< M, Shared >::Release().

◆ Swap()

void yaclib::detail::GuardState::Swap ( GuardState other)
inlinenoexcept

Definition at line 27 of file guard_state.hpp.

References _state, and yaclib::MakeContract().

Referenced by operator=().

◆ UnlockState()

Member Data Documentation

◆ _state

std::uintptr_t yaclib::detail::GuardState::_state = 0
protected

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