Sen API
Sen Libraries
Loading...
Searching...
No Matches
sen::util::LockedRangeAdapter< LockType, IteratorType, MutexType > Class Template Reference

A range adapter to combine a range with lock. More...

#include <iterator_adapters.h>

Public Member Functions

template<typename ContainerType>
 LockedRangeAdapter (ContainerType &container, MutexType &m)
 LockedRangeAdapter (IteratorType begin, IteratorType end, MutexType &m)
IteratorType begin () const noexcept(std::is_nothrow_copy_constructible_v< IteratorType >)
IteratorType end () const noexcept(std::is_nothrow_copy_constructible_v< IteratorType >)

Detailed Description

template<template< typename > typename LockType, typename IteratorType, typename MutexType>
class sen::util::LockedRangeAdapter< LockType, IteratorType, MutexType >

A range adapter to combine a range with lock.

This adapter ties together a lock of the specified LockType with the given range (i.e., the begin/end iterator pair). This way, the adapter ensures that the lock is held during iteration.

The lock is taken during construction and release during destructions of this adapter.

Constructor & Destructor Documentation

◆ LockedRangeAdapter() [1/2]

template<template< typename > typename LockType, typename IteratorType, typename MutexType>
template<typename ContainerType>
sen::util::LockedRangeAdapter< LockType, IteratorType, MutexType >::LockedRangeAdapter ( ContainerType & container,
MutexType & m )
inline

◆ LockedRangeAdapter() [2/2]

template<template< typename > typename LockType, typename IteratorType, typename MutexType>
sen::util::LockedRangeAdapter< LockType, IteratorType, MutexType >::LockedRangeAdapter ( IteratorType begin,
IteratorType end,
MutexType & m )
inline

Member Function Documentation

◆ begin()

template<template< typename > typename LockType, typename IteratorType, typename MutexType>
IteratorType sen::util::LockedRangeAdapter< LockType, IteratorType, MutexType >::begin ( ) const
inlinenoexcept

◆ end()

template<template< typename > typename LockType, typename IteratorType, typename MutexType>
IteratorType sen::util::LockedRangeAdapter< LockType, IteratorType, MutexType >::end ( ) const
inlinenoexcept

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