#pragma once #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #ifndef __BIONIC__ #define __assert2(a,b,c,d) ((void)0) #endif namespace android { namespace aidl { namespace tests { class ArrayOfInterfaces : public ::android::Parcelable { public: class IEmptyInterfaceDelegator; class IEmptyInterface : public ::android::IInterface { public: typedef IEmptyInterfaceDelegator DefaultDelegator; DECLARE_META_INTERFACE(EmptyInterface) }; // class IEmptyInterface class IEmptyInterfaceDefault : public IEmptyInterface { public: ::android::IBinder* onAsBinder() override { return nullptr; } }; // class IEmptyInterfaceDefault class BpEmptyInterface : public ::android::BpInterface { public: explicit BpEmptyInterface(const ::android::sp<::android::IBinder>& _aidl_impl); virtual ~BpEmptyInterface() = default; }; // class BpEmptyInterface class BnEmptyInterface : public ::android::BnInterface { public: explicit BnEmptyInterface(); ::android::status_t onTransact(uint32_t _aidl_code, const ::android::Parcel& _aidl_data, ::android::Parcel* _aidl_reply, uint32_t _aidl_flags) override; }; // class BnEmptyInterface class IEmptyInterfaceDelegator : public BnEmptyInterface { public: explicit IEmptyInterfaceDelegator(const ::android::sp &impl) : _aidl_delegate(impl) {} ::android::sp getImpl() { return _aidl_delegate; } private: ::android::sp _aidl_delegate; }; // class IEmptyInterfaceDelegator class IMyInterfaceDelegator; class IMyInterface : public ::android::IInterface { public: typedef IMyInterfaceDelegator DefaultDelegator; DECLARE_META_INTERFACE(MyInterface) virtual ::android::binder::Status methodWithInterfaces(const ::android::sp<::android::aidl::tests::ArrayOfInterfaces::IEmptyInterface>& iface, const ::android::sp<::android::aidl::tests::ArrayOfInterfaces::IEmptyInterface>& nullable_iface, const ::std::vector<::android::sp<::android::aidl::tests::ArrayOfInterfaces::IEmptyInterface>>& iface_array_in, ::std::vector<::android::sp<::android::aidl::tests::ArrayOfInterfaces::IEmptyInterface>>* iface_array_out, ::std::vector<::android::sp<::android::aidl::tests::ArrayOfInterfaces::IEmptyInterface>>* iface_array_inout, const ::std::optional<::std::vector<::android::sp<::android::aidl::tests::ArrayOfInterfaces::IEmptyInterface>>>& nullable_iface_array_in, ::std::optional<::std::vector<::android::sp<::android::aidl::tests::ArrayOfInterfaces::IEmptyInterface>>>* nullable_iface_array_out, ::std::optional<::std::vector<::android::sp<::android::aidl::tests::ArrayOfInterfaces::IEmptyInterface>>>* nullable_iface_array_inout, ::std::optional<::std::vector<::android::sp<::android::aidl::tests::ArrayOfInterfaces::IEmptyInterface>>>* _aidl_return) = 0; }; // class IMyInterface class IMyInterfaceDefault : public IMyInterface { public: ::android::IBinder* onAsBinder() override { return nullptr; } ::android::binder::Status methodWithInterfaces(const ::android::sp<::android::aidl::tests::ArrayOfInterfaces::IEmptyInterface>& /*iface*/, const ::android::sp<::android::aidl::tests::ArrayOfInterfaces::IEmptyInterface>& /*nullable_iface*/, const ::std::vector<::android::sp<::android::aidl::tests::ArrayOfInterfaces::IEmptyInterface>>& /*iface_array_in*/, ::std::vector<::android::sp<::android::aidl::tests::ArrayOfInterfaces::IEmptyInterface>>* /*iface_array_out*/, ::std::vector<::android::sp<::android::aidl::tests::ArrayOfInterfaces::IEmptyInterface>>* /*iface_array_inout*/, const ::std::optional<::std::vector<::android::sp<::android::aidl::tests::ArrayOfInterfaces::IEmptyInterface>>>& /*nullable_iface_array_in*/, ::std::optional<::std::vector<::android::sp<::android::aidl::tests::ArrayOfInterfaces::IEmptyInterface>>>* /*nullable_iface_array_out*/, ::std::optional<::std::vector<::android::sp<::android::aidl::tests::ArrayOfInterfaces::IEmptyInterface>>>* /*nullable_iface_array_inout*/, ::std::optional<::std::vector<::android::sp<::android::aidl::tests::ArrayOfInterfaces::IEmptyInterface>>>* /*_aidl_return*/) override { return ::android::binder::Status::fromStatusT(::android::UNKNOWN_TRANSACTION); } }; // class IMyInterfaceDefault class BpMyInterface : public ::android::BpInterface { public: explicit BpMyInterface(const ::android::sp<::android::IBinder>& _aidl_impl); virtual ~BpMyInterface() = default; ::android::binder::Status methodWithInterfaces(const ::android::sp<::android::aidl::tests::ArrayOfInterfaces::IEmptyInterface>& iface, const ::android::sp<::android::aidl::tests::ArrayOfInterfaces::IEmptyInterface>& nullable_iface, const ::std::vector<::android::sp<::android::aidl::tests::ArrayOfInterfaces::IEmptyInterface>>& iface_array_in, ::std::vector<::android::sp<::android::aidl::tests::ArrayOfInterfaces::IEmptyInterface>>* iface_array_out, ::std::vector<::android::sp<::android::aidl::tests::ArrayOfInterfaces::IEmptyInterface>>* iface_array_inout, const ::std::optional<::std::vector<::android::sp<::android::aidl::tests::ArrayOfInterfaces::IEmptyInterface>>>& nullable_iface_array_in, ::std::optional<::std::vector<::android::sp<::android::aidl::tests::ArrayOfInterfaces::IEmptyInterface>>>* nullable_iface_array_out, ::std::optional<::std::vector<::android::sp<::android::aidl::tests::ArrayOfInterfaces::IEmptyInterface>>>* nullable_iface_array_inout, ::std::optional<::std::vector<::android::sp<::android::aidl::tests::ArrayOfInterfaces::IEmptyInterface>>>* _aidl_return) override; }; // class BpMyInterface class BnMyInterface : public ::android::BnInterface { public: static constexpr uint32_t TRANSACTION_methodWithInterfaces = ::android::IBinder::FIRST_CALL_TRANSACTION + 0; explicit BnMyInterface(); ::android::status_t onTransact(uint32_t _aidl_code, const ::android::Parcel& _aidl_data, ::android::Parcel* _aidl_reply, uint32_t _aidl_flags) override; }; // class BnMyInterface class IMyInterfaceDelegator : public BnMyInterface { public: explicit IMyInterfaceDelegator(const ::android::sp &impl) : _aidl_delegate(impl) {} ::android::sp getImpl() { return _aidl_delegate; } ::android::binder::Status methodWithInterfaces(const ::android::sp<::android::aidl::tests::ArrayOfInterfaces::IEmptyInterface>& iface, const ::android::sp<::android::aidl::tests::ArrayOfInterfaces::IEmptyInterface>& nullable_iface, const ::std::vector<::android::sp<::android::aidl::tests::ArrayOfInterfaces::IEmptyInterface>>& iface_array_in, ::std::vector<::android::sp<::android::aidl::tests::ArrayOfInterfaces::IEmptyInterface>>* iface_array_out, ::std::vector<::android::sp<::android::aidl::tests::ArrayOfInterfaces::IEmptyInterface>>* iface_array_inout, const ::std::optional<::std::vector<::android::sp<::android::aidl::tests::ArrayOfInterfaces::IEmptyInterface>>>& nullable_iface_array_in, ::std::optional<::std::vector<::android::sp<::android::aidl::tests::ArrayOfInterfaces::IEmptyInterface>>>* nullable_iface_array_out, ::std::optional<::std::vector<::android::sp<::android::aidl::tests::ArrayOfInterfaces::IEmptyInterface>>>* nullable_iface_array_inout, ::std::optional<::std::vector<::android::sp<::android::aidl::tests::ArrayOfInterfaces::IEmptyInterface>>>* _aidl_return) override { ::android::sp<::android::aidl::tests::ArrayOfInterfaces::IEmptyInterfaceDelegator> _iface; if (iface) { _iface = ::android::sp<::android::aidl::tests::ArrayOfInterfaces::IEmptyInterfaceDelegator>::cast(delegate(iface)); } ::android::sp<::android::aidl::tests::ArrayOfInterfaces::IEmptyInterfaceDelegator> _nullable_iface; if (nullable_iface) { _nullable_iface = ::android::sp<::android::aidl::tests::ArrayOfInterfaces::IEmptyInterfaceDelegator>::cast(delegate(nullable_iface)); } return _aidl_delegate->methodWithInterfaces(_iface, _nullable_iface, iface_array_in, iface_array_out, iface_array_inout, nullable_iface_array_in, nullable_iface_array_out, nullable_iface_array_inout, _aidl_return); } private: ::android::sp _aidl_delegate; }; // class IMyInterfaceDelegator class MyParcelable : public ::android::Parcelable { public: ::android::sp<::android::aidl::tests::ArrayOfInterfaces::IEmptyInterface> iface; ::android::sp<::android::aidl::tests::ArrayOfInterfaces::IEmptyInterface> nullable_iface; ::std::vector<::android::sp<::android::aidl::tests::ArrayOfInterfaces::IEmptyInterface>> iface_array; ::std::optional<::std::vector<::android::sp<::android::aidl::tests::ArrayOfInterfaces::IEmptyInterface>>> nullable_iface_array; inline bool operator!=(const MyParcelable& rhs) const { return std::tie(iface, nullable_iface, iface_array, nullable_iface_array) != std::tie(rhs.iface, rhs.nullable_iface, rhs.iface_array, rhs.nullable_iface_array); } inline bool operator<(const MyParcelable& rhs) const { return std::tie(iface, nullable_iface, iface_array, nullable_iface_array) < std::tie(rhs.iface, rhs.nullable_iface, rhs.iface_array, rhs.nullable_iface_array); } inline bool operator<=(const MyParcelable& rhs) const { return std::tie(iface, nullable_iface, iface_array, nullable_iface_array) <= std::tie(rhs.iface, rhs.nullable_iface, rhs.iface_array, rhs.nullable_iface_array); } inline bool operator==(const MyParcelable& rhs) const { return std::tie(iface, nullable_iface, iface_array, nullable_iface_array) == std::tie(rhs.iface, rhs.nullable_iface, rhs.iface_array, rhs.nullable_iface_array); } inline bool operator>(const MyParcelable& rhs) const { return std::tie(iface, nullable_iface, iface_array, nullable_iface_array) > std::tie(rhs.iface, rhs.nullable_iface, rhs.iface_array, rhs.nullable_iface_array); } inline bool operator>=(const MyParcelable& rhs) const { return std::tie(iface, nullable_iface, iface_array, nullable_iface_array) >= std::tie(rhs.iface, rhs.nullable_iface, rhs.iface_array, rhs.nullable_iface_array); } ::android::status_t readFromParcel(const ::android::Parcel* _aidl_parcel) final; ::android::status_t writeToParcel(::android::Parcel* _aidl_parcel) const final; static const ::android::String16& getParcelableDescriptor() { static const ::android::StaticString16 DESCRIPTOR (u"android.aidl.tests.ArrayOfInterfaces.MyParcelable"); return DESCRIPTOR; } inline std::string toString() const { std::ostringstream os; os << "MyParcelable{"; os << "iface: " << ::android::internal::ToString(iface); os << ", nullable_iface: " << ::android::internal::ToString(nullable_iface); os << ", iface_array: " << ::android::internal::ToString(iface_array); os << ", nullable_iface_array: " << ::android::internal::ToString(nullable_iface_array); os << "}"; return os.str(); } }; // class MyParcelable class MyUnion : public ::android::Parcelable { public: enum class Tag : int32_t { iface = 0, nullable_iface = 1, iface_array = 2, nullable_iface_array = 3, }; // Expose tag symbols for legacy code static const inline Tag iface = Tag::iface; static const inline Tag nullable_iface = Tag::nullable_iface; static const inline Tag iface_array = Tag::iface_array; static const inline Tag nullable_iface_array = Tag::nullable_iface_array; template static constexpr bool _not_self = !std::is_same_v>, MyUnion>; MyUnion() : _value(std::in_place_index(iface)>, ::android::sp<::android::aidl::tests::ArrayOfInterfaces::IEmptyInterface>()) { } template >> // NOLINTNEXTLINE(google-explicit-constructor) constexpr MyUnion(_Tp&& _arg) : _value(std::forward<_Tp>(_arg)) {} template constexpr explicit MyUnion(std::in_place_index_t<_Np>, _Tp&&... _args) : _value(std::in_place_index<_Np>, std::forward<_Tp>(_args)...) {} template static MyUnion make(_Tp&&... _args) { return MyUnion(std::in_place_index(_tag)>, std::forward<_Tp>(_args)...); } template static MyUnion make(std::initializer_list<_Tp> _il, _Up&&... _args) { return MyUnion(std::in_place_index(_tag)>, std::move(_il), std::forward<_Up>(_args)...); } Tag getTag() const { return static_cast(_value.index()); } template const auto& get() const { if (getTag() != _tag) { __assert2(__FILE__, __LINE__, __PRETTY_FUNCTION__, "bad access: a wrong tag"); } return std::get(_tag)>(_value); } template auto& get() { if (getTag() != _tag) { __assert2(__FILE__, __LINE__, __PRETTY_FUNCTION__, "bad access: a wrong tag"); } return std::get(_tag)>(_value); } template void set(_Tp&&... _args) { _value.emplace(_tag)>(std::forward<_Tp>(_args)...); } inline bool operator!=(const MyUnion& rhs) const { return _value != rhs._value; } inline bool operator<(const MyUnion& rhs) const { return _value < rhs._value; } inline bool operator<=(const MyUnion& rhs) const { return _value <= rhs._value; } inline bool operator==(const MyUnion& rhs) const { return _value == rhs._value; } inline bool operator>(const MyUnion& rhs) const { return _value > rhs._value; } inline bool operator>=(const MyUnion& rhs) const { return _value >= rhs._value; } ::android::status_t readFromParcel(const ::android::Parcel* _aidl_parcel) final; ::android::status_t writeToParcel(::android::Parcel* _aidl_parcel) const final; static const ::android::String16& getParcelableDescriptor() { static const ::android::StaticString16 DESCRIPTOR (u"android.aidl.tests.ArrayOfInterfaces.MyUnion"); return DESCRIPTOR; } inline std::string toString() const { std::ostringstream os; os << "MyUnion{"; switch (getTag()) { case iface: os << "iface: " << ::android::internal::ToString(get()); break; case nullable_iface: os << "nullable_iface: " << ::android::internal::ToString(get()); break; case iface_array: os << "iface_array: " << ::android::internal::ToString(get()); break; case nullable_iface_array: os << "nullable_iface_array: " << ::android::internal::ToString(get()); break; } os << "}"; return os.str(); } private: std::variant<::android::sp<::android::aidl::tests::ArrayOfInterfaces::IEmptyInterface>, ::android::sp<::android::aidl::tests::ArrayOfInterfaces::IEmptyInterface>, ::std::vector<::android::sp<::android::aidl::tests::ArrayOfInterfaces::IEmptyInterface>>, ::std::optional<::std::vector<::android::sp<::android::aidl::tests::ArrayOfInterfaces::IEmptyInterface>>>> _value; }; // class MyUnion inline bool operator!=(const ArrayOfInterfaces&) const { return std::tie() != std::tie(); } inline bool operator<(const ArrayOfInterfaces&) const { return std::tie() < std::tie(); } inline bool operator<=(const ArrayOfInterfaces&) const { return std::tie() <= std::tie(); } inline bool operator==(const ArrayOfInterfaces&) const { return std::tie() == std::tie(); } inline bool operator>(const ArrayOfInterfaces&) const { return std::tie() > std::tie(); } inline bool operator>=(const ArrayOfInterfaces&) const { return std::tie() >= std::tie(); } ::android::status_t readFromParcel(const ::android::Parcel* _aidl_parcel) final; ::android::status_t writeToParcel(::android::Parcel* _aidl_parcel) const final; static const ::android::String16& getParcelableDescriptor() { static const ::android::StaticString16 DESCRIPTOR (u"android.aidl.tests.ArrayOfInterfaces"); return DESCRIPTOR; } inline std::string toString() const { std::ostringstream os; os << "ArrayOfInterfaces{"; os << "}"; return os.str(); } }; // class ArrayOfInterfaces } // namespace tests } // namespace aidl } // namespace android namespace android { namespace aidl { namespace tests { [[nodiscard]] static inline std::string toString(ArrayOfInterfaces::MyUnion::Tag val) { switch(val) { case ArrayOfInterfaces::MyUnion::Tag::iface: return "iface"; case ArrayOfInterfaces::MyUnion::Tag::nullable_iface: return "nullable_iface"; case ArrayOfInterfaces::MyUnion::Tag::iface_array: return "iface_array"; case ArrayOfInterfaces::MyUnion::Tag::nullable_iface_array: return "nullable_iface_array"; default: return std::to_string(static_cast(val)); } } } // namespace tests } // namespace aidl } // namespace android namespace android { namespace internal { #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wc++17-extensions" template <> constexpr inline std::array<::android::aidl::tests::ArrayOfInterfaces::MyUnion::Tag, 4> enum_values<::android::aidl::tests::ArrayOfInterfaces::MyUnion::Tag> = { ::android::aidl::tests::ArrayOfInterfaces::MyUnion::Tag::iface, ::android::aidl::tests::ArrayOfInterfaces::MyUnion::Tag::nullable_iface, ::android::aidl::tests::ArrayOfInterfaces::MyUnion::Tag::iface_array, ::android::aidl::tests::ArrayOfInterfaces::MyUnion::Tag::nullable_iface_array, }; #pragma clang diagnostic pop } // namespace internal } // namespace android