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