SEDNL  .
Simple Event Driven Network Library
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
Public Member Functions | List of all members
SedNL::SafeQueue< T, Container > Class Template Reference

A std::queue like protected with a mutex. More...

#include <ThreadHelp.hpp>

Public Member Functions

bool empty () const noexcept
 Checks whether the underlying container is empty. More...
 
Container::size_type size () const noexcept
 Return the size of the underlying container. More...
 
bool push (const T &value) noexcept
 Push elements to the back of the queue. More...
 
bool pop (T &value) noexcept
 Remove the first element and store it into value. More...
 

Detailed Description

template<class T, class Container>
class SedNL::SafeQueue< T, Container >

A std::queue like protected with a mutex.

Definition at line 49 of file sednlfwd.hpp.

Member Function Documentation

template<class T , class C >
bool SedNL::SafeQueue< T, C >::empty ( ) const
inlinenoexcept

Checks whether the underlying container is empty.

Returns
True if empty, False otherwise.

Definition at line 52 of file ThreadHelp.ipp.

template<class T, class C >
bool SedNL::SafeQueue< T, C >::pop ( T &  value)
inlinenoexcept

Remove the first element and store it into value.

If the queue is empty, return false and do not modify value.

Parameters
[in]valueWhere to store the data read.
Returns
True if it succeed, False if it failed.

Definition at line 92 of file ThreadHelp.ipp.

template<class T, class C >
bool SedNL::SafeQueue< T, C >::push ( const T &  value)
inlinenoexcept

Push elements to the back of the queue.

Parameters
[in]valueThe value to push.
Returns
True if it succeed, False if it failed.

Definition at line 117 of file ThreadHelp.ipp.

template<class T , class C >
C::size_type SedNL::SafeQueue< T, C >::size ( ) const
inlinenoexcept

Return the size of the underlying container.

Returns
Number of elements stored.

Definition at line 72 of file ThreadHelp.ipp.


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