Developer documentation
Version 3.0.3-105-gd3941f44
MR::Thread::Queue< T >::Reader::Item Class Reference

This class is used to read items from the queue. More...

#include "thread_queue.h"

Public Types

using item_type = T
 

Public Member Functions

 Item (const Reader &reader)
 Construct a Reader::Item object. More...
 
 ~Item ()
 Unregister the parent Reader from the queue. More...
 
bool read ()
 Get next item from the queue. More...
 
T * stash () throw ()
 
void recycle (T *item) const throw ()
 
T & operator* () const throw ()
 
T * operator-> () const throw ()
 
bool operator! () const throw ()
 

Detailed Description

template<class T>
class MR::Thread::Queue< T >::Reader::Item

This class is used to read items from the queue.

Items cannot be read directly from a Thread::Queue queue. An object of this class must be instanciated and used to read from the queue.

See also
Thread::Queue for more detailed information and examples.
Thread::run_queue() for a much more user-friendly way of setting up a queue.

Definition at line 465 of file thread_queue.h.

Member Typedef Documentation

◆ item_type

template<class T >
using MR::Thread::Queue< T >::Reader::Item::item_type = T

Definition at line 481 of file thread_queue.h.

Constructor & Destructor Documentation

◆ Item()

template<class T >
MR::Thread::Queue< T >::Reader::Item::Item ( const Reader reader)
inline

Construct a Reader::Item object.

The Reader::Item object can only be instantiated from a Reader object, ensuring that the corresponding section of code has already registered as a reader with the queue. The destructor for this object will unregister from the queue.

Note
There should only be one Reader::Item object per Reader.

Definition at line 475 of file thread_queue.h.

◆ ~Item()

template<class T >
MR::Thread::Queue< T >::Reader::Item::~Item ( )
inline

Unregister the parent Reader from the queue.

Definition at line 477 of file thread_queue.h.

Member Function Documentation

◆ operator!()

template<class T >
bool MR::Thread::Queue< T >::Reader::Item::operator! ( ) const
throw (
)
inline

Definition at line 501 of file thread_queue.h.

◆ operator*()

template<class T >
T & MR::Thread::Queue< T >::Reader::Item::operator* ( ) const
throw (
)
inline

Definition at line 495 of file thread_queue.h.

◆ operator->()

template<class T >
T * MR::Thread::Queue< T >::Reader::Item::operator-> ( ) const
throw (
)
inline

Definition at line 498 of file thread_queue.h.

◆ read()

template<class T >
bool MR::Thread::Queue< T >::Reader::Item::read ( )
inline

Get next item from the queue.

Definition at line 484 of file thread_queue.h.

◆ recycle()

template<class T >
void MR::Thread::Queue< T >::Reader::Item::recycle ( T *  item) const
throw (
)
inline

Definition at line 492 of file thread_queue.h.

◆ stash()

template<class T >
T * MR::Thread::Queue< T >::Reader::Item::stash ( )
throw (
)
inline

Definition at line 487 of file thread_queue.h.


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