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

This class is used to write items to the queue. More...

#include "thread_queue.h"

Public Types

using item_type = T
 

Public Member Functions

 Item (const Writer &writer)
 Construct a Writer::Item object. More...
 
 ~Item ()
 Unregister the parent Writer from the queue. More...
 
bool write ()
 Push the item onto the queue. More...
 
T & operator* () const throw ()
 
T * operator-> () const throw ()
 

Detailed Description

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

This class is used to write items to the queue.

Items cannot be written directly onto a Thread::Queue queue. An object of this class must be instantiated and used to write to 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 395 of file thread_queue.h.

Member Typedef Documentation

◆ item_type

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

Definition at line 411 of file thread_queue.h.

Constructor & Destructor Documentation

◆ Item()

template<class T >
MR::Thread::Queue< T >::Writer::Item::Item ( const Writer writer)
inline

Construct a Writer::Item object.

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

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

Definition at line 405 of file thread_queue.h.

◆ ~Item()

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

Unregister the parent Writer from the queue.

Definition at line 407 of file thread_queue.h.

Member Function Documentation

◆ operator*()

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

Definition at line 417 of file thread_queue.h.

◆ operator->()

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

Definition at line 420 of file thread_queue.h.

◆ write()

template<class T >
bool MR::Thread::Queue< T >::Writer::Item::write ( )
inline

Push the item onto the queue.

Definition at line 414 of file thread_queue.h.


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