Dataflow Runtime API  3.1.1.0
Public Member Functions | List of all members
imt::base::os::zephyr::Queue< MessageType, QueueSize > Class Template Reference

A Queue that can be used in an zephyr thread to receive fixed size messages. More...

#include <Imt.Base.OS.Zephyr/Queue.h>

Public Member Functions

 Queue (void *const pHandle)
 Constructor. More...
 
virtual ~Queue (void)
 Destructor. More...
 
void initialize (void)
 Init the queue. More...
 
void deinitialize (void)
 Deletes the queue. More...
 
void clear (void)
 Removes all messages from the queue. More...
 
MessageType getMail (void)
 Gets the next message from the queue. More...
 
bool getMailConditional (MessageType *const pMail)
 Gets the next message from the queue. More...
 
void putMail (const MessageType message)
 Adds a message to the queue. More...
 
bool putMailConditional (const MessageType message)
 Adds a message to the queue. More...
 
uint32_t getWaitingMails ()
 Gets the number of mails in this queue. More...
 

Detailed Description

template<typename MessageType, const size_t QueueSize>
class imt::base::os::zephyr::Queue< MessageType, QueueSize >

A Queue that can be used in an zephyr thread to receive fixed size messages.

This template is used to create a queue of the required size in the context of the thread.

Constructor & Destructor Documentation

◆ Queue()

template<typename MessageType , const size_t MailboxSize>
imt::base::os::zephyr::Queue< MessageType, MailboxSize >::Queue ( void *const  pHandle)

Constructor.

Parameters
pHandleThe OS handle for the queue.

◆ ~Queue()

template<typename MessageType , const size_t MailboxSize>
imt::base::os::zephyr::Queue< MessageType, MailboxSize >::~Queue ( void  )
virtual

Destructor.

Member Function Documentation

◆ clear()

template<typename MessageType , const size_t MailboxSize>
void imt::base::os::zephyr::Queue< MessageType, MailboxSize >::clear ( void  )
inline

Removes all messages from the queue.

◆ deinitialize()

template<typename MessageType , const size_t MailboxSize>
void imt::base::os::zephyr::Queue< MessageType, MailboxSize >::deinitialize ( void  )
inline

Deletes the queue.

◆ getMail()

template<typename MessageType , const size_t MailboxSize>
MessageType imt::base::os::zephyr::Queue< MessageType, MailboxSize >::getMail ( void  )
inline

Gets the next message from the queue.

This removes the message from the queue. If the queue is empty the task will be suspended until the queue contains a message.

Returns
The received message.

◆ getMailConditional()

template<typename MessageType , const size_t MailboxSize>
bool imt::base::os::zephyr::Queue< MessageType, MailboxSize >::getMailConditional ( MessageType *const  pMail)
inline

Gets the next message from the queue.

This removes the message from the queue. If the queue is empty the method will return false but not suspend the task.

Parameters
pMailThe return message.
Returns
False if there is no message, true if there is one.

◆ getWaitingMails()

template<typename MessageType , const size_t MailboxSize>
uint32_t imt::base::os::zephyr::Queue< MessageType, MailboxSize >::getWaitingMails
inline

Gets the number of mails in this queue.

Returns
The number of mails in the queue

◆ initialize()

template<typename MessageType , const size_t MailboxSize>
void imt::base::os::zephyr::Queue< MessageType, MailboxSize >::initialize ( void  )
inline

Init the queue.

Must be called before using any other method.

◆ putMail()

template<typename MessageType , const size_t MailboxSize>
void imt::base::os::zephyr::Queue< MessageType, MailboxSize >::putMail ( const MessageType  message)
inline

Adds a message to the queue.

This can be used from any task. If the queue is full the task will be suspended until the queue can hold the new message. The data is copied.

Parameters
messageThe message to put into the queue

◆ putMailConditional()

template<typename MessageType , const size_t MailboxSize>
bool imt::base::os::zephyr::Queue< MessageType, MailboxSize >::putMailConditional ( const MessageType  message)
inline

Adds a message to the queue.

This can be used from any task or interrupt handler. If the queue is full the mthod returns false but task will not be suspended. The data is copied.

Parameters
messageThe message to put into the queue.
Returns
False if there is no space left for the message, true otherwise.

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