Aleph-w 7.10.0
A C++ Library for Data Structures and Algorithms
Loading...
Searching...
No Matches
ConsumerQueueEvent< T > Class Template Referenceabstract

An event of a queue: what its derived classes do with each item. More...

#include <q-consumer-threads.H>

Collaboration diagram for ConsumerQueueEvent< T >:
[legend]

Public Member Functions

virtual bool run ()=0
 this is a item extracted from the queue
 
virtual ~ConsumerQueueEvent ()=default
 Virtual, so that a derived event is destroyed through this class.
 

Public Attributes

T item
 

Private Types

enum class  Status { Ready , Executing }
 

Private Attributes

std::atomic< Status > status = { Status::Ready }
 

Detailed Description

template<typename T>
class ConsumerQueueEvent< T >

An event of a queue: what its derived classes do with each item.

run() was pure but not virtual, so that the class did not compile; QueueTheadsPool uses its own nested event, QueueTheadsPool::Event.

Deprecated:
It goes in 8.0.0, with QueueTheadsPool.

Definition at line 69 of file q-consumer-threads.H.

Member Enumeration Documentation

◆ Status

template<typename T >
enum class ConsumerQueueEvent::Status
strongprivate
Enumerator
Ready 
Executing 

Definition at line 72 of file q-consumer-threads.H.

Constructor & Destructor Documentation

◆ ~ConsumerQueueEvent()

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

Virtual, so that a derived event is destroyed through this class.

Member Function Documentation

◆ run()

template<typename T >
virtual bool ConsumerQueueEvent< T >::run ( )
pure virtual

this is a item extracted from the queue

Derived classes from this one implement the action that must performed when the item is extracted from the queue.

After event execution this event return a bool. A true return value indicates that the thread can continue consuming others items form the queue. At the contrary, a false return value indicates that the thread must finish

Referenced by TEST().

Member Data Documentation

◆ item

template<typename T >
T ConsumerQueueEvent< T >::item

Definition at line 78 of file q-consumer-threads.H.

◆ status

template<typename T >
std::atomic<Status> ConsumerQueueEvent< T >::status = { Status::Ready }
private

Definition at line 74 of file q-consumer-threads.H.


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