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 5 --hash notfrozen -t --stability vintf --min_sdk_version 31 -pout/soong/.intermediates/hardware/interfaces/audio/aidl/android.hardware.audio.common_interface/4/preprocessed.aidl -pout/soong/.intermediates/hardware/interfaces/common/aidl/android.hardware.common_interface/2/preprocessed.aidl -pout/soong/.intermediates/hardware/interfaces/common/fmq/aidl/android.hardware.common.fmq_interface/1/preprocessed.aidl --previous_api_dir=hardware/interfaces/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/4 --previous_hash ac25616dda1c45dc2915d3f5ac82687a1a6f6e46 --ninja -d out/soong/.intermediates/hardware/interfaces/bluetooth/audio/aidl/android.hardware.bluetooth.audio-V5-ndk-source/gen/staging/android/hardware/bluetooth/audio/MetadataLtv.cpp.d -h out/soong/.intermediates/hardware/interfaces/bluetooth/audio/aidl/android.hardware.bluetooth.audio-V5-ndk-source/gen/include/staging -o out/soong/.intermediates/hardware/interfaces/bluetooth/audio/aidl/android.hardware.bluetooth.audio-V5-ndk-source/gen/staging -Nhardware/interfaces/bluetooth/audio/aidl hardware/interfaces/bluetooth/audio/aidl/android/hardware/bluetooth/audio/MetadataLtv.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/audio/AudioContext.h>
26 #include <aidl/android/hardware/bluetooth/audio/MetadataLtv.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::audio {
36 class AudioContext;
37 }  // namespace aidl::android::hardware::bluetooth::audio
38 namespace aidl {
39 namespace android {
40 namespace hardware {
41 namespace bluetooth {
42 namespace audio {
43 class MetadataLtv {
44 public:
45   typedef std::false_type fixed_size;
46   static const char* descriptor;
47 
48   class PreferredAudioContexts {
49   public:
50     typedef std::false_type fixed_size;
51     static const char* descriptor;
52 
53     ::aidl::android::hardware::bluetooth::audio::AudioContext values;
54 
55     binder_status_t readFromParcel(const AParcel* parcel);
56     binder_status_t writeToParcel(AParcel* parcel) const;
57 
58     inline bool operator==(const PreferredAudioContexts& _rhs) const {
59       return std::tie(values) == std::tie(_rhs.values);
60     }
61     inline bool operator<(const PreferredAudioContexts& _rhs) const {
62       return std::tie(values) < std::tie(_rhs.values);
63     }
64     inline bool operator!=(const PreferredAudioContexts& _rhs) const {
65       return !(*this == _rhs);
66     }
67     inline bool operator>(const PreferredAudioContexts& _rhs) const {
68       return _rhs < *this;
69     }
70     inline bool operator>=(const PreferredAudioContexts& _rhs) const {
71       return !(*this < _rhs);
72     }
73     inline bool operator<=(const PreferredAudioContexts& _rhs) const {
74       return !(_rhs < *this);
75     }
76 
77     static const ::ndk::parcelable_stability_t _aidl_stability = ::ndk::STABILITY_VINTF;
toString()78     inline std::string toString() const {
79       std::ostringstream _aidl_os;
80       _aidl_os << "PreferredAudioContexts{";
81       _aidl_os << "values: " << ::android::internal::ToString(values);
82       _aidl_os << "}";
83       return _aidl_os.str();
84     }
85   };
86   class StreamingAudioContexts {
87   public:
88     typedef std::false_type fixed_size;
89     static const char* descriptor;
90 
91     ::aidl::android::hardware::bluetooth::audio::AudioContext values;
92 
93     binder_status_t readFromParcel(const AParcel* parcel);
94     binder_status_t writeToParcel(AParcel* parcel) const;
95 
96     inline bool operator==(const StreamingAudioContexts& _rhs) const {
97       return std::tie(values) == std::tie(_rhs.values);
98     }
99     inline bool operator<(const StreamingAudioContexts& _rhs) const {
100       return std::tie(values) < std::tie(_rhs.values);
101     }
102     inline bool operator!=(const StreamingAudioContexts& _rhs) const {
103       return !(*this == _rhs);
104     }
105     inline bool operator>(const StreamingAudioContexts& _rhs) const {
106       return _rhs < *this;
107     }
108     inline bool operator>=(const StreamingAudioContexts& _rhs) const {
109       return !(*this < _rhs);
110     }
111     inline bool operator<=(const StreamingAudioContexts& _rhs) const {
112       return !(_rhs < *this);
113     }
114 
115     static const ::ndk::parcelable_stability_t _aidl_stability = ::ndk::STABILITY_VINTF;
toString()116     inline std::string toString() const {
117       std::ostringstream _aidl_os;
118       _aidl_os << "StreamingAudioContexts{";
119       _aidl_os << "values: " << ::android::internal::ToString(values);
120       _aidl_os << "}";
121       return _aidl_os.str();
122     }
123   };
124   class VendorSpecific {
125   public:
126     typedef std::false_type fixed_size;
127     static const char* descriptor;
128 
129     int32_t companyId = 0;
130     std::vector<uint8_t> opaqueValue;
131 
132     binder_status_t readFromParcel(const AParcel* parcel);
133     binder_status_t writeToParcel(AParcel* parcel) const;
134 
135     inline bool operator==(const VendorSpecific& _rhs) const {
136       return std::tie(companyId, opaqueValue) == std::tie(_rhs.companyId, _rhs.opaqueValue);
137     }
138     inline bool operator<(const VendorSpecific& _rhs) const {
139       return std::tie(companyId, opaqueValue) < std::tie(_rhs.companyId, _rhs.opaqueValue);
140     }
141     inline bool operator!=(const VendorSpecific& _rhs) const {
142       return !(*this == _rhs);
143     }
144     inline bool operator>(const VendorSpecific& _rhs) const {
145       return _rhs < *this;
146     }
147     inline bool operator>=(const VendorSpecific& _rhs) const {
148       return !(*this < _rhs);
149     }
150     inline bool operator<=(const VendorSpecific& _rhs) const {
151       return !(_rhs < *this);
152     }
153 
154     static const ::ndk::parcelable_stability_t _aidl_stability = ::ndk::STABILITY_VINTF;
toString()155     inline std::string toString() const {
156       std::ostringstream _aidl_os;
157       _aidl_os << "VendorSpecific{";
158       _aidl_os << "companyId: " << ::android::internal::ToString(companyId);
159       _aidl_os << ", opaqueValue: " << ::android::internal::ToString(opaqueValue);
160       _aidl_os << "}";
161       return _aidl_os.str();
162     }
163   };
164   enum class Tag : int32_t {
165     preferredAudioContexts = 0,
166     streamingAudioContexts = 1,
167     vendorSpecific = 2,
168   };
169 
170   // Expose tag symbols for legacy code
171   static const inline Tag preferredAudioContexts = Tag::preferredAudioContexts;
172   static const inline Tag streamingAudioContexts = Tag::streamingAudioContexts;
173   static const inline Tag vendorSpecific = Tag::vendorSpecific;
174 
175   template<typename _Tp>
176   static constexpr bool _not_self = !std::is_same_v<std::remove_cv_t<std::remove_reference_t<_Tp>>, MetadataLtv>;
177 
MetadataLtv()178   MetadataLtv() : _value(std::in_place_index<static_cast<size_t>(preferredAudioContexts)>, ::aidl::android::hardware::bluetooth::audio::MetadataLtv::PreferredAudioContexts()) { }
179 
180   template <typename _Tp, typename = std::enable_if_t<_not_self<_Tp>>>
181   // NOLINTNEXTLINE(google-explicit-constructor)
MetadataLtv(_Tp && _arg)182   constexpr MetadataLtv(_Tp&& _arg)
183       : _value(std::forward<_Tp>(_arg)) {}
184 
185   template <size_t _Np, typename... _Tp>
MetadataLtv(std::in_place_index_t<_Np>,_Tp &&..._args)186   constexpr explicit MetadataLtv(std::in_place_index_t<_Np>, _Tp&&... _args)
187       : _value(std::in_place_index<_Np>, std::forward<_Tp>(_args)...) {}
188 
189   template <Tag _tag, typename... _Tp>
make(_Tp &&..._args)190   static MetadataLtv make(_Tp&&... _args) {
191     return MetadataLtv(std::in_place_index<static_cast<size_t>(_tag)>, std::forward<_Tp>(_args)...);
192   }
193 
194   template <Tag _tag, typename _Tp, typename... _Up>
make(std::initializer_list<_Tp> _il,_Up &&..._args)195   static MetadataLtv make(std::initializer_list<_Tp> _il, _Up&&... _args) {
196     return MetadataLtv(std::in_place_index<static_cast<size_t>(_tag)>, std::move(_il), std::forward<_Up>(_args)...);
197   }
198 
getTag()199   Tag getTag() const {
200     return static_cast<Tag>(_value.index());
201   }
202 
203   template <Tag _tag>
get()204   const auto& get() const {
205     if (getTag() != _tag) { __assert2(__FILE__, __LINE__, __PRETTY_FUNCTION__, "bad access: a wrong tag"); }
206     return std::get<static_cast<size_t>(_tag)>(_value);
207   }
208 
209   template <Tag _tag>
get()210   auto& get() {
211     if (getTag() != _tag) { __assert2(__FILE__, __LINE__, __PRETTY_FUNCTION__, "bad access: a wrong tag"); }
212     return std::get<static_cast<size_t>(_tag)>(_value);
213   }
214 
215   template <Tag _tag, typename... _Tp>
set(_Tp &&..._args)216   void set(_Tp&&... _args) {
217     _value.emplace<static_cast<size_t>(_tag)>(std::forward<_Tp>(_args)...);
218   }
219 
220   binder_status_t readFromParcel(const AParcel* _parcel);
221   binder_status_t writeToParcel(AParcel* _parcel) const;
222 
223   inline bool operator==(const MetadataLtv& _rhs) const {
224     return _value == _rhs._value;
225   }
226   inline bool operator<(const MetadataLtv& _rhs) const {
227     return _value < _rhs._value;
228   }
229   inline bool operator!=(const MetadataLtv& _rhs) const {
230     return !(*this == _rhs);
231   }
232   inline bool operator>(const MetadataLtv& _rhs) const {
233     return _rhs < *this;
234   }
235   inline bool operator>=(const MetadataLtv& _rhs) const {
236     return !(*this < _rhs);
237   }
238   inline bool operator<=(const MetadataLtv& _rhs) const {
239     return !(_rhs < *this);
240   }
241 
242   static const ::ndk::parcelable_stability_t _aidl_stability = ::ndk::STABILITY_VINTF;
toString()243   inline std::string toString() const {
244     std::ostringstream os;
245     os << "MetadataLtv{";
246     switch (getTag()) {
247     case preferredAudioContexts: os << "preferredAudioContexts: " << ::android::internal::ToString(get<preferredAudioContexts>()); break;
248     case streamingAudioContexts: os << "streamingAudioContexts: " << ::android::internal::ToString(get<streamingAudioContexts>()); break;
249     case vendorSpecific: os << "vendorSpecific: " << ::android::internal::ToString(get<vendorSpecific>()); break;
250     }
251     os << "}";
252     return os.str();
253   }
254 private:
255   std::variant<::aidl::android::hardware::bluetooth::audio::MetadataLtv::PreferredAudioContexts, ::aidl::android::hardware::bluetooth::audio::MetadataLtv::StreamingAudioContexts, ::aidl::android::hardware::bluetooth::audio::MetadataLtv::VendorSpecific> _value;
256 };
257 }  // namespace audio
258 }  // namespace bluetooth
259 }  // namespace hardware
260 }  // namespace android
261 }  // namespace aidl
262 namespace aidl {
263 namespace android {
264 namespace hardware {
265 namespace bluetooth {
266 namespace audio {
toString(MetadataLtv::Tag val)267 [[nodiscard]] static inline std::string toString(MetadataLtv::Tag val) {
268   switch(val) {
269   case MetadataLtv::Tag::preferredAudioContexts:
270     return "preferredAudioContexts";
271   case MetadataLtv::Tag::streamingAudioContexts:
272     return "streamingAudioContexts";
273   case MetadataLtv::Tag::vendorSpecific:
274     return "vendorSpecific";
275   default:
276     return std::to_string(static_cast<int32_t>(val));
277   }
278 }
279 }  // namespace audio
280 }  // namespace bluetooth
281 }  // namespace hardware
282 }  // namespace android
283 }  // namespace aidl
284 namespace ndk {
285 namespace internal {
286 #pragma clang diagnostic push
287 #pragma clang diagnostic ignored "-Wc++17-extensions"
288 template <>
289 constexpr inline std::array<aidl::android::hardware::bluetooth::audio::MetadataLtv::Tag, 3> enum_values<aidl::android::hardware::bluetooth::audio::MetadataLtv::Tag> = {
290   aidl::android::hardware::bluetooth::audio::MetadataLtv::Tag::preferredAudioContexts,
291   aidl::android::hardware::bluetooth::audio::MetadataLtv::Tag::streamingAudioContexts,
292   aidl::android::hardware::bluetooth::audio::MetadataLtv::Tag::vendorSpecific,
293 };
294 #pragma clang diagnostic pop
295 }  // namespace internal
296 }  // namespace ndk
297