libjmmcg  release_579_6_g8cffd
A C++ library containing an eclectic mix of useful, advanced components.
jmmcg::LIBJMMCG_VER_NAMESPACE::ppd::safe_colln< C, M, WL, Sig, MLk > Class Template Reference

An adaptor for a container that attempts to add some thread-safety to assist in making thread-safe programs. More...

#include <thread_safe_adaptors.hpp>

Inherits C.

Collaboration diagram for jmmcg::LIBJMMCG_VER_NAMESPACE::ppd::safe_colln< C, M, WL, Sig, MLk >:
[legend]

Public Types

typedef C container_type
 The container to be adapted. More...
 
typedef Sig have_work_type
 Used to enable functionality to atomically signal if the container contains work or not. More...
 
typedef M atomic_t
 The underlying lock object to use that will be locked in some (EREW or CREW or other) manner. More...
 
typedef WL write_lock_type
 The type of write-lock to use. This allows the possibility of using a read-write lock. More...
 
typedef atomic_t::read_lock_type read_lock_type
 The type of read lock to use, by default the write lock. This allows the possibility of using a read-write lock. More...
 
typedef MLk lock_all_type
 The multi-lock type to use to ensured that operations on combined safe_collns are thread-safe. Note that locking them in any order reduces the likelihood of deadlock at the cost of performance. More...
 
typedef atomic_t::lock_traits lock_traits
 
typedef api_threading_traits< lock_traits::api_type, typename lock_traits::model_type > thread_traits
 
typedef container_type::reference reference
 
typedef container_type::const_reference const_reference
 
typedef container_type::size_type size_type
 
typedef container_type::value_type value_type
 
typedef lock_traits::exception_type exception_type
 
using exit_requested_type = typename have_work_type::atomic_t
 

Public Member Functions

 BOOST_MPL_ASSERT ((std::is_same< typename write_lock_type::atomic_t, atomic_t >))
 
atomic_t &__fastcall pop_lock () noexcept(true) FORCE_INLINE
 A flag to atomically signal if the container contains work or not, how much work and the underlying lock, to assist in writing thread-safe code. More...
 
atomic_t &__fastcall pop_lock () const noexcept(true) FORCE_INLINE
 A flag to atomically signal if the container contains work or not, how much work and the underlying lock, to assist in writing thread-safe code. More...
 
atomic_t &__fastcall push_lock () noexcept(true) FORCE_INLINE
 A flag to atomically signal if the container contains work or not, how much work and the underlying lock, to assist in writing thread-safe code. More...
 
atomic_t &__fastcall push_lock () const noexcept(true) FORCE_INLINE
 A flag to atomically signal if the container contains work or not, and how much work and the underlying lock, to assist in writing thread-safe code. More...
 
__stdcall safe_colln () noexcept(noexcept(container_type()) &&noexcept(have_work_type())) FORCE_INLINE
 
 safe_colln (typename have_work_type::atomic_t &) FORCE_INLINE
 
 safe_colln (std::initializer_list< value_type >) FORCE_INLINE
 
__stdcall safe_colln (size_type const sz, value_type const &v=value_type()) FORCE_INLINE
 
template<class T1 , class T2 >
__stdcall FORCE_INLINE safe_colln (size_type const sz, T1 const &, T2 const &)
 
__stdcall safe_colln (const container_type &) FORCE_INLINE
 
__stdcall safe_colln (const safe_colln &) noexcept(false) FORCE_INLINE
 
__stdcall ~safe_colln () FORCE_INLINE
 
safe_colln &__fastcall operator= (const safe_colln &) noexcept(false) FORCE_INLINE
 
bool __fastcall empty () const noexcept(true) FORCE_INLINE
 
size_type __fastcall sync_size () const noexcept(false) FORCE_INLINE
 
size_type __fastcall size () const noexcept(true) FORCE_INLINE
 
value_type __fastcall operator[] (size_type s) const noexcept(false) FORCE_INLINE
 
void __fastcall push_back (value_type const &v) noexcept(false) FORCE_INLINE
 
void __fastcall push_back (value_type &&v) noexcept(false) FORCE_INLINE
 
void __fastcall push_front (const value_type &v) noexcept(false) FORCE_INLINE
 
void __fastcall push_front (value_type &&v) noexcept(false) FORCE_INLINE
 
