Iscle 8ca8a8b778 Revert "More stupid stuff"
This reverts commit d4f8e8791228c6d59da4b4e58b1f1ecc1e4faf65.
2025-04-21 12:55:06 +02:00

166 lines
5.6 KiB
C++

/*
* This file is auto-generated. DO NOT MODIFY.
* Using: /home/iscle/Android/Sdk/build-tools/35.0.1/aidl --lang=ndk -o generated -h generated/include --structured --stability=vintf --min_sdk_version=31 -I hardware_interfaces/common/aidl/aidl_api/android.hardware.common/current/ -I hardware_interfaces/common/fmq/aidl/aidl_api/android.hardware.common.fmq/current/ -I hardware_interfaces/audio/aidl/aidl_api/android.hardware.audio.common/current/ -I hardware_interfaces/audio/aidl/aidl_api/android.hardware.audio.effect/current/ -I system_hardware_interfaces/media/aidl_api/android.media.audio.common.types/current/ -I system_hardware_interfaces/media/aidl_api/android.media.audio.eraser.types/current/ system_hardware_interfaces/media/aidl_api/android.media.audio.common.types/current/android/media/audio/common/AudioIoFlags.aidl
*/
#pragma once
#include <array>
#include <cassert>
#include <cstdint>
#include <memory>
#include <optional>
#include <string>
#include <type_traits>
#include <utility>
#include <variant>
#include <vector>
#include <android/binder_enums.h>
#include <android/binder_interface_utils.h>
#include <android/binder_parcelable_utils.h>
#include <android/binder_to_string.h>
#ifdef BINDER_STABILITY_SUPPORT
#include <android/binder_stability.h>
#endif // BINDER_STABILITY_SUPPORT
#ifndef __BIONIC__
#define __assert2(a,b,c,d) ((void)0)
#endif
namespace aidl {
namespace android {
namespace media {
namespace audio {
namespace common {
class AudioIoFlags {
public:
typedef std::false_type fixed_size;
static const char* descriptor;
enum class Tag : int32_t {
input = 0,
output = 1,
};
// Expose tag symbols for legacy code
static const inline Tag input = Tag::input;
static const inline Tag output = Tag::output;
template<typename _Tp>
static constexpr bool _not_self = !std::is_same_v<std::remove_cv_t<std::remove_reference_t<_Tp>>, AudioIoFlags>;
AudioIoFlags() : _value(std::in_place_index<static_cast<size_t>(input)>, int32_t(0)) { }
template <typename _Tp, typename = std::enable_if_t<_not_self<_Tp>>>
// NOLINTNEXTLINE(google-explicit-constructor)
constexpr AudioIoFlags(_Tp&& _arg)
: _value(std::forward<_Tp>(_arg)) {}
template <size_t _Np, typename... _Tp>
constexpr explicit AudioIoFlags(std::in_place_index_t<_Np>, _Tp&&... _args)
: _value(std::in_place_index<_Np>, std::forward<_Tp>(_args)...) {}
template <Tag _tag, typename... _Tp>
static AudioIoFlags make(_Tp&&... _args) {
return AudioIoFlags(std::in_place_index<static_cast<size_t>(_tag)>, std::forward<_Tp>(_args)...);
}
template <Tag _tag, typename _Tp, typename... _Up>
static AudioIoFlags make(std::initializer_list<_Tp> _il, _Up&&... _args) {
return AudioIoFlags(std::in_place_index<static_cast<size_t>(_tag)>, std::move(_il), std::forward<_Up>(_args)...);
}
Tag getTag() const {
return static_cast<Tag>(_value.index());
}
template <Tag _tag>
const auto& get() const {
if (getTag() != _tag) { __assert2(__FILE__, __LINE__, __PRETTY_FUNCTION__, "bad access: a wrong tag"); }
return std::get<static_cast<size_t>(_tag)>(_value);
}
template <Tag _tag>
auto& get() {
if (getTag() != _tag) { __assert2(__FILE__, __LINE__, __PRETTY_FUNCTION__, "bad access: a wrong tag"); }
return std::get<static_cast<size_t>(_tag)>(_value);
}
template <Tag _tag, typename... _Tp>
void set(_Tp&&... _args) {
_value.emplace<static_cast<size_t>(_tag)>(std::forward<_Tp>(_args)...);
}
binder_status_t readFromParcel(const AParcel* _parcel);
binder_status_t writeToParcel(AParcel* _parcel) const;
inline bool operator==(const AudioIoFlags& _rhs) const {
return _value == _rhs._value;
}
inline bool operator<(const AudioIoFlags& _rhs) const {
return _value < _rhs._value;
}
inline bool operator!=(const AudioIoFlags& _rhs) const {
return !(*this == _rhs);
}
inline bool operator>(const AudioIoFlags& _rhs) const {
return _rhs < *this;
}
inline bool operator>=(const AudioIoFlags& _rhs) const {
return !(*this < _rhs);
}
inline bool operator<=(const AudioIoFlags& _rhs) const {
return !(_rhs < *this);
}
static const ::ndk::parcelable_stability_t _aidl_stability = ::ndk::STABILITY_VINTF;
inline std::string toString() const {
std::ostringstream os;
os << "AudioIoFlags{";
switch (getTag()) {
case input: os << "input: " << ::android::internal::ToString(get<input>()); break;
case output: os << "output: " << ::android::internal::ToString(get<output>()); break;
}
os << "}";
return os.str();
}
private:
std::variant<int32_t, int32_t> _value;
};
} // namespace common
} // namespace audio
} // namespace media
} // namespace android
} // namespace aidl
namespace aidl {
namespace android {
namespace media {
namespace audio {
namespace common {
[[nodiscard]] static inline std::string toString(AudioIoFlags::Tag val) {
switch(val) {
case AudioIoFlags::Tag::input:
return "input";
case AudioIoFlags::Tag::output:
return "output";
default:
return std::to_string(static_cast<int32_t>(val));
}
}
} // namespace common
} // namespace audio
} // namespace media
} // namespace android
} // namespace aidl
namespace ndk {
namespace internal {
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wc++17-extensions"
template <>
constexpr inline std::array<aidl::android::media::audio::common::AudioIoFlags::Tag, 2> enum_values<aidl::android::media::audio::common::AudioIoFlags::Tag> = {
aidl::android::media::audio::common::AudioIoFlags::Tag::input,
aidl::android::media::audio::common::AudioIoFlags::Tag::output,
};
#pragma clang diagnostic pop
} // namespace internal
} // namespace ndk