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/Processing.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/Processing.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/Descriptor.h>
26 #include <aidl/android/hardware/audio/effect/Processing.h>
27 #include <aidl/android/media/audio/common/AudioDevice.h>
28 #include <aidl/android/media/audio/common/AudioSource.h>
29 #include <aidl/android/media/audio/common/AudioStreamType.h>
30 #ifdef BINDER_STABILITY_SUPPORT
31 #include <android/binder_stability.h>
32 #endif  // BINDER_STABILITY_SUPPORT
33 
34 #ifndef __BIONIC__
35 #define __assert2(a,b,c,d) ((void)0)
36 #endif
37 
38 namespace aidl::android::hardware::audio::effect {
39 class Descriptor;
40 }  // namespace aidl::android::hardware::audio::effect
41 namespace aidl::android::media::audio::common {
42 class AudioDevice;
43 }  // namespace aidl::android::media::audio::common
44 namespace aidl {
45 namespace android {
46 namespace hardware {
47 namespace audio {
48 namespace effect {
49 class Processing {
50 public:
51   typedef std::false_type fixed_size;
52   static const char* descriptor;
53 
54   class Type {
55   public:
56     typedef std::false_type fixed_size;
57     static const char* descriptor;
58 
59     enum class Tag : int32_t {
60       streamType = 0,
61       source = 1,
62       device = 2,
63     };
64 
65     // Expose tag symbols for legacy code
66     static const inline Tag streamType = Tag::streamType;
67     static const inline Tag source = Tag::source;
68     static const inline Tag device = Tag::device;
69 
70     template<typename _Tp>
71     static constexpr bool _not_self = !std::is_same_v<std::remove_cv_t<std::remove_reference_t<_Tp>>, Type>;
72 
Type()73     Type() : _value(std::in_place_index<static_cast<size_t>(streamType)>, ::aidl::android::media::audio::common::AudioStreamType(::aidl::android::media::audio::common::AudioStreamType::INVALID)) { }
74 
75     template <typename _Tp, typename = std::enable_if_t<_not_self<_Tp>>>
76     // NOLINTNEXTLINE(google-explicit-constructor)
Type(_Tp && _arg)77     constexpr Type(_Tp&& _arg)
78         : _value(std::forward<_Tp>(_arg)) {}
79 
80     template <size_t _Np, typename... _Tp>
Type(std::in_place_index_t<_Np>,_Tp &&..._args)81     constexpr explicit Type(std::in_place_index_t<_Np>, _Tp&&... _args)
82         : _value(std::in_place_index<_Np>, std::forward<_Tp>(_args)...) {}
83 
84     template <Tag _tag, typename... _Tp>
make(_Tp &&..._args)85     static Type make(_Tp&&... _args) {
86       return Type(std::in_place_index<static_cast<size_t>(_tag)>, std::forward<_Tp>(_args)...);
87     }
88 
89     template <Tag _tag, typename _Tp, typename... _Up>
make(std::initializer_list<_Tp> _il,_Up &&..._args)90     static Type make(std::initializer_list<_Tp> _il, _Up&&... _args) {
91       return Type(std::in_place_index<static_cast<size_t>(_tag)>, std::move(_il), std::forward<_Up>(_args)...);
92     }
93 
getTag()94     Tag getTag() const {
95       return static_cast<Tag>(_value.index());
96     }
97 
98     template <Tag _tag>
get()99     const auto& get() const {
100       if (getTag() != _tag) { __assert2(__FILE__, __LINE__, __PRETTY_FUNCTION__, "bad access: a wrong tag"); }
101       return std::get<static_cast<size_t>(_tag)>(_value);
102     }
103 
104     template <Tag _tag>
get()105     auto& get() {
106       if (getTag() != _tag) { __assert2(__FILE__, __LINE__, __PRETTY_FUNCTION__, "bad access: a wrong tag"); }
107       return std::get<static_cast<size_t>(_tag)>(_value);
108     }
109 
110     template <Tag _tag, typename... _Tp>
set(_Tp &&..._args)111     void set(_Tp&&... _args) {
112       _value.emplace<static_cast<size_t>(_tag)>(std::forward<_Tp>(_args)...);
113     }
114 
115     binder_status_t readFromParcel(const AParcel* _parcel);
116     binder_status_t writeToParcel(AParcel* _parcel) const;
117 
118     inline bool operator==(const Type& _rhs) const {
119       return _value == _rhs._value;
120     }
121     inline bool operator<(const Type& _rhs) const {
122       return _value < _rhs._value;
123     }
124     inline bool operator!=(const Type& _rhs) const {
125       return !(*this == _rhs);
126     }
127     inline bool operator>(const Type& _rhs) const {
128       return _rhs < *this;
129     }
130     inline bool operator>=(const Type& _rhs) const {
131       return !(*this < _rhs);
132     }
133     inline bool operator<=(const Type& _rhs) const {
134       return !(_rhs < *this);
135     }
136 
137     static const ::ndk::parcelable_stability_t _aidl_stability = ::ndk::STABILITY_VINTF;
toString()138     inline std::string toString() const {
139       std::ostringstream os;
140       os << "Type{";
141       switch (getTag()) {
142       case streamType: os << "streamType: " << ::android::internal::ToString(get<streamType>()); break;
143       case source: os << "source: " << ::android::internal::ToString(get<source>()); break;
144       case device: os << "device: " << ::android::internal::ToString(get<device>()); break;
145       }
146       os << "}";
147       return os.str();
148     }
149   private:
150     std::variant<::aidl::android::media::audio::common::AudioStreamType, ::aidl::android::media::audio::common::AudioSource, ::aidl::android::media::audio::common::AudioDevice> _value;
151   };
152   ::aidl::android::hardware::audio::effect::Processing::Type type;
153   std::vector<::aidl::android::hardware::audio::effect::Descriptor> ids;
154 
155   binder_status_t readFromParcel(const AParcel* parcel);
156   binder_status_t writeToParcel(AParcel* parcel) const;
157 
158   inline bool operator==(const Processing& _rhs) const {
159     return std::tie(type, ids) == std::tie(_rhs.type, _rhs.ids);
160   }
161   inline bool operator<(const Processing& _rhs) const {
162     return std::tie(type, ids) < std::tie(_rhs.type, _rhs.ids);
163   }
164   inline bool operator!=(const Processing& _rhs) const {
165     return !(*this == _rhs);
166   }
167   inline bool operator>(const Processing& _rhs) const {
168     return _rhs < *this;
169   }
170   inline bool operator>=(const Processing& _rhs) const {
171     return !(*this < _rhs);
172   }
173   inline bool operator<=(const Processing& _rhs) const {
174     return !(_rhs < *this);
175   }
176 
177   static const ::ndk::parcelable_stability_t _aidl_stability = ::ndk::STABILITY_VINTF;
toString()178   inline std::string toString() const {
179     std::ostringstream _aidl_os;
180     _aidl_os << "Processing{";
181     _aidl_os << "type: " << ::android::internal::ToString(type);
182     _aidl_os << ", ids: " << ::android::internal::ToString(ids);
183     _aidl_os << "}";
184     return _aidl_os.str();
185   }
186 };
187 }  // namespace effect
188 }  // namespace audio
189 }  // namespace hardware
190 }  // namespace android
191 }  // namespace aidl
192 namespace aidl {
193 namespace android {
194 namespace hardware {
195 namespace audio {
196 namespace effect {
toString(Processing::Type::Tag val)197 [[nodiscard]] static inline std::string toString(Processing::Type::Tag val) {
198   switch(val) {
199   case Processing::Type::Tag::streamType:
200     return "streamType";
201   case Processing::Type::Tag::source:
202     return "source";
203   case Processing::Type::Tag::device:
204     return "device";
205   default:
206     return std::to_string(static_cast<int32_t>(val));
207   }
208 }
209 }  // namespace effect
210 }  // namespace audio
211 }  // namespace hardware
212 }  // namespace android
213 }  // namespace aidl
214 namespace ndk {
215 namespace internal {
216 #pragma clang diagnostic push
217 #pragma clang diagnostic ignored "-Wc++17-extensions"
218 template <>
219 constexpr inline std::array<aidl::android::hardware::audio::effect::Processing::Type::Tag, 3> enum_values<aidl::android::hardware::audio::effect::Processing::Type::Tag> = {
220   aidl::android::hardware::audio::effect::Processing::Type::Tag::streamType,
221   aidl::android::hardware::audio::effect::Processing::Type::Tag::source,
222   aidl::android::hardware::audio::effect::Processing::Type::Tag::device,
223 };
224 #pragma clang diagnostic pop
225 }  // namespace internal
226 }  // namespace ndk
227