1 /*
2  * This file is auto-generated.  DO NOT MODIFY.
3  * Using: out/host/linux-x86/bin/aidl --lang=ndk -Weverything -Wno-missing-permission-annotation -t --min_sdk_version current -pout/soong/.intermediates/packages/modules/Virtualization/android/virtualizationservice/aidl/android.system.virtualizationcommon_interface/preprocessed.aidl --ninja -d out/soong/.intermediates/packages/modules/Virtualization/android/virtualizationservice/aidl/android.system.virtualizationservice-ndk-source/gen/staging/android/system/virtualizationservice/InputDevice.cpp.d -h out/soong/.intermediates/packages/modules/Virtualization/android/virtualizationservice/aidl/android.system.virtualizationservice-ndk-source/gen/include/staging -o out/soong/.intermediates/packages/modules/Virtualization/android/virtualizationservice/aidl/android.system.virtualizationservice-ndk-source/gen/staging -Npackages/modules/Virtualization/android/virtualizationservice/aidl packages/modules/Virtualization/android/virtualizationservice/aidl/android/system/virtualizationservice/InputDevice.aidl
4  *
5  * DO NOT CHECK THIS FILE INTO A CODE TREE (e.g. git, etc..).
6  * ALWAYS GENERATE THIS FILE FROM UPDATED AIDL COMPILER
7  * AS A BUILD INTERMEDIATE ONLY. THIS IS NOT SOURCE CODE.
8  */
9 #pragma once
10 
11 #include <array>
12 #include <cassert>
13 #include <cstdint>
14 #include <memory>
15 #include <optional>
16 #include <string>
17 #include <type_traits>
18 #include <utility>
19 #include <variant>
20 #include <vector>
21 #include <android/binder_enums.h>
22 #include <android/binder_interface_utils.h>
23 #include <android/binder_parcelable_utils.h>
24 #include <android/binder_to_string.h>
25 #include <aidl/android/system/virtualizationservice/InputDevice.h>
26 #ifdef BINDER_STABILITY_SUPPORT
27 #include <android/binder_stability.h>
28 #endif  // BINDER_STABILITY_SUPPORT
29 
30 #ifndef __BIONIC__
31 #define __assert2(a,b,c,d) ((void)0)
32 #endif
33 
34 namespace aidl {
35 namespace android {
36 namespace system {
37 namespace virtualizationservice {
38 class InputDevice {
39 public:
40   typedef std::false_type fixed_size;
41   static const char* descriptor;
42 
43   class SingleTouch {
44   public:
45     typedef std::false_type fixed_size;
46     static const char* descriptor;
47 
48     ::ndk::ScopedFileDescriptor pfd;
49     int32_t width = 1280;
50     int32_t height = 1080;
51     std::string name = "";
52 
53     binder_status_t readFromParcel(const AParcel* parcel);
54     binder_status_t writeToParcel(AParcel* parcel) const;
55 
56     inline bool operator==(const SingleTouch& _rhs) const {
57       return std::tie(pfd, width, height, name) == std::tie(_rhs.pfd, _rhs.width, _rhs.height, _rhs.name);
58     }
59     inline bool operator<(const SingleTouch& _rhs) const {
60       return std::tie(pfd, width, height, name) < std::tie(_rhs.pfd, _rhs.width, _rhs.height, _rhs.name);
61     }
62     inline bool operator!=(const SingleTouch& _rhs) const {
63       return !(*this == _rhs);
64     }
65     inline bool operator>(const SingleTouch& _rhs) const {
66       return _rhs < *this;
67     }
68     inline bool operator>=(const SingleTouch& _rhs) const {
69       return !(*this < _rhs);
70     }
71     inline bool operator<=(const SingleTouch& _rhs) const {
72       return !(_rhs < *this);
73     }
74 
75     static const ::ndk::parcelable_stability_t _aidl_stability = ::ndk::STABILITY_LOCAL;
toString()76     inline std::string toString() const {
77       std::ostringstream _aidl_os;
78       _aidl_os << "SingleTouch{";
79       _aidl_os << "pfd: " << ::android::internal::ToString(pfd);
80       _aidl_os << ", width: " << ::android::internal::ToString(width);
81       _aidl_os << ", height: " << ::android::internal::ToString(height);
82       _aidl_os << ", name: " << ::android::internal::ToString(name);
83       _aidl_os << "}";
84       return _aidl_os.str();
85     }
86   };
87   class EvDev {
88   public:
89     typedef std::false_type fixed_size;
90     static const char* descriptor;
91 
92     ::ndk::ScopedFileDescriptor pfd;
93 
94     binder_status_t readFromParcel(const AParcel* parcel);
95     binder_status_t writeToParcel(AParcel* parcel) const;
96 
97     inline bool operator==(const EvDev& _rhs) const {
98       return std::tie(pfd) == std::tie(_rhs.pfd);
99     }
100     inline bool operator<(const EvDev& _rhs) const {
101       return std::tie(pfd) < std::tie(_rhs.pfd);
102     }
103     inline bool operator!=(const EvDev& _rhs) const {
104       return !(*this == _rhs);
105     }
106     inline bool operator>(const EvDev& _rhs) const {
107       return _rhs < *this;
108     }
109     inline bool operator>=(const EvDev& _rhs) const {
110       return !(*this < _rhs);
111     }
112     inline bool operator<=(const EvDev& _rhs) const {
113       return !(_rhs < *this);
114     }
115 
116     static const ::ndk::parcelable_stability_t _aidl_stability = ::ndk::STABILITY_LOCAL;
toString()117     inline std::string toString() const {
118       std::ostringstream _aidl_os;
119       _aidl_os << "EvDev{";
120       _aidl_os << "pfd: " << ::android::internal::ToString(pfd);
121       _aidl_os << "}";
122       return _aidl_os.str();
123     }
124   };
125   class Keyboard {
126   public:
127     typedef std::false_type fixed_size;
128     static const char* descriptor;
129 
130     ::ndk::ScopedFileDescriptor pfd;
131 
132     binder_status_t readFromParcel(const AParcel* parcel);
133     binder_status_t writeToParcel(AParcel* parcel) const;
134 
135     inline bool operator==(const Keyboard& _rhs) const {
136       return std::tie(pfd) == std::tie(_rhs.pfd);
137     }
138     inline bool operator<(const Keyboard& _rhs) const {
139       return std::tie(pfd) < std::tie(_rhs.pfd);
140     }
141     inline bool operator!=(const Keyboard& _rhs) const {
142       return !(*this == _rhs);
143     }
144     inline bool operator>(const Keyboard& _rhs) const {
145       return _rhs < *this;
146     }
147     inline bool operator>=(const Keyboard& _rhs) const {
148       return !(*this < _rhs);
149     }
150     inline bool operator<=(const Keyboard& _rhs) const {
151       return !(_rhs < *this);
152     }
153 
154     static const ::ndk::parcelable_stability_t _aidl_stability = ::ndk::STABILITY_LOCAL;
toString()155     inline std::string toString() const {
156       std::ostringstream _aidl_os;
157       _aidl_os << "Keyboard{";
158       _aidl_os << "pfd: " << ::android::internal::ToString(pfd);
159       _aidl_os << "}";
160       return _aidl_os.str();
161     }
162   };
163   class Mouse {
164   public:
165     typedef std::false_type fixed_size;
166     static const char* descriptor;
167 
168     ::ndk::ScopedFileDescriptor pfd;
169 
170     binder_status_t readFromParcel(const AParcel* parcel);
171     binder_status_t writeToParcel(AParcel* parcel) const;
172 
173     inline bool operator==(const Mouse& _rhs) const {
174       return std::tie(pfd) == std::tie(_rhs.pfd);
175     }
176     inline bool operator<(const Mouse& _rhs) const {
177       return std::tie(pfd) < std::tie(_rhs.pfd);
178     }
179     inline bool operator!=(const Mouse& _rhs) const {
180       return !(*this == _rhs);
181     }
182     inline bool operator>(const Mouse& _rhs) const {
183       return _rhs < *this;
184     }
185     inline bool operator>=(const Mouse& _rhs) const {
186       return !(*this < _rhs);
187     }
188     inline bool operator<=(const Mouse& _rhs) const {
189       return !(_rhs < *this);
190     }
191 
192     static const ::ndk::parcelable_stability_t _aidl_stability = ::ndk::STABILITY_LOCAL;
toString()193     inline std::string toString() const {
194       std::ostringstream _aidl_os;
195       _aidl_os << "Mouse{";
196       _aidl_os << "pfd: " << ::android::internal::ToString(pfd);
197       _aidl_os << "}";
198       return _aidl_os.str();
199     }
200   };
201   class Switches {
202   public:
203     typedef std::false_type fixed_size;
204     static const char* descriptor;
205 
206     ::ndk::ScopedFileDescriptor pfd;
207 
208     binder_status_t readFromParcel(const AParcel* parcel);
209     binder_status_t writeToParcel(AParcel* parcel) const;
210 
211     inline bool operator==(const Switches& _rhs) const {
212       return std::tie(pfd) == std::tie(_rhs.pfd);
213     }
214     inline bool operator<(const Switches& _rhs) const {
215       return std::tie(pfd) < std::tie(_rhs.pfd);
216     }
217     inline bool operator!=(const Switches& _rhs) const {
218       return !(*this == _rhs);
219     }
220     inline bool operator>(const Switches& _rhs) const {
221       return _rhs < *this;
222     }
223     inline bool operator>=(const Switches& _rhs) const {
224       return !(*this < _rhs);
225     }
226     inline bool operator<=(const Switches& _rhs) const {
227       return !(_rhs < *this);
228     }
229 
230     static const ::ndk::parcelable_stability_t _aidl_stability = ::ndk::STABILITY_LOCAL;
toString()231     inline std::string toString() const {
232       std::ostringstream _aidl_os;
233       _aidl_os << "Switches{";
234       _aidl_os << "pfd: " << ::android::internal::ToString(pfd);
235       _aidl_os << "}";
236       return _aidl_os.str();
237     }
238   };
239   class Trackpad {
240   public:
241     typedef std::false_type fixed_size;
242     static const char* descriptor;
243 
244     ::ndk::ScopedFileDescriptor pfd;
245     int32_t width = 1280;
246     int32_t height = 1080;
247     std::string name = "";
248 
249     binder_status_t readFromParcel(const AParcel* parcel);
250     binder_status_t writeToParcel(AParcel* parcel) const;
251 
252     inline bool operator==(const Trackpad& _rhs) const {
253       return std::tie(pfd, width, height, name) == std::tie(_rhs.pfd, _rhs.width, _rhs.height, _rhs.name);
254     }
255     inline bool operator<(const Trackpad& _rhs) const {
256       return std::tie(pfd, width, height, name) < std::tie(_rhs.pfd, _rhs.width, _rhs.height, _rhs.name);
257     }
258     inline bool operator!=(const Trackpad& _rhs) const {
259       return !(*this == _rhs);
260     }
261     inline bool operator>(const Trackpad& _rhs) const {
262       return _rhs < *this;
263     }
264     inline bool operator>=(const Trackpad& _rhs) const {
265       return !(*this < _rhs);
266     }
267     inline bool operator<=(const Trackpad& _rhs) const {
268       return !(_rhs < *this);
269     }
270 
271     static const ::ndk::parcelable_stability_t _aidl_stability = ::ndk::STABILITY_LOCAL;
toString()272     inline std::string toString() const {
273       std::ostringstream _aidl_os;
274       _aidl_os << "Trackpad{";
275       _aidl_os << "pfd: " << ::android::internal::ToString(pfd);
276       _aidl_os << ", width: " << ::android::internal::ToString(width);
277       _aidl_os << ", height: " << ::android::internal::ToString(height);
278       _aidl_os << ", name: " << ::android::internal::ToString(name);
279       _aidl_os << "}";
280       return _aidl_os.str();
281     }
282   };
283   class MultiTouch {
284   public:
285     typedef std::false_type fixed_size;
286     static const char* descriptor;
287 
288     ::ndk::ScopedFileDescriptor pfd;
289     int32_t width = 1280;
290     int32_t height = 1080;
291     std::string name = "";
292 
293     binder_status_t readFromParcel(const AParcel* parcel);
294     binder_status_t writeToParcel(AParcel* parcel) const;
295 
296     inline bool operator==(const MultiTouch& _rhs) const {
297       return std::tie(pfd, width, height, name) == std::tie(_rhs.pfd, _rhs.width, _rhs.height, _rhs.name);
298     }
299     inline bool operator<(const MultiTouch& _rhs) const {
300       return std::tie(pfd, width, height, name) < std::tie(_rhs.pfd, _rhs.width, _rhs.height, _rhs.name);
301     }
302     inline bool operator!=(const MultiTouch& _rhs) const {
303       return !(*this == _rhs);
304     }
305     inline bool operator>(const MultiTouch& _rhs) const {
306       return _rhs < *this;
307     }
308     inline bool operator>=(const MultiTouch& _rhs) const {
309       return !(*this < _rhs);
310     }
311     inline bool operator<=(const MultiTouch& _rhs) const {
312       return !(_rhs < *this);
313     }
314 
315     static const ::ndk::parcelable_stability_t _aidl_stability = ::ndk::STABILITY_LOCAL;
toString()316     inline std::string toString() const {
317       std::ostringstream _aidl_os;
318       _aidl_os << "MultiTouch{";
319       _aidl_os << "pfd: " << ::android::internal::ToString(pfd);
320       _aidl_os << ", width: " << ::android::internal::ToString(width);
321       _aidl_os << ", height: " << ::android::internal::ToString(height);
322       _aidl_os << ", name: " << ::android::internal::ToString(name);
323       _aidl_os << "}";
324       return _aidl_os.str();
325     }
326   };
327   enum class Tag : int32_t {
328     singleTouch = 0,
329     evDev = 1,
330     keyboard = 2,
331     mouse = 3,
332     switches = 4,
333     trackpad = 5,
334     multiTouch = 6,
335   };
336 
337   // Expose tag symbols for legacy code
338   static const inline Tag singleTouch = Tag::singleTouch;
339   static const inline Tag evDev = Tag::evDev;
340   static const inline Tag keyboard = Tag::keyboard;
341   static const inline Tag mouse = Tag::mouse;
342   static const inline Tag switches = Tag::switches;
343   static const inline Tag trackpad = Tag::trackpad;
344   static const inline Tag multiTouch = Tag::multiTouch;
345 
346   template<typename _Tp>
347   static constexpr bool _not_self = !std::is_same_v<std::remove_cv_t<std::remove_reference_t<_Tp>>, InputDevice>;
348 
InputDevice()349   InputDevice() : _value(std::in_place_index<static_cast<size_t>(singleTouch)>, ::aidl::android::system::virtualizationservice::InputDevice::SingleTouch()) { }
350 
351   template <typename _Tp, typename = std::enable_if_t<_not_self<_Tp>>>
352   // NOLINTNEXTLINE(google-explicit-constructor)
InputDevice(_Tp && _arg)353   constexpr InputDevice(_Tp&& _arg)
354       : _value(std::forward<_Tp>(_arg)) {}
355 
356   template <size_t _Np, typename... _Tp>
InputDevice(std::in_place_index_t<_Np>,_Tp &&..._args)357   constexpr explicit InputDevice(std::in_place_index_t<_Np>, _Tp&&... _args)
358       : _value(std::in_place_index<_Np>, std::forward<_Tp>(_args)...) {}
359 
360   template <Tag _tag, typename... _Tp>
make(_Tp &&..._args)361   static InputDevice make(_Tp&&... _args) {
362     return InputDevice(std::in_place_index<static_cast<size_t>(_tag)>, std::forward<_Tp>(_args)...);
363   }
364 
365   template <Tag _tag, typename _Tp, typename... _Up>
make(std::initializer_list<_Tp> _il,_Up &&..._args)366   static InputDevice make(std::initializer_list<_Tp> _il, _Up&&... _args) {
367     return InputDevice(std::in_place_index<static_cast<size_t>(_tag)>, std::move(_il), std::forward<_Up>(_args)...);
368   }
369 
getTag()370   Tag getTag() const {
371     return static_cast<Tag>(_value.index());
372   }
373 
374   template <Tag _tag>
get()375   const auto& get() const {
376     if (getTag() != _tag) { __assert2(__FILE__, __LINE__, __PRETTY_FUNCTION__, "bad access: a wrong tag"); }
377     return std::get<static_cast<size_t>(_tag)>(_value);
378   }
379 
380   template <Tag _tag>
get()381   auto& get() {
382     if (getTag() != _tag) { __assert2(__FILE__, __LINE__, __PRETTY_FUNCTION__, "bad access: a wrong tag"); }
383     return std::get<static_cast<size_t>(_tag)>(_value);
384   }
385 
386   template <Tag _tag, typename... _Tp>
set(_Tp &&..._args)387   void set(_Tp&&... _args) {
388     _value.emplace<static_cast<size_t>(_tag)>(std::forward<_Tp>(_args)...);
389   }
390 
391   binder_status_t readFromParcel(const AParcel* _parcel);
392   binder_status_t writeToParcel(AParcel* _parcel) const;
393 
394   inline bool operator==(const InputDevice& _rhs) const {
395     return _value == _rhs._value;
396   }
397   inline bool operator<(const InputDevice& _rhs) const {
398     return _value < _rhs._value;
399   }
400   inline bool operator!=(const InputDevice& _rhs) const {
401     return !(*this == _rhs);
402   }
403   inline bool operator>(const InputDevice& _rhs) const {
404     return _rhs < *this;
405   }
406   inline bool operator>=(const InputDevice& _rhs) const {
407     return !(*this < _rhs);
408   }
409   inline bool operator<=(const InputDevice& _rhs) const {
410     return !(_rhs < *this);
411   }
412 
413   static const ::ndk::parcelable_stability_t _aidl_stability = ::ndk::STABILITY_LOCAL;
toString()414   inline std::string toString() const {
415     std::ostringstream os;
416     os << "InputDevice{";
417     switch (getTag()) {
418     case singleTouch: os << "singleTouch: " << ::android::internal::ToString(get<singleTouch>()); break;
419     case evDev: os << "evDev: " << ::android::internal::ToString(get<evDev>()); break;
420     case keyboard: os << "keyboard: " << ::android::internal::ToString(get<keyboard>()); break;
421     case mouse: os << "mouse: " << ::android::internal::ToString(get<mouse>()); break;
422     case switches: os << "switches: " << ::android::internal::ToString(get<switches>()); break;
423     case trackpad: os << "trackpad: " << ::android::internal::ToString(get<trackpad>()); break;
424     case multiTouch: os << "multiTouch: " << ::android::internal::ToString(get<multiTouch>()); break;
425     }
426     os << "}";
427     return os.str();
428   }
429 private:
430   std::variant<::aidl::android::system::virtualizationservice::InputDevice::SingleTouch, ::aidl::android::system::virtualizationservice::InputDevice::EvDev, ::aidl::android::system::virtualizationservice::InputDevice::Keyboard, ::aidl::android::system::virtualizationservice::InputDevice::Mouse, ::aidl::android::system::virtualizationservice::InputDevice::Switches, ::aidl::android::system::virtualizationservice::InputDevice::Trackpad, ::aidl::android::system::virtualizationservice::InputDevice::MultiTouch> _value;
431 };
432 }  // namespace virtualizationservice
433 }  // namespace system
434 }  // namespace android
435 }  // namespace aidl
436 namespace aidl {
437 namespace android {
438 namespace system {
439 namespace virtualizationservice {
toString(InputDevice::Tag val)440 [[nodiscard]] static inline std::string toString(InputDevice::Tag val) {
441   switch(val) {
442   case InputDevice::Tag::singleTouch:
443     return "singleTouch";
444   case InputDevice::Tag::evDev:
445     return "evDev";
446   case InputDevice::Tag::keyboard:
447     return "keyboard";
448   case InputDevice::Tag::mouse:
449     return "mouse";
450   case InputDevice::Tag::switches:
451     return "switches";
452   case InputDevice::Tag::trackpad:
453     return "trackpad";
454   case InputDevice::Tag::multiTouch:
455     return "multiTouch";
456   default:
457     return std::to_string(static_cast<int32_t>(val));
458   }
459 }
460 }  // namespace virtualizationservice
461 }  // namespace system
462 }  // namespace android
463 }  // namespace aidl
464 namespace ndk {
465 namespace internal {
466 #pragma clang diagnostic push
467 #pragma clang diagnostic ignored "-Wc++17-extensions"
468 template <>
469 constexpr inline std::array<aidl::android::system::virtualizationservice::InputDevice::Tag, 7> enum_values<aidl::android::system::virtualizationservice::InputDevice::Tag> = {
470   aidl::android::system::virtualizationservice::InputDevice::Tag::singleTouch,
471   aidl::android::system::virtualizationservice::InputDevice::Tag::evDev,
472   aidl::android::system::virtualizationservice::InputDevice::Tag::keyboard,
473   aidl::android::system::virtualizationservice::InputDevice::Tag::mouse,
474   aidl::android::system::virtualizationservice::InputDevice::Tag::switches,
475   aidl::android::system::virtualizationservice::InputDevice::Tag::trackpad,
476   aidl::android::system::virtualizationservice::InputDevice::Tag::multiTouch,
477 };
478 #pragma clang diagnostic pop
479 }  // namespace internal
480 }  // namespace ndk
481