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

#include <q-consumer-threads.H>

Inheritance diagram for QueueTheadsPool< T >::ConsumerQueueEvent:
[legend]
Collaboration diagram for QueueTheadsPool< T >::ConsumerQueueEvent:
[legend]

Public Member Functions

virtual void run ()=0
 this is a item extracted from the queue
 
size_t get_count () const noexcept
 
void increment_count () noexcept
 
virtual ~ConsumerQueueEvent ()
 

Public Attributes

T item
 

Protected Attributes

std::atomic< size_t > count = 0
 

Private Types

enum class  Status { Ready , Executing }
 

Private Attributes

Status status = Status::Ready
 

Friends

class QueueTheadsPool
 

Detailed Description

template<typename T>
class QueueTheadsPool< T >::ConsumerQueueEvent

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

Member Enumeration Documentation

◆ Status

Enumerator
Ready 
Executing 

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

Constructor & Destructor Documentation

◆ ~ConsumerQueueEvent()

template<typename T >
virtual QueueTheadsPool< T >::ConsumerQueueEvent::~ConsumerQueueEvent ( )
inlinevirtual

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

Member Function Documentation

◆ get_count()

template<typename T >
size_t QueueTheadsPool< T >::ConsumerQueueEvent::get_count ( ) const
inlinenoexcept

◆ increment_count()

template<typename T >
void QueueTheadsPool< T >::ConsumerQueueEvent::increment_count ( )
inlinenoexcept

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

References QueueTheadsPool< T >::ConsumerQueueEvent::count.

Referenced by Event1::run(), and Event2::run().

◆ run()

template<typename T >
virtual void QueueTheadsPool< T >::ConsumerQueueEvent::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

Implemented in Event1, and Event2.

Friends And Related Symbol Documentation

◆ QueueTheadsPool

template<typename T >
friend class QueueTheadsPool
friend

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

Member Data Documentation

◆ count

template<typename T >
std::atomic<size_t> QueueTheadsPool< T >::ConsumerQueueEvent::count = 0
protected

◆ item

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

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

◆ status

template<typename T >
Status QueueTheadsPool< T >::ConsumerQueueEvent::status = Status::Ready
private

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


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