VirtualC64 v5.0 beta
Commodore 64 Emulator
Loading...
Searching...
No Matches
ThreadTypes.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 "Reflection.h"
17
18namespace vc64 {
19
30typedef EXEC_STATE ExecState;
31
32struct ExecStateEnum : util::Reflection<ExecStateEnum, ExecState>
33{
34 static constexpr long minVal = 0;
35 static constexpr long maxVal = STATE_HALTED;
36 static bool isValid(auto val) { return val >= minVal && val <= maxVal; }
37
38 static const char *prefix() { return "STATE"; }
39 static const char *key(long value)
40 {
41 switch (value) {
42
43 case STATE_UNINIT: return "UNINIT";
44 case STATE_OFF: return "OFF";
45 case STATE_PAUSED: return "PAUSED";
46 case STATE_RUNNING: return "RUNNING";
47 case STATE_SUSPENDED: return "SUSPENDED";
48 case STATE_HALTED: return "HALTED";
49 }
50 return "???";
51 }
52};
53
54}
VirtualC64 project namespace.
Definition CmdQueue.cpp:16
EXEC_STATE
Execution state.
Definition ThreadTypes.h:22
@ STATE_UNINIT
Not yet initialized.
Definition ThreadTypes.h:23
@ STATE_OFF
Powered off.
Definition ThreadTypes.h:24
@ STATE_PAUSED
Powered on, but currently paused.
Definition ThreadTypes.h:25
@ STATE_HALTED
Shut down.
Definition ThreadTypes.h:28
@ STATE_SUSPENDED
Shortly paused for an internal state change.
Definition ThreadTypes.h:27
@ STATE_RUNNING
Up and running.
Definition ThreadTypes.h:26