cisst-saw
Loading...
Searching...
No Matches
mtsMailBox.h
Go to the documentation of this file.
1/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2/* ex: set filetype=cpp softtabstop=4 shiftwidth=4 tabstop=4 cindent expandtab: */
3
4/*
5 Author(s): Peter Kazanzides
6 Created on: 2007-09-05
7
8 (C) Copyright 2007-2019 Johns Hopkins University (JHU), All Rights Reserved.
9
10--- begin cisst license - do not edit ---
11
12This software is provided "as is" under an open source license, with
13no warranty. The complete license can be found in license.txt and
14http://www.cisst.org/cisst/license.txt.
15
16--- end cisst license ---
17*/
18
19
24
25#ifndef _mtsMailBox_h
26#define _mtsMailBox_h
27
29
30// Always include last
32
34
36{
37 mtsQueue<mtsCommandBase *> CommandQueue;
38
40 std::string Name;
41
46 mtsCallableVoidBase * PostCommandQueuedCallable;
47
52 mtsCommandVoid * PostCommandDequeuedCommand;
53
58 mtsCommandVoid * PostCommandReturnDequeuedCommand;
59
62 void TriggerFinishedEventIfNeeded(const std::string &commandName, mtsCommandWriteBase *finishedEvent,
63 mtsGenericObject *resultPointer, const mtsExecutionResult &result) const;
64
65public:
66 mtsMailBox(const std::string & name,
67 size_t size,
68 mtsCallableVoidBase * postCommandQueuedCallable = 0);
69
71
73 const std::string & GetName(void) const;
74
77 bool Write(mtsCommandBase * command);
78
80 bool ExecuteNext(void);
81
86 void SetSize(size_t size);
87
89 bool IsEmpty(void) const;
90
92 bool IsFull(void) const;
93
96 size_t GetAvailable(void) const;
97
104
111
112};
113
114
115#endif // _mtsMailbox_h
Definition mtsCallableVoidBase.h:40
Definition mtsCommandBase.h:43
Definition mtsCommandVoid.h:44
Definition mtsCommandWriteBase.h:40
Definition mtsExecutionResult.h:34
Base class for data object in cisstMultiTask.
Definition mtsGenericObject.h:52
mtsMailBox(const std::string &name, size_t size, mtsCallableVoidBase *postCommandQueuedCallable=0)
bool IsFull(void) const
void SetSize(size_t size)
void SetPostCommandDequeuedCommand(mtsCommandVoid *command)
mtsCommandVoid * GetPostCommandDequeuedCommand(void) const
bool IsEmpty(void) const
const std::string & GetName(void) const
size_t GetAvailable(void) const
void SetPostCommandReturnDequeuedCommand(mtsCommandVoid *command)
~mtsMailBox(void)
bool ExecuteNext(void)
bool Write(mtsCommandBase *command)
mtsCommandVoid * GetPostCommandReturnDequeuedCommand(void) const
Definition mtsQueue.h:41
#define CISST_EXPORT
Definition cmnExportMacros.h:50
Rules of exporting.
Defines mtsQueue.
size_type size(void) const
Definition vctDynamicConstMatrixBase.h:228