1#include "base/rust.h"
2#include "engine/console.h"
3#include "engine/rust.h"
4#include <cstddef>
5#include <cstdint>
6#include <memory>
7#include <new>
8#include <type_traits>
9#include <utility>
10
11#ifdef __GNUC__
12#pragma GCC diagnostic ignored "-Wmissing-declarations"
13#ifdef __clang__
14#pragma clang diagnostic ignored "-Wdollar-in-identifier-extension"
15#endif // __clang__
16#endif // __GNUC__
17
18namespace rust {
19inline namespace cxxbridge1 {
20// #include "rust/cxx.h"
21
22#ifndef CXXBRIDGE1_IS_COMPLETE
23#define CXXBRIDGE1_IS_COMPLETE
24namespace detail {
25namespace {
26template <typename T, typename = std::size_t>
27struct is_complete : std::false_type {};
28template <typename T>
29struct is_complete<T, decltype(sizeof(T))> : std::true_type {};
30} // namespace
31} // namespace detail
32#endif // CXXBRIDGE1_IS_COMPLETE
33
34#ifndef CXXBRIDGE1_RELOCATABLE
35#define CXXBRIDGE1_RELOCATABLE
36namespace detail {
37template <typename... Ts>
38struct make_void {
39 using type = void;
40};
41
42template <typename... Ts>
43using void_t = typename make_void<Ts...>::type;
44
45template <typename Void, template <typename...> class, typename...>
46struct detect : std::false_type {};
47template <template <typename...> class T, typename... A>
48struct detect<void_t<T<A...>>, T, A...> : std::true_type {};
49
50template <template <typename...> class T, typename... A>
51using is_detected = detect<void, T, A...>;
52
53template <typename T>
54using detect_IsRelocatable = typename T::IsRelocatable;
55
56template <typename T>
57struct get_IsRelocatable
58 : std::is_same<typename T::IsRelocatable, std::true_type> {};
59} // namespace detail
60
61template <typename T>
62struct IsRelocatable
63 : std::conditional<
64 detail::is_detected<detail::detect_IsRelocatable, T>::value,
65 detail::get_IsRelocatable<T>,
66 std::integral_constant<
67 bool, std::is_trivially_move_constructible<T>::value &&
68 std::is_trivially_destructible<T>::value>>::type {};
69#endif // CXXBRIDGE1_RELOCATABLE
70
71namespace {
72template <bool> struct deleter_if {
73 template <typename T> void operator()(T *) {}
74};
75template <> struct deleter_if<true> {
76 template <typename T> void operator()(T *ptr) { ptr->~T(); }
77};
78} // namespace
79} // namespace cxxbridge1
80} // namespace rust
81
82using IConsole_IResult = ::IConsole_IResult;
83using IConsole = ::IConsole;
84
85static_assert(
86 ::rust::IsRelocatable<::ColorRGBA>::value,
87 "type ColorRGBA should be trivially move constructible and trivially destructible in C++ to be used as an argument of `Print` in Rust");
88static_assert(
89 ::rust::IsRelocatable<::ColorHSLA>::value,
90 "type ColorHSLA should be trivially move constructible and trivially destructible in C++ to be used as a return value of `GetColor` in Rust");
91static_assert(
92 ::rust::IsRelocatable<::StrRef>::value,
93 "type StrRef should be trivially move constructible and trivially destructible in C++ to be used as an argument of `ExecuteLine`, `Print`, `Register` or return value of `GetString` in Rust");
94static_assert(
95 ::rust::IsRelocatable<::UserPtr>::value,
96 "type UserPtr should be trivially move constructible and trivially destructible in C++ to be used as an argument of `Register` in Rust");
97static_assert(
98 ::rust::IsRelocatable<::IConsole_FCommandCallback>::value,
99 "type IConsole_FCommandCallback should be trivially move constructible and trivially destructible in C++ to be used as an argument of `Register` in Rust");
100
101extern "C" {
102::std::int32_t cxxbridge1$194$IConsole_IResult$GetInteger(::IConsole_IResult const &self, ::std::uint32_t Index) noexcept {
103 ::std::int32_t (::IConsole_IResult::*GetInteger$)(::std::uint32_t) const = &::IConsole_IResult::GetInteger;
104 return (self.*GetInteger$)(Index);
105}
106
107float cxxbridge1$194$IConsole_IResult$GetFloat(::IConsole_IResult const &self, ::std::uint32_t Index) noexcept {
108 float (::IConsole_IResult::*GetFloat$)(::std::uint32_t) const = &::IConsole_IResult::GetFloat;
109 return (self.*GetFloat$)(Index);
110}
111
112void cxxbridge1$194$IConsole_IResult$GetString(::IConsole_IResult const &self, ::std::uint32_t Index, ::StrRef *return$) noexcept {
113 ::StrRef (::IConsole_IResult::*GetString$)(::std::uint32_t) const = &::IConsole_IResult::GetString;
114 new (return$) ::StrRef((self.*GetString$)(Index));
115}
116
117void cxxbridge1$194$IConsole_IResult$GetColor(::IConsole_IResult const &self, ::std::uint32_t Index, float DarkestLighting, ::ColorHSLA *return$) noexcept {
118 ::ColorHSLA (::IConsole_IResult::*GetColor$)(::std::uint32_t, float) const = &::IConsole_IResult::GetColor;
119 new (return$) ::ColorHSLA((self.*GetColor$)(Index, DarkestLighting));
120}
121
122::std::int32_t cxxbridge1$194$IConsole_IResult$NumArguments(::IConsole_IResult const &self) noexcept {
123 ::std::int32_t (::IConsole_IResult::*NumArguments$)() const = &::IConsole_IResult::NumArguments;
124 return (self.*NumArguments$)();
125}
126
127::std::int32_t cxxbridge1$194$IConsole_IResult$GetVictim(::IConsole_IResult const &self) noexcept {
128 ::std::int32_t (::IConsole_IResult::*GetVictim$)() const = &::IConsole_IResult::GetVictim;
129 return (self.*GetVictim$)();
130}
131
132void cxxbridge1$194$IConsole$ExecuteLine(::IConsole &self, ::StrRef *pStr, ::std::int32_t ClientId, bool InterpretSemicolons) noexcept {
133 void (::IConsole::*ExecuteLine$)(::StrRef, ::std::int32_t, bool) = &::IConsole::ExecuteLine;
134 (self.*ExecuteLine$)(::std::move(*pStr), ClientId, InterpretSemicolons);
135}
136
137void cxxbridge1$194$IConsole$Print(::IConsole const &self, ::std::int32_t Level, ::StrRef *pFrom, ::StrRef *pStr, ::ColorRGBA *PrintColor) noexcept {
138 void (::IConsole::*Print$)(::std::int32_t, ::StrRef, ::StrRef, ::ColorRGBA) const = &::IConsole::Print;
139 (self.*Print$)(Level, ::std::move(*pFrom), ::std::move(*pStr), ::std::move(*PrintColor));
140}
141
142void cxxbridge1$194$IConsole$Register(::IConsole &self, ::StrRef *pName, ::StrRef *pParams, ::std::int32_t Flags, ::IConsole_FCommandCallback *pfnFunc, ::UserPtr *pUser, ::StrRef *pHelp) noexcept {
143 void (::IConsole::*Register$)(::StrRef, ::StrRef, ::std::int32_t, ::IConsole_FCommandCallback, ::UserPtr, ::StrRef) = &::IConsole::Register;
144 (self.*Register$)(::std::move(*pName), ::std::move(*pParams), Flags, ::std::move(*pfnFunc), ::std::move(*pUser), ::std::move(*pHelp));
145}
146
147::IConsole *cxxbridge1$194$CreateConsole(::std::int32_t FlagMask) noexcept {
148 ::std::unique_ptr<::IConsole> (*CreateConsole$)(::std::int32_t) = ::CreateConsole;
149 return CreateConsole$(FlagMask).release();
150}
151
152static_assert(::rust::detail::is_complete<::std::remove_extent<::IConsole>::type>::value, "definition of `::IConsole` is required");
153static_assert(sizeof(::std::unique_ptr<::IConsole>) == sizeof(void *), "");
154static_assert(alignof(::std::unique_ptr<::IConsole>) == alignof(void *), "");
155void cxxbridge1$unique_ptr$IConsole$null(::std::unique_ptr<::IConsole> *ptr) noexcept {
156 ::new (ptr) ::std::unique_ptr<::IConsole>();
157}
158void cxxbridge1$unique_ptr$IConsole$raw(::std::unique_ptr<::IConsole> *ptr, ::std::unique_ptr<::IConsole>::pointer raw) noexcept {
159 ::new (ptr) ::std::unique_ptr<::IConsole>(raw);
160}
161::std::unique_ptr<::IConsole>::element_type const *cxxbridge1$unique_ptr$IConsole$get(::std::unique_ptr<::IConsole> const &ptr) noexcept {
162 return ptr.get();
163}
164::std::unique_ptr<::IConsole>::pointer cxxbridge1$unique_ptr$IConsole$release(::std::unique_ptr<::IConsole> &ptr) noexcept {
165 return ptr.release();
166}
167void cxxbridge1$unique_ptr$IConsole$drop(::std::unique_ptr<::IConsole> *ptr) noexcept {
168 ::rust::deleter_if<::rust::detail::is_complete<::IConsole>::value>{}(ptr);
169}
170} // extern "C"
171