size_type __fastcall erase (const value_type &v) noexcept(false) FORCE_INLINE
 
void __fastcall reserve (size_type sz) noexcept(false) FORCE_INLINE
 
void __fastcall clear () noexcept(false) FORCE_INLINE
 
void __fastcall swap (safe_colln &t) noexcept(false) FORCE_INLINE
 
void __fastcall resize_noinit_nolk (const size_type sz) noexcept(false) FORCE_INLINE
 Resize the container to the requested size, but try to minimise (re-)initialising or deleting any of the existing elements. More...
 
void __fastcall resize (const size_type sz) noexcept(false) FORCE_INLINE
 Resize the container to the requested size. More...
 
bool __fastcall operator== (safe_colln const &) const noexcept(true) FORCE_INLINE
 
template<typename M1 , typename WL1 , class Sig1 , class MLk1 >
bool __fastcall FORCE_INLINE operator== (safe_colln< C, M1, WL1, Sig1, MLk1 > const &) const noexcept(true)
 
container_type const & colln () const noexcept(true) FORCE_INLINE
 
container_typecolln () noexcept(true) FORCE_INLINE
 
template<class T1 , class T2 >
 safe_colln (size_type const sz, T1 const &, T2 const &)
 
template<typename M1 , typename WL1 , class Sig1 , class MLk1 >
bool operator== (safe_colln< C, M1, WL1, Sig1, MLk1 > const &sc) const noexcept(true)
 

Public Attributes

have_work_type have_work
 A flag to atomically signal if the container contains work or not, how much work and the underlying lock, to assist in writing thread-safe code. More...
 

Static Public Attributes

static constexpr generic_traits::memory_access_modes memory_access_mode
 

Detailed Description

template<typename C, typename M, typename WL = typename M::write_lock_type, class Sig = no_signalling<M>, class MLk = typename lock::any_order::all<M::lock_traits::api_type, typename M::lock_traits::model_type, M, M>>
class jmmcg::LIBJMMCG_VER_NAMESPACE::ppd::safe_colln< C, M, WL, Sig, MLk >

An adaptor for a container that attempts to add some thread-safety to assist in making thread-safe programs.

By default the adapted container does not use a read-write lock. Note that if the read_lock_type and write_lock_types are the same, i.e. an exclusive lock were used, then the adaptor will exhibit EREW semantics. If a read-writer lock is used for them ,then it will exhibit CREW semantics.

See also
queue < We want to be able to pass it as a "C (container)", but we also don't want to expose the unprotected, base functionality.

Definition at line 203 of file thread_safe_adaptors.hpp.

Member Typedef Documentation

◆ atomic_t

template<typename C , typename M , typename WL = typename M::write_lock_type, class Sig = no_signalling<M>, class MLk = typename lock::any_order::all<M::lock_traits::api_type, typename M::lock_traits::model_type, M, M>>
typedef M jmmcg::LIBJMMCG_VER_NAMESPACE::ppd::safe_colln< C, M, WL, Sig, MLk >::atomic_t

The underlying lock object to use that will be locked in some (EREW or CREW or other) manner.

Definition at line 208 of file thread_safe_adaptors.hpp.

◆ const_reference

template<typename C , typename M , typename WL = typename M::write_lock_type, class Sig = no_signalling<M>, class MLk = typename lock::any_order::all<M::lock_traits::api_type, typename M::lock_traits::model_type, M, M>>
typedef container_type::const_reference jmmcg::LIBJMMCG_VER_NAMESPACE::ppd::safe_colln< C, M, WL, Sig, MLk >::const_reference

Definition at line 215 of file thread_safe_adaptors.hpp.

◆ container_type

template<typename C , typename M , typename WL = typename M::write_lock_type, class Sig = no_signalling<M>, class MLk = typename lock::any_order::all<M::lock_traits::api_type, typename M::lock_traits::model_type, M, M>>
typedef C jmmcg::LIBJMMCG_VER_NAMESPACE::ppd::safe_colln< C, M, WL, Sig, MLk >::container_type

The container to be adapted.

Definition at line 206 of file thread_safe_adaptors.hpp.

◆ exception_type

template<typename C , typename M , typename WL = typename M::write_lock_type, class Sig = no_signalling<M>, class MLk = typename lock::any_order::all<M::lock_traits::api_type, typename M::lock_traits::model_type, M, M>>
typedef lock_traits::exception_type jmmcg::LIBJMMCG_VER_NAMESPACE::ppd::safe_colln< C, M, WL, Sig, MLk >::exception_type

