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