cisst-saw
Toggle main menu visibility
Loading...
Searching...
No Matches
tmp
cisst-saw
cisst
cisstMultiTask
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
12
This software is provided "as is" under an open source license, with
13
no warranty. The complete license can be found in license.txt and
14
http://www.cisst.org/cisst/license.txt.
15
16
--- end cisst license ---
17
*/
18
19
24
25
#ifndef _mtsMailBox_h
26
#define _mtsMailBox_h
27
28
#include <
cisstMultiTask/mtsQueue.h
>
29
30
// Always include last
31
#include <
cisstMultiTask/mtsExport.h
>
32
33
class
mtsExecutionResult
;
34
35
class
CISST_EXPORT
mtsMailBox
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
65
public
:
66
mtsMailBox
(
const
std::string & name,
67
size_t
size
,
68
mtsCallableVoidBase
* postCommandQueuedCallable = 0);
69
70
~mtsMailBox
(
void
);
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
102
void
SetPostCommandDequeuedCommand
(
mtsCommandVoid
* command);
103
mtsCommandVoid
*
GetPostCommandDequeuedCommand
(
void
)
const
;
104
109
void
SetPostCommandReturnDequeuedCommand
(
mtsCommandVoid
* command);
110
mtsCommandVoid
*
GetPostCommandReturnDequeuedCommand
(
void
)
const
;
111
112
};
113
114
115
#endif
// _mtsMailbox_h
mtsCallableVoidBase
Definition
mtsCallableVoidBase.h:40
mtsCommandBase
Definition
mtsCommandBase.h:43
mtsCommandVoid
Definition
mtsCommandVoid.h:44
mtsCommandWriteBase
Definition
mtsCommandWriteBase.h:40
mtsExecutionResult
Definition
mtsExecutionResult.h:34
mtsGenericObject
Base class for data object in cisstMultiTask.
Definition
mtsGenericObject.h:52
mtsMailBox::mtsMailBox
mtsMailBox(const std::string &name, size_t size, mtsCallableVoidBase *postCommandQueuedCallable=0)
mtsMailBox::IsFull
bool IsFull(void) const
mtsMailBox::SetSize
void SetSize(size_t size)
mtsMailBox::SetPostCommandDequeuedCommand
void SetPostCommandDequeuedCommand(mtsCommandVoid *command)
mtsMailBox::GetPostCommandDequeuedCommand
mtsCommandVoid * GetPostCommandDequeuedCommand(void) const
mtsMailBox::IsEmpty
bool IsEmpty(void) const
mtsMailBox::GetName
const std::string & GetName(void) const
mtsMailBox::GetAvailable
size_t GetAvailable(void) const
mtsMailBox::SetPostCommandReturnDequeuedCommand
void SetPostCommandReturnDequeuedCommand(mtsCommandVoid *command)
mtsMailBox::~mtsMailBox
~mtsMailBox(void)
mtsMailBox::ExecuteNext
bool ExecuteNext(void)
mtsMailBox::Write
bool Write(mtsCommandBase *command)
mtsMailBox::GetPostCommandReturnDequeuedCommand
mtsCommandVoid * GetPostCommandReturnDequeuedCommand(void) const
mtsQueue
Definition
mtsQueue.h:41
CISST_EXPORT
#define CISST_EXPORT
Definition
cmnExportMacros.h:50
mtsExport.h
Rules of exporting.
mtsQueue.h
Defines mtsQueue.
size
size_type size(void) const
Definition
vctDynamicConstMatrixBase.h:228
Generated by
1.18.0