Dataflow Runtime API  3.0.3.0
Public Member Functions | List of all members
imt::base::os::embos::Mailbox< MessageType, MailboxSize > Class Template Reference

A Mailbox that can be used in an embOS task to receive fixed size messages. More...

#include <Imt.Base.OS.EmbOS/Mailbox.h>

Public Member Functions

 Mailbox (void *const pHandle)
 Constructor. More...
 
virtual ~Mailbox (void)
 Destructor. More...
 
void initialize (void)
 Init the mailbox. More...
 
void deinitialize (void)
 Deletes the mailbox. More...
 
void clear (void)
 Removes all messages from the mailbox. More...
 
MessageType getMail (void)
 Gets the next message from the mailbox. More...
 
bool getMailConditional (MessageType *const pMail)
 Gets the next message from the mailbox. More...
 
void putMail (const MessageType message)
 Adds a message to the mailbox. More...
 
bool putMailConditional (const MessageType message)
 Adds a message to the mailbox. More...
 
void waitMail (void)
 This method returns imediately when the mailbox contains at least one message. More...
 

Detailed Description

template<typename MessageType, const size_t MailboxSize>
class imt::base::os::embos::Mailbox< MessageType, MailboxSize >

A Mailbox that can be used in an embOS task to receive fixed size messages.

See User and Reference Guide for embOS - Chapter 7 for more informations on mailboxes.

This template is used to create a mailbox of the required size in the context of the task.

Constructor & Destructor Documentation

◆ Mailbox()

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

Constructor.

Parameters
pHandleThe OS handle for the mailbox.

◆ ~Mailbox()

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

Destructor.

Member Function Documentation

◆ clear()

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

Removes all messages from the mailbox.

◆ deinitialize()

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

Deletes the mailbox.

◆ getMail()

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

Gets the next message from the mailbox.

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

Returns
The received message.

◆ getMailConditional()

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

Gets the next message from the mailbox.

This removes the message from the mailbox. If the mailbox 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.

◆ initialize()

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

Init the mailbox.

Must be called before using any other method.

◆ putMail()

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

Adds a message to the mailbox.

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

Parameters
messageThe message to put into the mailbox

◆ putMailConditional()

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

Adds a message to the mailbox.

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

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

◆ waitMail()

template<typename MessageType , const size_t MailboxSize>
void imt::base::os::embos::Mailbox< MessageType, MailboxSize >::waitMail ( void  )
inline

This method returns imediately when the mailbox contains at least one message.

If the mailbox is empty this method will suspend the calling task until a message is avaliable. This will not remove the message from the mailbox.


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