MySQL 8.0.39
Source Code Documentation
Synchronized_queue_interface< T > Class Template Referenceabstract

Interface that defines a queue protected against multi thread access. More...

#include <plugin_utils.h>

Inheritance diagram for Synchronized_queue_interface< T >:
[legend]

Public Member Functions

virtual ~Synchronized_queue_interface ()=default
 
virtual bool empty ()=0
 Checks if the queue is empty. More...
 
virtual bool push (const T &value)=0
 Inserts an element in the queue. More...
 
virtual bool pop (T *out)=0
 Fetches the front of the queue and removes it. More...
 
virtual bool pop ()=0
 Pops the front of the queue removing it. More...
 
virtual bool front (T *out)=0
 Fetches the front of the queue but does not remove it. More...
 
virtual size_t size ()=0
 Checks the queue size. More...
 

Detailed Description

template<typename T>
class Synchronized_queue_interface< T >

Interface that defines a queue protected against multi thread access.

Constructor & Destructor Documentation

◆ ~Synchronized_queue_interface()

template<typename T >
virtual Synchronized_queue_interface< T >::~Synchronized_queue_interface ( )
virtualdefault

Member Function Documentation

◆ empty()

template<typename T >
virtual bool Synchronized_queue_interface< T >::empty ( )
pure virtual

Checks if the queue is empty.

Returns
if is empty
Return values
trueempty
falsenot empty

Implemented in Synchronized_queue< T >.

◆ front()

template<typename T >
virtual bool Synchronized_queue_interface< T >::front ( T *  out)
pure virtual

Fetches the front of the queue but does not remove it.

Note
The method will block if the queue is empty until a element is pushed
Parameters
outThe fetched reference.
Returns
false, operation always succeeded

Implemented in Synchronized_queue< T >, and Abortable_synchronized_queue< T >.

◆ pop() [1/2]

template<typename T >
virtual bool Synchronized_queue_interface< T >::pop ( )
pure virtual

Pops the front of the queue removing it.

Note
The method will block if the queue is empty until a element is pushed
Returns
true if method was aborted, false otherwise

Implemented in Synchronized_queue< T >, and Abortable_synchronized_queue< T >.

◆ pop() [2/2]

template<typename T >
virtual bool Synchronized_queue_interface< T >::pop ( T *  out)
pure virtual

Fetches the front of the queue and removes it.

Note
The method will block if the queue is empty until a element is pushed
Parameters
outThe fetched reference.
Returns
false, operation always succeeded

Implemented in Synchronized_queue< T >, and Abortable_synchronized_queue< T >.

◆ push()

template<typename T >
virtual bool Synchronized_queue_interface< T >::push ( const T &  value)
pure virtual

Inserts an element in the queue.

Alerts any other thread lock on pop() or front()

Parameters
valueThe value to insert
Returns
false, operation always succeeded

Implemented in Synchronized_queue< T >, and Abortable_synchronized_queue< T >.

◆ size()

template<typename T >
virtual size_t Synchronized_queue_interface< T >::size ( )
pure virtual

Checks the queue size.

Returns
the size of the queue

Implemented in Synchronized_queue< T >.


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