HikoGUI
A low latency retained GUI
Loading...
Searching...
No Matches
Public Member Functions
tt::wfree_message_queue< T, Capacity > Class Template Reference

Public Member Functions

 wfree_message_queue (wfree_message_queue const &)=delete
 
 wfree_message_queue (wfree_message_queue &&)=delete
 
wfree_message_queueoperator= (wfree_message_queue const &)=delete
 
wfree_message_queueoperator= (wfree_message_queue &&)=delete
 
index_type size () const noexcept
 
bool empty () const noexcept
 
bool full () const noexcept
 
template<typename BlockCounterTag = void>
scoped_write_operation write () noexcept
 
scoped_read_operation read () noexcept
 
value_type const & operator[] (index_type index) const noexcept
 
value_type & operator[] (index_type index) noexcept
 
template<typename CounterTag = void>
index_type write_start () noexcept
 Start a write into the message queue.
 
void write_finish (index_type index) noexcept
 
template<typename CounterTag = void>
index_type read_start () noexcept
 
void read_finish (index_type index) noexcept
 

Member Function Documentation

◆ read()

template<typename T , size_t Capacity>
scoped_read_operation tt::wfree_message_queue< T, Capacity >::read ( )
inlinenoexcept

Read a message from the queue. This function will block until the message being read is completed by the writing thread.

Returns
A scoped read operation which can be derefenced to access the message value.

◆ read_finish()

template<typename T , size_t Capacity>
void tt::wfree_message_queue< T, Capacity >::read_finish ( index_type index)
inlinenoexcept

Finish a read from the message queue. This function is wait-free.

Parameters
indexThe index given from read_start().

◆ read_start()

template<typename T , size_t Capacity>
template<typename CounterTag = void>
index_type tt::wfree_message_queue< T, Capacity >::read_start ( )
inlinenoexcept

Start a read from the message queue. This function will block until the message being read is completed by the writing thread. Every read_start() must be accompanied by a read_finish().

Returns
The index of the message.

◆ size()

template<typename T , size_t Capacity>
index_type tt::wfree_message_queue< T, Capacity >::size ( ) const
inlinenoexcept

Return the number of items in the message queue. For the consumer this may show less items in the queue then there realy are.

◆ write()

template<typename T , size_t Capacity>
template<typename BlockCounterTag = void>
scoped_write_operation tt::wfree_message_queue< T, Capacity >::write ( )
inlinenoexcept

Write a message into the queue. This function is wait-free when the queue is not full().

Returns
A scoped write operation which can be derefenced to access the message value.

◆ write_finish()

template<typename T , size_t Capacity>
void tt::wfree_message_queue< T, Capacity >::write_finish ( index_type index)
inlinenoexcept

Finish the write of a message. This function is wait-free.

Parameters
indexThe index given from write_start().

◆ write_start()

template<typename T , size_t Capacity>
template<typename CounterTag = void>
index_type tt::wfree_message_queue< T, Capacity >::write_start ( )
inlinenoexcept

Start a write into the message queue.

This function is wait-free when the queue is not full(). Every write_start() must be accompanied by a write_finish().

Parameters
CounterTagcounter to increment when write is contended
Returns
The index of the message.

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