v1.3.0.0
Enums.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#pragma once
21
22#ifdef min
23#undef min
24#undef max
25#endif
26#include <type_traits>
27
28#ifdef WSMCMND_ENUM_EXPORT
29#undef WSMCMND_ENUM_EXPORT
30#undef WSMCMND_ENUM_NAMESPACE
31#endif
32
33//#include "client/WASimClient.h"
34#define WSMCMND_ENUM_EXPORT public
35#define WSMCMND_ENUM_NAMESPACE WASimCommander::CLI::Enums
36#include "enums_impl.h"
37#include "client/enums_impl.h"
38
39/// WASimCommander::CLI::Enums namespace. C++/CLI specific definitions only.
40/// See documentation for `WASimCommander::Enums` and `WASimCommander::Client` namespaces for main API and Client enum classes respectively.
42{
43
44 /// Custom "+" operator for strong C++ enum types to cast to underlying type.
45 template <typename T, std::enable_if_t<std::is_enum<T>::value, bool> = true>
46 constexpr auto operator+(T e) noexcept { return static_cast<std::underlying_type_t<T>>(e); }
47
48 /// <summary> Method return status values; HRESULT "alias" </summary>
49 public enum class HR
50 {
51 OK = S_OK, ///< Success status.
52 FAIL = E_FAIL, ///< General error status,
53 INVALIDARG = E_INVALIDARG, ///< Invalid method argument.
54 NOT_CONNECTED = int(/*ERROR_NOT_CONNECTED*/ 2250L | (/*FACILITY_WIN32*/ 7 << 16) | 0x80000000), ///< Error result: server not connected.
55 TIMEOUT = int(/*ERROR_TIMEOUT*/ 1460L | (/*FACILITY_WIN32*/ 7 << 16) | 0x80000000), ///< Error result: timeout communicating with server.
56 };
57
58}
WASimCommander::CLI::Enums namespace. C++/CLI specific definitions only. See documentation for WASimC...
Definition: Enums.h:42
HR
Method return status values; HRESULT "alias"
Definition: Enums.h:50
@ TIMEOUT
Error result: timeout communicating with server.
@ INVALIDARG
Invalid method argument.
@ FAIL
General error status,.
@ NOT_CONNECTED
Error result: server not connected.
constexpr auto operator+(T e) noexcept
Custom "+" operator for strong C++ enum types to cast to underlying type.
Definition: Enums.h:46