Definition at line 218 of file thread_safe_adaptors.hpp.

◆ exit_requested_type

template<typename C , typename M , typename WL = typename M::write_lock_type, class Sig = no_signalling<M>, class MLk = typename lock::any_order::all<M::lock_traits::api_type, typename M::lock_traits::model_type, M, M>>
using jmmcg::LIBJMMCG_VER_NAMESPACE::ppd::safe_colln< C, M, WL, Sig, MLk >::exit_requested_type = typename have_work_type::atomic_t

Definition at line 219 of file thread_safe_adaptors.hpp.

◆ have_work_type

template<typename C , typename M , typename WL = typename M::write_lock_type, class Sig = no_signalling<M>, class MLk = typename lock::any_order::all<M::lock_traits::api_type, typename M::lock_traits::model_type, M, M>>
typedef Sig jmmcg::LIBJMMCG_VER_NAMESPACE::ppd::safe_colln< C, M, WL, Sig, MLk >::have_work_type

Used to enable functionality to atomically signal if the container contains work or not.

Definition at line 207 of file thread_safe_adaptors.hpp.

◆ lock_all_type

template<typename C , typename M , typename WL = typename M::write_lock_type, class Sig = no_signalling<M>, class MLk = typename lock::any_order::all<M::lock_traits::api_type, typename M::lock_traits::model_type, M, M>>
typedef MLk jmmcg::LIBJMMCG_VER_NAMESPACE::ppd::safe_colln< C, M, WL, Sig, MLk >::lock_all_type

The multi-lock type to use to ensured that operations on combined safe_collns are thread-safe. Note that locking them in any order reduces the likelihood of deadlock at the cost of performance.

Definition at line 211 of file thread_safe_adaptors.hpp.

◆ lock_traits

template<typename C , typename M , typename WL = typename M::write_lock_type, class Sig = no_signalling<M>, class MLk = typename lock::any_order::all<M::lock_traits::api_type, typename M::lock_traits::model_type, M, M>>
typedef atomic_t::lock_traits jmmcg::LIBJMMCG_VER_NAMESPACE::ppd::safe_colln< C, M, WL, Sig, MLk >::lock_traits

Definition at line 212 of file thread_safe_adaptors.hpp.

◆ read_lock_type

template<typename C , typename M , typename WL = typename M::write_lock_type, class Sig = no_signalling<M>, class MLk = typename lock::any_order::all<M::lock_traits::api_type, typename M::lock_traits::model_type, M, M>>
typedef atomic_t::read_lock_type jmmcg::LIBJMMCG_VER_NAMESPACE::ppd::safe_colln< C, M, WL, Sig, MLk >::read_lock_type

The type of read lock to use, by default the write lock. This allows the possibility of using a read-write lock.

Definition at line 210 of file thread_safe_adaptors.hpp.

◆ reference

template<typename C , typename M , typename WL = typename M::write_lock_type, class Sig = no_signalling<M>, class MLk = typename lock::any_order::all<M::lock_traits::api_type, typename M::lock_traits::model_type, M, M>>
typedef container_type::reference jmmcg::LIBJMMCG_VER_NAMESPACE::ppd::safe_colln< C, M, WL, Sig, MLk >::reference

Definition at line 214 of file thread_safe_adaptors.hpp.

◆ size_type

template<typename C , typename M , typename WL = typename M::write_lock_type, class Sig = no_signalling<M>, class MLk = typename lock::any_order::all<M::lock_traits::api_type, typename M::lock_traits::model_type, M, M>>
typedef container_type::size_type jmmcg::LIBJMMCG_VER_NAMESPACE::ppd::safe_colln< C, M, WL, Sig, MLk >::size_type

Definition at line 216 of file thread_safe_adaptors.hpp.

◆ thread_traits

template<typename C , typename M , typename WL = typename M::write_lock_type, class Sig = no_signalling<M>, class MLk = typename lock::any_order::all<M::lock_traits::api_type, typename M::lock_traits::model_type, M, M>>
typedef api_threading_traits<lock_traits::api_type, typename lock_traits::model_type> jmmcg::LIBJMMCG_VER_NAMESPACE::ppd::safe_colln< C, M, WL, Sig, MLk >::thread_traits

