cisst-saw
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions | List of all members
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
 
void SetPostCommandDequeuedCommand (mtsCommandVoid *command)
 
mtsCommandVoidGetPostCommandDequeuedCommand (void) const
 
void SetPostCommandReturnDequeuedCommand (mtsCommandVoid *command)
 
mtsCommandVoidGetPostCommandReturnDequeuedCommand (void) const
 

Constructor & Destructor Documentation

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

Member Function Documentation

bool mtsMailBox::ExecuteNext ( void  )

Execute the oldest command queued.

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

Get the mailbox's name

mtsCommandVoid* mtsMailBox::GetPostCommandDequeuedCommand ( void  ) const
mtsCommandVoid* mtsMailBox::GetPostCommandReturnDequeuedCommand ( void  ) const
bool mtsMailBox::IsEmpty ( void  ) const

Returns true if mailbox is empty.

bool mtsMailBox::IsFull ( void  ) const

Returns true if mailbox is full.

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.

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.

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.

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: