PEBL
2.2
Psychology Experiment Building Language - Cross-platform psychological experiment development system
PEventQueue.cpp
Go to the documentation of this file.
1
//* -*- mode:C++; tab-width:4; c-basic-offset:4; indent-tabs-mode:nil -*- */
3
// Name: src/devices/PEventQueue.cpp
4
// Purpose: Interface to platform-specific event queue.
5
// Author: Shane T. Mueller, Ph.D.
6
// Copyright: (c) 2004-2026 Shane T. Mueller <smueller@obereed.net>
7
// License: GPL 2
8
//
9
//
10
//
11
// This file is part of the PEBL project.
12
//
13
// PEBL is free software; you can redistribute it and/or modify
14
// it under the terms of the GNU General Public License as published by
15
// the Free Software Foundation; either version 2 of the License, or
16
// (at your option) any later version.
17
//
18
// PEBL is distributed in the hope that it will be useful,
19
// but WITHOUT ANY WARRANTY; without even the implied warranty of
20
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21
// GNU General Public License for more details.
22
//
23
// You should have received a copy of the GNU General Public License
24
// along with PEBL; if not, write to the Free Software
25
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
26
// 02111-1307 USA
28
29
#include "
PEventQueue.h
"
30
#include "
PEvent.h
"
31
32
using
std::cout;
33
using
std::endl;
34
35
36
//This should be moved into PEventQueue
37
PEventQueue::PEventQueue
()
38
{
39
40
}
41
42
PEventQueue::~PEventQueue
()
43
{
44
}
45
46
47
48
PEBL_DEVICE_TYPE
PEventQueue::GetFirstEventType
()
49
{
50
51
return
(
mEventQueue
.front()).GetType();
52
}
53
54
55
int
PEventQueue::GetState
(
int
iface)
const
56
{
57
58
return
(
mEventQueue
.front()).GetState(iface);
59
}
60
61
62
void
PEventQueue::PopEvent
()
63
{
64
65
if
(!
mEventQueue
.empty())
66
{
67
mEventQueue
.pop();
68
}
69
}
70
71
void
PEventQueue::Clear
()
72
{
73
Prime
();
74
while
(!
mEventQueue
.empty())
75
{
76
mEventQueue
.pop();
77
}
78
}
79
80
void
PEventQueue::PushEvent
(
PEvent
& evt)
81
{
82
mEventQueue
.push(evt);
83
}
84
85
86
PEvent
PEventQueue::GetFirstEvent
()
87
{
88
return
mEventQueue
.front();
89
}
90
91
92
PEBL_DEVICE_TYPE
PEBL_DEVICE_TYPE
Definition
PDevice.h:40
PEventQueue.h
PEvent.h
PEventQueue::mEventQueue
queue< PEvent > mEventQueue
Definition
PEventQueue.h:68
PEventQueue::~PEventQueue
virtual ~PEventQueue()
Definition
PEventQueue.cpp:42
PEventQueue::Clear
virtual void Clear()
Definition
PEventQueue.cpp:71
PEventQueue::GetFirstEventType
virtual PEBL_DEVICE_TYPE GetFirstEventType()
Definition
PEventQueue.cpp:48
PEventQueue::PopEvent
virtual void PopEvent()
Definition
PEventQueue.cpp:62
PEventQueue::GetFirstEvent
virtual PEvent GetFirstEvent()
Definition
PEventQueue.cpp:86
PEventQueue::PushEvent
virtual void PushEvent(PEvent &evt)
Definition
PEventQueue.cpp:80
PEventQueue::GetState
virtual int GetState(int intface) const
Definition
PEventQueue.cpp:55
PEventQueue::Prime
virtual void Prime()
Definition
PEventQueue.h:56
PEventQueue::PEventQueue
PEventQueue()
Definition
PEventQueue.cpp:37
PEvent
Definition
PEvent.h:157
src
devices
PEventQueue.cpp
Generated by
1.9.8