cisst-saw
Loading...
Searching...
No Matches
mtsMailBox Class Reference

#include <mtsMailBox.h>

Public Member Functions

 mtsMailBox (const std::string &name, size_t size, mtsCallableVoidBase *postCommandQueuedCallable=0)
 ~mtsMailBox (void)
const std::string & GetName (void) const
bool Write (mtsCommandBase *command)
bool ExecuteNext (void)
void SetSize (size_t size)
bool IsEmpty (void) const
bool IsFull (void) const
size_t GetAvailable (void) const
void SetPostCommandDequeuedCommand (mtsCommandVoid *command)
mtsCommandVoidGetPostCommandDequeuedCommand (void) const
void SetPostCommandReturnDequeuedCommand (mtsCommandVoid *command)
mtsCommandVoidGetPostCommandReturnDequeuedCommand (void) const

Constructor & Destructor Documentation

◆ mtsMailBox()

mtsMailBox::mtsMailBox ( const std::string & name,
size_t size,
mtsCallableVoidBase * postCommandQueuedCallable = 0 )

◆ ~mtsMailBox()

mtsMailBox::~mtsMailBox ( void )

Member Function Documentation

◆ ExecuteNext()

bool mtsMailBox::ExecuteNext ( void )

Execute the oldest command queued.

◆ GetAvailable()

size_t mtsMailBox::GetAvailable ( void ) const

Returns number of elements available in mailbox, i.e. the number of slots used.

◆ GetName()

const std::string & mtsMailBox::GetName ( void ) const

Get the mailbox's name

◆ GetPostCommandDequeuedCommand()

mtsCommandVoid * mtsMailBox::GetPostCommandDequeuedCommand ( void ) const

◆ GetPostCommandReturnDequeuedCommand()

mtsCommandVoid * mtsMailBox::GetPostCommandReturnDequeuedCommand ( void ) const

◆ IsEmpty()

bool mtsMailBox::IsEmpty ( void ) const

Returns true if mailbox is empty.

◆ IsFull()

bool mtsMailBox::IsFull ( void ) const

Returns true if mailbox is full.

◆ SetPostCommandDequeuedCommand()

void mtsMailBox::SetPostCommandDequeuedCommand ( mtsCommandVoid * command)

Set the command to be called after a blocking command is de-queued and executed. This can be used to call a trigger for event. The event handler on the client site can then raise a thread signal.

◆ SetPostCommandReturnDequeuedCommand()

void mtsMailBox::SetPostCommandReturnDequeuedCommand ( mtsCommandVoid * command)

Set the command to be called after a blocking command with return value is de-queued and executed. This can be used to call a trigger for event. The event handler on the client site can then raise a thread signal.

◆ SetSize()

void mtsMailBox::SetSize ( size_t size)

Resize the mailbox, i.e. resizes the underlying queue of commands. This command is not thread safe and shouldn't be used if commands are already queued or can be queued. The SetSize methods deletes whatever command has been queued.

◆ Write()

bool mtsMailBox::Write ( mtsCommandBase * command)

Write a command to the mailbox. If a post command queued command has been provided, the command is executed.


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