rad
4.0.0
scxml4cpp
engine
src
include
scxml4cpp
EventQueue.h
Go to the documentation of this file.
1
10
/*
11
* scampl4cpp/engine
12
*
13
* Copyright by European Southern Observatory, 2012
14
* All rights reserved
15
*
16
* This library is free software; you can redistribute it and/or
17
* modify it under the terms of the GNU Lesser General Public
18
* License as published by the Free Software Foundation; either
19
* version 2.1 of the License, or (at your option) any later version.
20
*
21
* This library is distributed in the hope that it will be useful,
22
* but WITHOUT ANY WARRANTY; without even the implied warranty of
23
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
24
* Lesser General Public License for more details.
25
*
26
* You should have received a copy of the GNU Lesser General Public
27
* License along with this library; if not, write to the Free Software
28
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
29
* 02111-1307 USA.
30
*/
31
32
#ifndef SCXML4CPP_EVENTQUEUE_H
33
#define SCXML4CPP_EVENTQUEUE_H
34
35
#ifndef __cplusplus
36
#error This is a C++ include file and cannot be used from plain C
37
#endif
38
39
#include <queue>
40
#include <mutex>
41
42
#ifndef SCXML4CPP_EVENT_H
43
#include "
scxml4cpp/Event.h
"
44
#endif
45
46
namespace
scxml4cpp
{
47
54
class
EventQueue
55
{
56
public
:
57
EventQueue
();
58
virtual
~EventQueue
();
59
66
void
add
(
Event
* e);
67
74
Event
*
remove
();
75
79
bool
isEmpty
()
const
;
80
84
int
size
()
const
;
85
90
void
clear
();
91
92
private
:
93
std::queue<Event*> mEvents;
94
std::mutex mMutex;
95
96
EventQueue
(
const
EventQueue
&);
97
EventQueue
& operator= (
const
EventQueue
&);
98
99
};
100
101
}
// namespace scxml4cpp
102
103
#endif // SCXML4CPP_EVENTQUEUE_H
104
105
106
scxml4cpp
Definition:
Action.h:40
scxml4cpp::EventQueue::isEmpty
bool isEmpty() const
Definition:
EventQueue.cpp:75
scxml4cpp::EventQueue::remove
Event * remove()
Definition:
EventQueue.cpp:60
scxml4cpp::EventQueue::~EventQueue
virtual ~EventQueue()
Definition:
EventQueue.cpp:43
scxml4cpp::EventQueue::size
int size() const
Definition:
EventQueue.cpp:81
Event.h
Event header.
scxml4cpp::EventQueue::add
void add(Event *e)
Definition:
EventQueue.cpp:48
scxml4cpp::EventQueue::clear
void clear()
Definition:
EventQueue.cpp:87
scxml4cpp::Event
Definition:
Event.h:66
scxml4cpp::EventQueue
Definition:
EventQueue.h:55
scxml4cpp::EventQueue::EventQueue
EventQueue()
Definition:
EventQueue.cpp:38
Generated by
1.8.20