Definition at line 213 of file thread_safe_adaptors.hpp.

◆ value_type

template<typename C , typename M , typename WL = typename M::write_lock_type, class Sig = no_signalling<M>, class MLk = typename lock::any_order::all<M::lock_traits::api_type, typename M::lock_traits::model_type, M, M>>
typedef container_type::value_type jmmcg::LIBJMMCG_VER_NAMESPACE::ppd::safe_colln< C, M, WL, Sig, MLk >::value_type

Definition at line 217 of file thread_safe_adaptors.hpp.

◆ write_lock_type

template<typename C , typename M , typename WL = typename M::write_lock_type, class Sig = no_signalling<M>, class MLk = typename lock::any_order::all<M::lock_traits::api_type, typename M::lock_traits::model_type, M, M>>
typedef WL jmmcg::LIBJMMCG_VER_NAMESPACE::ppd::safe_colln< C, M, WL, Sig, MLk >::write_lock_type

The type of write-lock to use. This allows the possibility of using a read-write lock.

Definition at line 209 of file thread_safe_adaptors.hpp.

Constructor & Destructor Documentation

◆ safe_colln() [1/8]

template<typename C , typename M , typename WL , class Sig , class MLk >
jmmcg::LIBJMMCG_VER_NAMESPACE::ppd::safe_colln< C, M, WL, Sig, MLk >::safe_colln
inlinenoexcept

◆ safe_colln() [2/8]

template<typename C , typename M , typename WL , class Sig , class MLk >
jmmcg::LIBJMMCG_VER_NAMESPACE::ppd::safe_colln< C, M, WL, Sig, MLk >::safe_colln ( typename have_work_type::atomic_t &  ev)
inlineexplicit

◆ safe_colln() [3/8]

template<typename C , typename M , typename WL , class Sig , class MLk >
jmmcg::LIBJMMCG_VER_NAMESPACE::ppd::safe_colln< C, M, WL, Sig, MLk >::safe_colln ( std::initializer_list< value_type v)
inlineexplicit

◆ safe_colln() [4/8]

template<typename C , typename M , typename WL , class Sig , class MLk >
jmmcg::LIBJMMCG_VER_NAMESPACE::ppd::safe_colln< C, M, WL, Sig, MLk >::safe_colln ( size_type const  sz,
value_type const &  v = value_type() 
)
inlineexplicit

◆ safe_colln() [5/8]

template<typename C , typename M , typename WL = typename M::write_lock_type, class Sig = no_signalling<M>, class MLk = typename lock::any_order::all<M::lock_traits::api_type, typename M::lock_traits::model_type, M, M>>
template<class T1 , class T2 >
__stdcall FORCE_INLINE jmmcg::LIBJMMCG_VER_NAMESPACE::ppd::safe_colln< C, M, WL, Sig, MLk >::safe_colln ( size_type const  sz,
T1 const &  ,
T2 const &   
)

◆ safe_colln() [6/8]

template<typename C , typename M , typename WL , class Sig , class MLk >
jmmcg::LIBJMMCG_VER_NAMESPACE::ppd::safe_colln< C, M, WL, Sig, MLk >::safe_colln ( const container_type t)
inlineexplicit

◆ safe_colln() [7/8]

template<typename C , typename M , typename WL , class Sig , class MLk >
jmmcg::LIBJMMCG_VER_NAMESPACE::ppd::safe_colln< C, M, WL, Sig, MLk >::safe_colln ( const safe_colln< C, M, WL, Sig, MLk > &  t)
inlinenoexcept

◆ ~safe_colln()

template<typename C , typename M , typename WL , class Sig , class MLk >
jmmcg::LIBJMMCG_VER_NAMESPACE::ppd::safe_colln< C, M, WL, Sig, MLk >::~safe_colln
inline

Definition at line 124 of file thread_safe_adaptors_impl.hpp.

◆ safe_colln() [8/8]

template<typename C , typename M , typename WL = typename M::write_lock_type, class Sig = no_signalling<M>, class MLk = typename lock::any_order::all<M::lock_traits::api_type, typename M::lock_traits::model_type, M, M>>
template<class T1 , class T2 >
jmmcg::LIBJMMCG_VER_NAMESPACE::ppd::safe_colln< C, M, WL, Sig, MLk >::safe_colln ( size_type const  sz,
T1 const &  ,
T2 const &   
)
inline

