mn::queue::basic_binaryqueue Class Reference

Binary queue with overwrite. This queue can only hold one item. If sucessive Enqueue operations are called, that item is overwritten with whatever the last item was. More...

#include <mn_binaryqueue.hpp>

+ Inheritance diagram for mn::queue::basic_binaryqueue:
+ Collaboration diagram for mn::queue::basic_binaryqueue:

Public Member Functions

 basic_binaryqueue (unsigned int itemSize)
 Construct a new basic binaryqueue object. More...
 
virtual int enqueue (void *item, unsigned int timeout=-1)
 
- Public Member Functions inherited from mn::queue::basic_queue
 basic_queue (unsigned int maxItems, unsigned int itemSize)
 
virtual ~basic_queue ()
 
virtual int create ()
 
virtual int destroy ()
 
virtual int peek (void *item, unsigned int timeout=MN_THREAD_CONFIG_TIMEOUT_QUEUE_DEFAULT)
 
virtual int dequeue (void *item, unsigned int timeout=MN_THREAD_CONFIG_TIMEOUT_QUEUE_DEFAULT)
 
virtual bool is_empty ()
 
virtual bool is_full ()
 
virtual int clear ()
 
virtual unsigned int get_num_items ()
 
virtual unsigned int get_left ()
 
void * get_handle ()
 

Additional Inherited Members

- Protected Attributes inherited from mn::queue::basic_queue
void * m_pHandle
 
unsigned int m_imaxItems
 
unsigned int m_iitemSize
 

Detailed Description

Binary queue with overwrite. This queue can only hold one item. If sucessive Enqueue operations are called, that item is overwritten with whatever the last item was.

Constructor & Destructor Documentation

◆ basic_binaryqueue()

mn::queue::basic_binaryqueue::basic_binaryqueue ( unsigned int  itemSize)
inlineexplicit

Construct a new basic binaryqueue object.

Parameters
itemSizeSize of an item in a queue.

Member Function Documentation

◆ enqueue()

int mn::queue::basic_binaryqueue::enqueue ( void *  item,
unsigned int  timeout = -1 
)
virtual

Add an item to the queue.

Parameters
itemThe item you are adding.
timeoutnot use
Returns
  • ERR_QUEUE_OK The item in the queue overwrited
  • ERR_QUEUE_NOTCREATED The queue was not created, please call the function create first

Reimplemented from mn::queue::basic_queue.


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