Telamon
Classes | Public Types | Public Member Functions | List of all members
helpqueue::HelpQueue< T, N > Class Template Reference

This is the main class representing the help queue. More...

#include <HelpQueue.hh>

Classes

struct  Node
 The class which represents a node element of the queue. More...
 
struct  OperationDescription
 Operation description for the queue used when the queue itself needs "helping". More...
 

Public Types

enum class  Operation : int { enqueue }
 

Public Member Functions

void push_back (const int enqueuer, T element)
 Enqueue an element to the tail of the queue. More...
 
std::optional< T > peek_front () const
 Peek the head of the queue. More...
 
bool try_pop_front (T expected_head)
 Dequeues iff the given value is the same as the value at the head of the queue. More...
 

Detailed Description

template<typename T, const int N = 16>
class helpqueue::HelpQueue< T, N >

This is the main class representing the help queue.

Member Function Documentation

◆ peek_front()

template<typename T , const int N = 16>
std::optional<T> helpqueue::HelpQueue< T, N >::peek_front ( ) const
inline

Peek the head of the queue.

Returns
The value of the head if one is present and empty if not

◆ push_back()

template<typename T , const int N = 16>
void helpqueue::HelpQueue< T, N >::push_back ( const int  enqueuer,
element 
)
inline

Enqueue an element to the tail of the queue.

Parameters
elementThe element to be enqueued
enqueuerThe id of the thread which enqueues the element

◆ try_pop_front()

template<typename T , const int N = 16>
bool helpqueue::HelpQueue< T, N >::try_pop_front ( expected_head)
inline

Dequeues iff the given value is the same as the value at the head of the queue.

Parameters
expected_headThe value which the head is expected to be
Returns
Whether the dequeue succeeded or not

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