Member Function Documentation

◆ BOOST_MPL_ASSERT()

template<typename C , typename M , typename WL = typename M::write_lock_type, class Sig = no_signalling<M>, class MLk = typename lock::any_order::all<M::lock_traits::api_type, typename M::lock_traits::model_type, M, M>>
jmmcg::LIBJMMCG_VER_NAMESPACE::ppd::safe_colln< C, M, WL, Sig, MLk >::BOOST_MPL_ASSERT ( (std::is_same< typename write_lock_type::atomic_t, atomic_t >)  )

◆ clear()

template<typename C , typename M , typename WL , class Sig , class MLk >
void jmmcg::LIBJMMCG_VER_NAMESPACE::ppd::safe_colln< C, M, WL, Sig, MLk >::clear
inlinenoexcept

◆ colln() [1/2]

template<typename C , typename M , typename WL = typename M::write_lock_type, class Sig = no_signalling<M>, class MLk = typename lock::any_order::all<M::lock_traits::api_type, typename M::lock_traits::model_type, M, M>>
container_type const& jmmcg::LIBJMMCG_VER_NAMESPACE::ppd::safe_colln< C, M, WL, Sig, MLk >::colln ( ) const
inlinenoexcept

Definition at line 310 of file thread_safe_adaptors.hpp.

◆ colln() [2/2]

template<typename C , typename M , typename WL = typename M::write_lock_type, class Sig = no_signalling<M>, class MLk = typename lock::any_order::all<M::lock_traits::api_type, typename M::lock_traits::model_type, M, M>>
container_type& jmmcg::LIBJMMCG_VER_NAMESPACE::ppd::safe_colln< C, M, WL, Sig, MLk >::colln ( )
inlinenoexcept

Definition at line 313 of file thread_safe_adaptors.hpp.

◆ empty()

template<typename C , typename M , typename WL , class Sig , class MLk >
bool jmmcg::LIBJMMCG_VER_NAMESPACE::ppd::safe_colln< C, M, WL, Sig, MLk >::empty
inlinenoexcept

Definition at line 139 of file thread_safe_adaptors_impl.hpp.

◆ erase()

template<typename C , typename M , typename WL , class Sig , class MLk >
ppd::safe_colln< C, M, WL, Sig, MLk >::size_type jmmcg::LIBJMMCG_VER_NAMESPACE::ppd::safe_colln< C, M, WL, Sig, MLk >::erase ( const value_type v)
inlinenoexcept

◆ operator=()

template<typename C , typename M , typename WL , class Sig , class MLk >
ppd::safe_colln< C, M, WL, Sig, MLk > & jmmcg::LIBJMMCG_VER_NAMESPACE::ppd::safe_colln< C, M, WL, Sig, MLk >::operator= ( const safe_colln< C, M, WL, Sig, MLk > &  t)
inlinenoexcept

◆ operator==() [1/3]

template<typename C , typename M , typename WL , class Sig , class MLk >
bool jmmcg::LIBJMMCG_VER_NAMESPACE::ppd::safe_colln< C, M, WL, Sig, MLk >::operator== ( safe_colln< C, M, WL, Sig, MLk > const &  sc) const
inlinenoexcept

Definition at line 226 of file thread_safe_adaptors_impl.hpp.

◆ operator==() [2/3]

template<typename C , typename M , typename WL = typename M::write_lock_type, class Sig = no_signalling<M>, class MLk = typename lock::any_order::all<M::lock_traits::api_type, typename M::lock_traits::model_type, M, M>>
template<typename M1 , typename WL1 , class Sig1 , class MLk1 >
bool __fastcall FORCE_INLINE jmmcg::LIBJMMCG_VER_NAMESPACE::ppd::safe_colln< C, M, WL, Sig, MLk >::operator== ( safe_colln< C, M1, WL1, Sig1, MLk1 > const &  ) const
noexcept

◆ operator==() [3/3]

template<typename C , typename M , typename WL = typename M::write_lock_type, class Sig = no_signalling<M>, class MLk = typename lock::any_order::all<M::lock_traits::api_type, typename M::lock_traits::model_type, M, M>>
template<typename M1 , typename WL1 , class Sig1 , class MLk1 >
bool jmmcg::LIBJMMCG_VER_NAMESPACE::ppd::safe_colln< C, M, WL, Sig, MLk >::operator== ( safe_colln< C, M1, WL1, Sig1, MLk1 > const &  sc) const
inlinenoexcept

