VirtualC64
v5.0 beta
Commodore 64 Emulator
Loading...
Searching...
No Matches
CmdQueue.h
Go to the documentation of this file.
1
// -----------------------------------------------------------------------------
2
// This file is part of VirtualC64
3
//
4
// Copyright (C) Dirk W. Hoffmann. www.dirkwhoffmann.de
5
// This FILE is dual-licensed. You are free to choose between:
6
//
7
// - The GNU General Public License v3 (or any later version)
8
// - The Mozilla Public License v2
9
//
10
// SPDX-License-Identifier: GPL-3.0-or-later OR MPL-2.0
11
// -----------------------------------------------------------------------------
13
14
#pragma once
15
16
#include "
CmdQueueTypes.h
"
17
#include "CoreObject.h"
18
#include "Synchronizable.h"
19
#include "RingBuffer.h"
20
#include <atomic>
21
22
namespace
vc64
{
23
25
class
CmdQueue
final : CoreObject, Synchronizable {
26
28
util::RingBuffer <Cmd, 128> queue;
29
31
std::atomic<bool> empty =
true
;
32
33
//
34
// Methods
35
//
36
37
private
:
38
39
const
char
*objectName()
const override
{
return
"CmdQueue"
; }
40
41
42
//
43
// Managing the queue
44
//
45
46
public
:
47
48
// Sends a command
49
void
put(
const
Cmd &cmd);
50
// void put(CmdType type, KeyCmd payload);
51
52
// Polls a command
53
bool
poll(Cmd &cmd);
54
};
55
56
}
CmdQueueTypes.h
vc64::CmdQueue
Command queue.
Definition
CmdQueue.h:25
vc64
VirtualC64 project namespace.
Definition
CmdQueue.cpp:16
Emulator
Base
CmdQueue.h
Generated by
1.10.0