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