Definition at line 235 of file thread_safe_adaptors_impl.hpp.

◆ operator[]()

template<typename C , typename M , typename WL , class Sig , class MLk >
ppd::safe_colln< C, M, WL, Sig, MLk >::value_type jmmcg::LIBJMMCG_VER_NAMESPACE::ppd::safe_colln< C, M, WL, Sig, MLk >::operator[] ( size_type  s) const
inlinenoexcept

Definition at line 163 of file thread_safe_adaptors_impl.hpp.

◆ pop_lock() [1/2]

template<typename C , typename M , typename WL = typename M::write_lock_type, class Sig = no_signalling<M>, class MLk = typename lock::any_order::all<M::lock_traits::api_type, typename M::lock_traits::model_type, M, M>>
atomic_t& __fastcall jmmcg::LIBJMMCG_VER_NAMESPACE::ppd::safe_colln< C, M, WL, Sig, MLk >::pop_lock ( ) const
inlinenoexcept

A flag to atomically signal if the container contains work or not, how much work and the underlying lock, to assist in writing thread-safe code.

Definition at line 244 of file thread_safe_adaptors.hpp.

References jmmcg::LIBJMMCG_VER_NAMESPACE::ppd::safe_colln< C, M, WL, Sig, MLk >::have_work.

◆ pop_lock() [2/2]

template<typename C , typename M , typename WL = typename M::write_lock_type, class Sig = no_signalling<M>, class MLk = typename lock::any_order::all<M::lock_traits::api_type, typename M::lock_traits::model_type, M, M>>
atomic_t& __fastcall jmmcg::LIBJMMCG_VER_NAMESPACE::ppd::safe_colln< C, M, WL, Sig, MLk >::pop_lock ( )
inlinenoexcept

A flag to atomically signal if the container contains work or not, how much work and the underlying lock, to assist in writing thread-safe code.

Definition at line 240 of file thread_safe_adaptors.hpp.

References jmmcg::LIBJMMCG_VER_NAMESPACE::ppd::safe_colln< C, M, WL, Sig, MLk >::have_work.

◆ push_back() [1/2]

template<typename C , typename M , typename WL , class Sig , class MLk >
void jmmcg::LIBJMMCG_VER_NAMESPACE::ppd::safe_colln< C, M, WL, Sig, MLk >::push_back ( value_type &&  v)
inlinenoexcept

◆ push_back() [2/2]

template<typename C , typename M , typename WL , class Sig , class MLk >
void jmmcg::LIBJMMCG_VER_NAMESPACE::ppd::safe_colln< C, M, WL, Sig, MLk >::push_back ( value_type const &  v)
inlinenoexcept

◆ push_front() [1/2]

template<typename C , typename M , typename WL , class Sig , class MLk >
void jmmcg::LIBJMMCG_VER_NAMESPACE::ppd::safe_colln< C, M, WL, Sig, MLk >::push_front ( const value_type v)
inlinenoexcept

◆ push_front() [2/2]

template<typename C , typename M , typename WL , class Sig , class MLk >
void jmmcg::LIBJMMCG_VER_NAMESPACE::ppd::safe_colln< C, M, WL, Sig, MLk >::push_front ( value_type &&  v)
inlinenoexcept

◆ push_lock() [1/2]

template<typename C , typename M , typename WL = typename M::write_lock_type, class Sig = no_signalling<M>, class MLk = typename lock::any_order::all<M::lock_traits::api_type, typename M::lock_traits::model_type, M, M>>
atomic_t& __fastcall jmmcg::LIBJMMCG_VER_NAMESPACE::ppd::safe_colln< C, M, WL, Sig, MLk >::push_lock ( ) const
inlinenoexcept

A flag to atomically signal if the container contains work or not, and how much work and the underlying lock, to assist in writing thread-safe code.

Definition at line 252 of file thread_safe_adaptors.hpp.

References jmmcg::LIBJMMCG_VER_NAMESPACE::ppd::safe_colln< C, M, WL, Sig, MLk >::have_work.

◆ push_lock() [2/2]

