v1.3.0.0
enums_impl.h
1/*
2This file is part of the WASimCommander project.
3https://github.com/mpaperno/WASimCommander
4
5COPYRIGHT: (c) Maxim Paperno; All Rights Reserved.
6
7This file may be used under the terms of either the GNU General Public License (GPL)
8or the GNU Lesser General Public License (LGPL), as published by the Free Software
9Foundation, either version 3 of the Licenses, or (at your option) any later version.
10
11This program is distributed in the hope that it will be useful,
12but WITHOUT ANY WARRANTY; without even the implied warranty of
13MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14GNU General Public License for more details.
15
16Copies of the GNU GPL and LGPL are included with this project
17and are available at <http://www.gnu.org/licenses/>.
18*/
19
20// DO NOT USE THIS FILE DIRECTLY -- NO INCLUDE GUARD
21// Use client/enums.h
22
23#include <cstdint>
24#include <vector>
25
26#ifndef WSMCMND_ENUM_EXPORT
27 #define WSMCMND_ENUM_EXPORT
28 #define WSMCMND_ENUM_NAMESPACE WASimCommander::Client
29#endif
30
31namespace WSMCMND_ENUM_NAMESPACE
32{
33
34/// Client status flags. \sa WASimClient::status()
35WSMCMND_ENUM_EXPORT enum class ClientStatus : uint8_t
36 {
37 Idle = 0x00, ///< no active SimConnect or WASim server connection
38 Initializing = 0x01, ///< trying to connect to SimConnect
39 SimConnected = 0x02, ///< have SimConnect link
40 Connecting = 0x04, ///< attempting connection to WASim server
41 Connected = 0x08, ///< connected to WASim server
42 ShuttingDown = 0x10, ///< closing SimConnect link, before being back in Idle status mode
43 AllConnected = SimConnected | Connected,
44 };
45#if defined(DEFINE_ENUM_FLAG_OPERATORS) && !defined(_MANAGED)
46 DEFINE_ENUM_FLAG_OPERATORS(ClientStatus)
47#endif
48 /// \name Enumeration name strings
49 /// \{
50 static const std::vector<const char *> ClientStatusNames = { "Idle", "Initializing", "SimConnected", "Connecting", "Connected", "ShuttingDown" }; ///< \refwcc{ClientStatus} enum names.
51 /// \}
52
53 /// Client event type enumeration. \sa ClientEvent, ClientStatus, WASimClient::setClientEventCallback()
54 WSMCMND_ENUM_EXPORT enum class ClientEventType : uint8_t
55 {
56 None = 0,
57 SimConnecting, ///< Initializing status
58 SimConnected, ///< SimConnected status
59 SimDisconnecting, ///< ShuttingDown status
60 SimDisconnected, ///< From SimConnected to Initializing status change
61 ServerConnecting, ///< Connecting status
62 ServerConnected, ///< Connected status
63 ServerDisconnected, ///< From Connected to SimConnected status change
64 };
65 /// \name Enumeration name strings
66 /// \{
67 static const std::vector<const char *> ClientEventTypeNames = { "None",
68 "SimConnecting", "SimConnected", "SimDisconnecting", "SimDisconnected",
69 "ServerConnecting", "ServerConnected", "ServerDisconnected" }; ///< \refwcc{ClientEventType} enum names.
70 /// \}
71
72 /// Log entry source, Client or Server. \sa WASimClient::logCallback_t
73 WSMCMND_ENUM_EXPORT enum class LogSource : uint8_t
74 {
75 Client, ///< Log record from WASimClient
76 Server ///< Log record from WASimModule (Server)
77 };
78 /// \name Enumeration name strings
79 /// \{
80 static const std::vector<const char *> LogSourceNames = { "Client", "Server" }; ///< \refwcc{LogSource} enum names.
81 /// \}
82
83};
static const std::vector< const char * > ClientStatusNames
Client::ClientStatus enum names.
Definition: enums_impl.h:50
LogSource
Log entry source, Client or Server.
Definition: enums_impl.h:74
@ Client
Log record from WASimClient.
@ Server
Log record from WASimModule (Server)
static const std::vector< const char * > LogSourceNames
Client::LogSource enum names.
Definition: enums_impl.h:80
static const std::vector< const char * > ClientEventTypeNames
Client::ClientEventType enum names.
Definition: enums_impl.h:67
ClientEventType
Client event type enumeration.
Definition: enums_impl.h:55
@ SimDisconnecting
ShuttingDown status.
@ ServerDisconnected
From Connected to SimConnected status change.
@ SimDisconnected
From SimConnected to Initializing status change.
ClientStatus
Client status flags.
Definition: enums_impl.h:36
@ ShuttingDown
closing SimConnect link, before being back in Idle status mode
@ Connected
connected to WASim server
@ Initializing
trying to connect to SimConnect
@ SimConnected
have SimConnect link
@ Connecting
attempting connection to WASim server
@ Idle
no active SimConnect or WASim server connection