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 --structured --version 1 --hash notfrozen -t --stability vintf --min_sdk_version 33 -pout/soong/.intermediates/hardware/interfaces/contexthub/aidl/android.hardware.contexthub_interface/4/preprocessed.aidl --ninja -d out/soong/.intermediates/hardware/interfaces/bluetooth/socket/aidl/android.hardware.bluetooth.socket-V1-ndk-source/gen/staging/android/hardware/bluetooth/socket/ChannelInfo.cpp.d -h out/soong/.intermediates/hardware/interfaces/bluetooth/socket/aidl/android.hardware.bluetooth.socket-V1-ndk-source/gen/include/staging -o out/soong/.intermediates/hardware/interfaces/bluetooth/socket/aidl/android.hardware.bluetooth.socket-V1-ndk-source/gen/staging -Nhardware/interfaces/bluetooth/socket/aidl hardware/interfaces/bluetooth/socket/aidl/android/hardware/bluetooth/socket/ChannelInfo.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/hardware/bluetooth/socket/LeCocChannelInfo.h>
26 #include <aidl/android/hardware/bluetooth/socket/RfcommChannelInfo.h>
27 #ifdef BINDER_STABILITY_SUPPORT
28 #include <android/binder_stability.h>
29 #endif // BINDER_STABILITY_SUPPORT
30
31 #ifndef __BIONIC__
32 #define __assert2(a,b,c,d) ((void)0)
33 #endif
34
35 namespace aidl::android::hardware::bluetooth::socket {
36 class LeCocChannelInfo;
37 class RfcommChannelInfo;
38 } // namespace aidl::android::hardware::bluetooth::socket
39 namespace aidl {
40 namespace android {
41 namespace hardware {
42 namespace bluetooth {
43 namespace socket {
44 class ChannelInfo {
45 public:
46 typedef std::false_type fixed_size;
47 static const char* descriptor;
48
49 enum class Tag : int32_t {
50 leCocChannelInfo = 0,
51 rfcommChannelInfo = 1,
52 };
53
54 // Expose tag symbols for legacy code
55 static const inline Tag leCocChannelInfo = Tag::leCocChannelInfo;
56 static const inline Tag rfcommChannelInfo = Tag::rfcommChannelInfo;
57
58 template<typename _Tp>
59 static constexpr bool _not_self = !std::is_same_v<std::remove_cv_t<std::remove_reference_t<_Tp>>, ChannelInfo>;
60
ChannelInfo()61 ChannelInfo() : _value(std::in_place_index<static_cast<size_t>(leCocChannelInfo)>, ::aidl::android::hardware::bluetooth::socket::LeCocChannelInfo()) { }
62
63 template <typename _Tp, typename = std::enable_if_t<_not_self<_Tp>>>
64 // NOLINTNEXTLINE(google-explicit-constructor)
ChannelInfo(_Tp && _arg)65 constexpr ChannelInfo(_Tp&& _arg)
66 : _value(std::forward<_Tp>(_arg)) {}
67
68 template <size_t _Np, typename... _Tp>
ChannelInfo(std::in_place_index_t<_Np>,_Tp &&..._args)69 constexpr explicit ChannelInfo(std::in_place_index_t<_Np>, _Tp&&... _args)
70 : _value(std::in_place_index<_Np>, std::forward<_Tp>(_args)...) {}
71
72 template <Tag _tag, typename... _Tp>
make(_Tp &&..._args)73 static ChannelInfo make(_Tp&&... _args) {
74 return ChannelInfo(std::in_place_index<static_cast<size_t>(_tag)>, std::forward<_Tp>(_args)...);
75 }
76
77 template <Tag _tag, typename _Tp, typename... _Up>
make(std::initializer_list<_Tp> _il,_Up &&..._args)78 static ChannelInfo make(std::initializer_list<_Tp> _il, _Up&&... _args) {
79 return ChannelInfo(std::in_place_index<static_cast<size_t>(_tag)>, std::move(_il), std::forward<_Up>(_args)...);
80 }
81
getTag()82 Tag getTag() const {
83 return static_cast<Tag>(_value.index());
84 }
85
86 template <Tag _tag>
get()87 const auto& get() const {
88 if (getTag() != _tag) { __assert2(__FILE__, __LINE__, __PRETTY_FUNCTION__, "bad access: a wrong tag"); }
89 return std::get<static_cast<size_t>(_tag)>(_value);
90 }
91
92 template <Tag _tag>
get()93 auto& get() {
94 if (getTag() != _tag) { __assert2(__FILE__, __LINE__, __PRETTY_FUNCTION__, "bad access: a wrong tag"); }
95 return std::get<static_cast<size_t>(_tag)>(_value);
96 }
97
98 template <Tag _tag, typename... _Tp>
set(_Tp &&..._args)99 void set(_Tp&&... _args) {
100 _value.emplace<static_cast<size_t>(_tag)>(std::forward<_Tp>(_args)...);
101 }
102
103 binder_status_t readFromParcel(const AParcel* _parcel);
104 binder_status_t writeToParcel(AParcel* _parcel) const;
105
106 inline bool operator==(const ChannelInfo& _rhs) const {
107 return _value == _rhs._value;
108 }
109 inline bool operator<(const ChannelInfo& _rhs) const {
110 return _value < _rhs._value;
111 }
112 inline bool operator!=(const ChannelInfo& _rhs) const {
113 return !(*this == _rhs);
114 }
115 inline bool operator>(const ChannelInfo& _rhs) const {
116 return _rhs < *this;
117 }
118 inline bool operator>=(const ChannelInfo& _rhs) const {
119 return !(*this < _rhs);
120 }
121 inline bool operator<=(const ChannelInfo& _rhs) const {
122 return !(_rhs < *this);
123 }
124
125 static const ::ndk::parcelable_stability_t _aidl_stability = ::ndk::STABILITY_VINTF;
toString()126 inline std::string toString() const {
127 std::ostringstream os;
128 os << "ChannelInfo{";
129 switch (getTag()) {
130 case leCocChannelInfo: os << "leCocChannelInfo: " << ::android::internal::ToString(get<leCocChannelInfo>()); break;
131 case rfcommChannelInfo: os << "rfcommChannelInfo: " << ::android::internal::ToString(get<rfcommChannelInfo>()); break;
132 }
133 os << "}";
134 return os.str();
135 }
136 private:
137 std::variant<::aidl::android::hardware::bluetooth::socket::LeCocChannelInfo, ::aidl::android::hardware::bluetooth::socket::RfcommChannelInfo> _value;
138 };
139 } // namespace socket
140 } // namespace bluetooth
141 } // namespace hardware
142 } // namespace android
143 } // namespace aidl
144 namespace aidl {
145 namespace android {
146 namespace hardware {
147 namespace bluetooth {
148 namespace socket {
toString(ChannelInfo::Tag val)149 [[nodiscard]] static inline std::string toString(ChannelInfo::Tag val) {
150 switch(val) {
151 case ChannelInfo::Tag::leCocChannelInfo:
152 return "leCocChannelInfo";
153 case ChannelInfo::Tag::rfcommChannelInfo:
154 return "rfcommChannelInfo";
155 default:
156 return std::to_string(static_cast<int32_t>(val));
157 }
158 }
159 } // namespace socket
160 } // namespace bluetooth
161 } // namespace hardware
162 } // namespace android
163 } // namespace aidl
164 namespace ndk {
165 namespace internal {
166 #pragma clang diagnostic push
167 #pragma clang diagnostic ignored "-Wc++17-extensions"
168 template <>
169 constexpr inline std::array<aidl::android::hardware::bluetooth::socket::ChannelInfo::Tag, 2> enum_values<aidl::android::hardware::bluetooth::socket::ChannelInfo::Tag> = {
170 aidl::android::hardware::bluetooth::socket::ChannelInfo::Tag::leCocChannelInfo,
171 aidl::android::hardware::bluetooth::socket::ChannelInfo::Tag::rfcommChannelInfo,
172 };
173 #pragma clang diagnostic pop
174 } // namespace internal
175 } // namespace ndk
176