template<typename C , typename M , typename WL = typename M::write_lock_type, class Sig = no_signalling<M>, class MLk = typename lock::any_order::all<M::lock_traits::api_type, typename M::lock_traits::model_type, M, M>>
atomic_t& __fastcall jmmcg::LIBJMMCG_VER_NAMESPACE::ppd::safe_colln< C, M, WL, Sig, MLk >::push_lock ( )
inlinenoexcept

A flag to atomically signal if the container contains work or not, how much work and the underlying lock, to assist in writing thread-safe code.

Definition at line 248 of file thread_safe_adaptors.hpp.

References jmmcg::LIBJMMCG_VER_NAMESPACE::ppd::safe_colln< C, M, WL, Sig, MLk >::have_work.

◆ reserve()

template<typename C , typename M , typename WL , class Sig , class MLk >
void jmmcg::LIBJMMCG_VER_NAMESPACE::ppd::safe_colln< C, M, WL, Sig, MLk >::reserve ( size_type  sz)
inlinenoexcept

Definition at line 211 of file thread_safe_adaptors_impl.hpp.

◆ resize()

template<typename C , typename M , typename WL , class Sig , class MLk >
void jmmcg::LIBJMMCG_VER_NAMESPACE::ppd::safe_colln< C, M, WL, Sig, MLk >::resize ( const size_type  sz)
inlinenoexcept

Resize the container to the requested size.

See also
resize_noinit_nolk(), resize(), reserve()

Definition at line 256 of file thread_safe_adaptors_impl.hpp.

◆ resize_noinit_nolk()

template<typename C , typename M , typename WL , class Sig , class MLk >
void jmmcg::LIBJMMCG_VER_NAMESPACE::ppd::safe_colln< C, M, WL, Sig, MLk >::resize_noinit_nolk ( const size_type  sz)
inlinenoexcept

Resize the container to the requested size, but try to minimise (re-)initialising or deleting any of the existing elements.

Current C++03 & C++11 containers have an implicit sequential order of initialisation or re-initialisation of the elements they contain. This enforces a O(n) complexity on resize(). To minimise this (re-)initialisation of existing elements, only initialise new elements added to the container, or delete the excess.

Todo:
Ideally I want to have an "uninitialized resize()" (reserve() does not set the size), so that I can initialise the elements of the container in the order I wish, using a parallel fill_n() for example.
See also
resize(), reserve()

Definition at line 242 of file thread_safe_adaptors_impl.hpp.

References jmmcg::LIBJMMCG_VER_NAMESPACE::ppd::safe_colln< C, M, WL, Sig, MLk >::have_work.

◆ size()

template<typename C , typename M , typename WL , class Sig , class MLk >
ppd::safe_colln< C, M, WL, Sig, MLk >::size_type jmmcg::LIBJMMCG_VER_NAMESPACE::ppd::safe_colln< C, M, WL, Sig, MLk >::size ( void  ) const
inlinenoexcept

Definition at line 156 of file thread_safe_adaptors_impl.hpp.

◆ swap()

template<typename C , typename M , typename WL , class Sig , class MLk >
void jmmcg::LIBJMMCG_VER_NAMESPACE::ppd::safe_colln< C, M, WL, Sig, MLk >::swap ( safe_colln< C, M, WL, Sig, MLk > &  t)
inlinenoexcept

Definition at line 268 of file thread_safe_adaptors_impl.hpp.

◆ sync_size()

template<typename C , typename M , typename WL , class Sig , class MLk >
ppd::safe_colln< C, M, WL, Sig, MLk >::size_type jmmcg::LIBJMMCG_VER_NAMESPACE::ppd::safe_colln< C, M, WL, Sig, MLk >::sync_size
inlinenoexcept

Member Data Documentation

◆ have_work

◆ memory_access_mode

template<typename C , typename M , typename WL = typename M::write_lock_type, class Sig = no_signalling<M>, class MLk = typename lock::any_order::all<M::lock_traits::api_type, typename M::lock_traits::model_type, M, M>>
constexpr generic_traits::memory_access_modes jmmcg::LIBJMMCG_VER_NAMESPACE::ppd::safe_colln< C, M, WL, Sig, MLk >::memory_access_mode
staticconstexpr
Initial value:

To assist in allowing compile-time computation of the algorithmic order of the threading model.

Definition at line 224 of file thread_safe_adaptors.hpp.


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