alternative Standard Libary  0.29.8
std::lock_ptr< T, L > Template-Klassenreferenz

auto lock pointer. Mehr ...

#include <lock_ptr.hpp>

Öffentliche Typen

using value_type = T
 
using lock_type = L
 
using pointer = T *
 
using reference = T &
 
using self_type = lock_ptr< T, L >
 

Öffentliche Methoden

 lock_ptr (volatile T &v, lock_type &m)
 constructor make the pointer and auto lock Mehr ...
 
 ~lock_ptr ()
 decunstructor and auto unlock the pointer Mehr ...
 
value_type const * get () const
 get the pointer value const Mehr ...
 
value_typeget ()
 get the pointer value Mehr ...
 
value_typeoperator* ()
 return the reference of the pointer Mehr ...
 
value_typeoperator-> ()
 helper to use this pointer as "native" pointer Mehr ...
 
 lock_ptr (const lock_ptr &)=delete
 
lock_ptroperator= (const lock_ptr &)=delete
 

Ausführliche Beschreibung

template<typename T, class L = ASSTL_LOCK_DEFAULT>
class std::lock_ptr< T, L >

auto lock pointer.

Template-Parameter
Tpointer type of this lock pointer
Llock class
Siehe auch
mutex
spinlock

Dokumentation der benutzerdefinierten Datentypen

◆ lock_type

template<typename T , class L = ASSTL_LOCK_DEFAULT>
using std::lock_ptr< T, L >::lock_type = L

◆ pointer

template<typename T , class L = ASSTL_LOCK_DEFAULT>
using std::lock_ptr< T, L >::pointer = T*

◆ reference

template<typename T , class L = ASSTL_LOCK_DEFAULT>
using std::lock_ptr< T, L >::reference = T&

◆ self_type

template<typename T , class L = ASSTL_LOCK_DEFAULT>
using std::lock_ptr< T, L >::self_type = lock_ptr<T, L>

◆ value_type

template<typename T , class L = ASSTL_LOCK_DEFAULT>
using std::lock_ptr< T, L >::value_type = T

Beschreibung der Konstruktoren und Destruktoren

◆ lock_ptr() [1/2]

template<typename T , class L = ASSTL_LOCK_DEFAULT>
std::lock_ptr< T, L >::lock_ptr ( volatile T &  v,
lock_type m 
)
inlineexplicit

constructor make the pointer and auto lock

Parameter
vReference to locked area/object
mLockType Reference to the using lock hekper class
54  : m_ptr(const_cast<T*>(&v)), m_lock(&m) {
55  m_lock->lock();
56  }

◆ ~lock_ptr()

template<typename T , class L = ASSTL_LOCK_DEFAULT>
std::lock_ptr< T, L >::~lock_ptr ( )
inline

decunstructor and auto unlock the pointer

58  {
59  m_lock->unlock();
60  }

◆ lock_ptr() [2/2]

template<typename T , class L = ASSTL_LOCK_DEFAULT>
std::lock_ptr< T, L >::lock_ptr ( const lock_ptr< T, L > &  )
delete

Dokumentation der Elementfunktionen

◆ get() [1/2]

template<typename T , class L = ASSTL_LOCK_DEFAULT>
value_type const* std::lock_ptr< T, L >::get ( ) const
inline

get the pointer value const

62  {
63  return m_ptr;
64  }

◆ get() [2/2]

template<typename T , class L = ASSTL_LOCK_DEFAULT>
value_type* std::lock_ptr< T, L >::get ( )
inline

get the pointer value

66  {
67  return m_ptr;
68  }

◆ operator*()

template<typename T , class L = ASSTL_LOCK_DEFAULT>
value_type& std::lock_ptr< T, L >::operator* ( )
inline

return the reference of the pointer

70  {
71  return *m_ptr;
72  }

◆ operator->()

template<typename T , class L = ASSTL_LOCK_DEFAULT>
value_type* std::lock_ptr< T, L >::operator-> ( )
inline

helper to use this pointer as "native" pointer

74  {
75  return m_ptr;
76  }

◆ operator=()

template<typename T , class L = ASSTL_LOCK_DEFAULT>
lock_ptr& std::lock_ptr< T, L >::operator= ( const lock_ptr< T, L > &  )
delete

Die Dokumentation für diese Klasse wurde erzeugt aufgrund der Datei: