Ensō 0.4.6
Software API reference
Loading...
Searching...
No Matches
enso::QueueConsumer< T > Class Template Reference
Inheritance diagram for enso::QueueConsumer< T >:
enso::Queue< T, QueueConsumer< T > >

Public Member Functions

T * Front ()
 Returns the data at the front of the queue without popping it.
 
std::optional< T > Pop ()
 Pops data from the queue.
 
- Public Member Functions inherited from enso::Queue< T, QueueConsumer< T > >
 Queue (Queue &&other)=default
 
Queueoperator= (Queue &&other)=default
 
Element * buf_addr () const noexcept
 Returns the address of the internal buffer.
 
size_t size () const noexcept
 Returns the size of the internal buffer.
 
uint32_t capacity () const noexcept
 Returns the capacity of the queue.
 

Protected Member Functions

 QueueConsumer (const std::string &queue_name, size_t size, const std::string &huge_page_prefix) noexcept
 
int Init (bool join_if_exists) noexcept
 Initializes the Queue object.
 
- Protected Member Functions inherited from enso::Queue< T, QueueConsumer< T > >
 Queue (const std::string &queue_name, size_t size, const std::string &huge_page_prefix) noexcept
 
int Init (bool join_if_exists) noexcept
 Initializes the Queue object.
 
bool created_queue () const noexcept
 
uint32_t index_mask () const noexcept
 

Additional Inherited Members

- Static Public Member Functions inherited from enso::Queue< T, QueueConsumer< T > >
static std::unique_ptr< QueueConsumer< T > > Create (const std::string &queue_name, size_t size=0, bool join_if_exists=true, std::string huge_page_prefix="") noexcept
 Factory method to create a Queue object.
 
- Static Public Attributes inherited from enso::Queue< T, QueueConsumer< T > >
static constexpr size_t kElementMetaSize
 
static constexpr size_t kElementPadding
 

Detailed Description

template<typename T>
class enso::QueueConsumer< T >

Definition at line 375 of file queue.h.

Constructor & Destructor Documentation

◆ ~QueueConsumer()

template<typename T >
enso::QueueConsumer< T >::~QueueConsumer ( )
inlinenoexcept

Definition at line 377 of file queue.h.

◆ QueueConsumer()

template<typename T >
enso::QueueConsumer< T >::QueueConsumer ( const std::string &  queue_name,
size_t  size,
const std::string &  huge_page_prefix 
)
inlineexplicitprotectednoexcept

Definition at line 413 of file queue.h.

Member Function Documentation

◆ Front()

template<typename T >
T * enso::QueueConsumer< T >::Front ( )
inline

Returns the data at the front of the queue without popping it.

Returns
the data at the front of the queue on success and nullptr if the queue is empty.

Definition at line 385 of file queue.h.

◆ Init()

template<typename T >
int enso::QueueConsumer< T >::Init ( bool  join_if_exists)
inlineprotectednoexcept

Initializes the Queue object.

Parameters
join_if_existsIf true, the queue will be joined if it already exists. If false, the creation will fail if the queue already exists.
Returns
0 on success and a non-zero error code on failure.

Definition at line 425 of file queue.h.

◆ Pop()

template<typename T >
std::optional< T > enso::QueueConsumer< T >::Pop ( )
inline

Pops data from the queue.

Returns
the data on success and an empty optional if the queue is empty.

Definition at line 398 of file queue.h.


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