| // iioservice/mojo/cros_sensor_service.mojom.h is auto generated by mojom_bindings_generator.py, do not edit |
| |
| // Copyright 2013 The Chromium Authors |
| // Use of this source code is governed by a BSD-style license that can be |
| // found in the LICENSE file. |
| |
| #ifndef IIOSERVICE_MOJO_CROS_SENSOR_SERVICE_MOJOM_H_ |
| #define IIOSERVICE_MOJO_CROS_SENSOR_SERVICE_MOJOM_H_ |
| |
| #include <stdint.h> |
| |
| #include <limits> |
| #include <optional> |
| #include <type_traits> |
| #include <utility> |
| |
| #include "base/types/cxx23_to_underlying.h" |
| #include "mojo/public/cpp/bindings/clone_traits.h" |
| #include "mojo/public/cpp/bindings/equals_traits.h" |
| #include "mojo/public/cpp/bindings/lib/serialization.h" |
| #include "mojo/public/cpp/bindings/struct_ptr.h" |
| #include "mojo/public/cpp/bindings/struct_traits.h" |
| #include "mojo/public/cpp/bindings/union_traits.h" |
| |
| #include "third_party/perfetto/include/perfetto/tracing/traced_value_forward.h" |
| |
| #include "iioservice/mojo/cros_sensor_service.mojom-features.h" |
| #include "iioservice/mojo/cros_sensor_service.mojom-shared.h" |
| #include "iioservice/mojo/cros_sensor_service.mojom-forward.h" |
| #include "iioservice/mojo/sensor.mojom-forward.h" |
| #include <string> |
| #include <vector> |
| |
| #include "mojo/public/cpp/bindings/lib/control_message_handler.h" |
| #include "mojo/public/cpp/bindings/lib/message_size_estimator.h" |
| #include "mojo/public/cpp/bindings/raw_ptr_impl_ref_traits.h" |
| |
| |
| |
| |
| |
| |
| namespace cros::mojom { |
| |
| class SensorHalServerProxy; |
| |
| template <typename ImplRefTraits> |
| class SensorHalServerStub; |
| |
| class SensorHalServerRequestValidator; |
| |
| |
| class SensorHalServer |
| : public SensorHalServerInterfaceBase { |
| public: |
| using IPCStableHashFunction = uint32_t(*)(); |
| |
| static const char Name_[]; |
| static IPCStableHashFunction MessageToMethodInfo_(mojo::Message& message); |
| static const char* MessageToMethodName_(mojo::Message& message); |
| static constexpr uint32_t Version_ = 0; |
| static constexpr bool PassesAssociatedKinds_ = false; |
| static constexpr bool HasUninterruptableMethods_ = false; |
| |
| using Base_ = SensorHalServerInterfaceBase; |
| using Proxy_ = SensorHalServerProxy; |
| |
| template <typename ImplRefTraits> |
| using Stub_ = SensorHalServerStub<ImplRefTraits>; |
| |
| using RequestValidator_ = SensorHalServerRequestValidator; |
| using ResponseValidator_ = mojo::PassThroughFilter; |
| enum MethodMinVersions : uint32_t { |
| kCreateChannelMinVersion = 0, |
| }; |
| |
| // crbug.com/1340245 - this causes binary size bloat on Fuchsia, and we're OK |
| // with not having this data in traces there. |
| #if !BUILDFLAG(IS_FUCHSIA) |
| struct CreateChannel_Sym { |
| NOINLINE static uint32_t IPCStableHash(); |
| }; |
| #endif // !BUILDFLAG(IS_FUCHSIA) |
| virtual ~SensorHalServer() = default; |
| |
| |
| virtual void CreateChannel(::mojo::PendingReceiver<::cros::mojom::SensorService> sensor_service_request) = 0; |
| }; |
| |
| class SensorHalClientProxy; |
| |
| template <typename ImplRefTraits> |
| class SensorHalClientStub; |
| |
| class SensorHalClientRequestValidator; |
| |
| |
| class SensorHalClient |
| : public SensorHalClientInterfaceBase { |
| public: |
| using IPCStableHashFunction = uint32_t(*)(); |
| |
| static const char Name_[]; |
| static IPCStableHashFunction MessageToMethodInfo_(mojo::Message& message); |
| static const char* MessageToMethodName_(mojo::Message& message); |
| static constexpr uint32_t Version_ = 0; |
| static constexpr bool PassesAssociatedKinds_ = false; |
| static constexpr bool HasUninterruptableMethods_ = false; |
| |
| using Base_ = SensorHalClientInterfaceBase; |
| using Proxy_ = SensorHalClientProxy; |
| |
| template <typename ImplRefTraits> |
| using Stub_ = SensorHalClientStub<ImplRefTraits>; |
| |
| using RequestValidator_ = SensorHalClientRequestValidator; |
| using ResponseValidator_ = mojo::PassThroughFilter; |
| enum MethodMinVersions : uint32_t { |
| kSetUpChannelMinVersion = 0, |
| }; |
| |
| // crbug.com/1340245 - this causes binary size bloat on Fuchsia, and we're OK |
| // with not having this data in traces there. |
| #if !BUILDFLAG(IS_FUCHSIA) |
| struct SetUpChannel_Sym { |
| NOINLINE static uint32_t IPCStableHash(); |
| }; |
| #endif // !BUILDFLAG(IS_FUCHSIA) |
| virtual ~SensorHalClient() = default; |
| |
| |
| virtual void SetUpChannel(::mojo::PendingRemote<::cros::mojom::SensorService> sensor_service_ptr) = 0; |
| }; |
| |
| |
| |
| class SensorHalServerProxy |
| : public SensorHalServer { |
| public: |
| using InterfaceType = SensorHalServer; |
| |
| explicit SensorHalServerProxy(mojo::MessageReceiverWithResponder* receiver); |
| |
| void CreateChannel(::mojo::PendingReceiver<::cros::mojom::SensorService> sensor_service_request) final; |
| |
| private: |
| mojo::MessageReceiverWithResponder* receiver_; |
| }; |
| |
| |
| |
| class SensorHalClientProxy |
| : public SensorHalClient { |
| public: |
| using InterfaceType = SensorHalClient; |
| |
| explicit SensorHalClientProxy(mojo::MessageReceiverWithResponder* receiver); |
| |
| void SetUpChannel(::mojo::PendingRemote<::cros::mojom::SensorService> sensor_service_ptr) final; |
| |
| private: |
| mojo::MessageReceiverWithResponder* receiver_; |
| }; |
| class SensorHalServerStubDispatch { |
| public: |
| static bool Accept(SensorHalServer* impl, mojo::Message* message); |
| static bool AcceptWithResponder( |
| SensorHalServer* impl, |
| mojo::Message* message, |
| std::unique_ptr<mojo::MessageReceiverWithStatus> responder); |
| }; |
| |
| template <typename ImplRefTraits = |
| mojo::RawPtrImplRefTraits<SensorHalServer>> |
| class SensorHalServerStub |
| : public mojo::MessageReceiverWithResponderStatus { |
| public: |
| using ImplPointerType = typename ImplRefTraits::PointerType; |
| |
| SensorHalServerStub() = default; |
| ~SensorHalServerStub() override = default; |
| |
| void set_sink(ImplPointerType sink) { sink_ = std::move(sink); } |
| ImplPointerType& sink() { return sink_; } |
| |
| bool Accept(mojo::Message* message) override { |
| if (ImplRefTraits::IsNull(sink_)) |
| return false; |
| return SensorHalServerStubDispatch::Accept( |
| ImplRefTraits::GetRawPointer(&sink_), message); |
| } |
| |
| bool AcceptWithResponder( |
| mojo::Message* message, |
| std::unique_ptr<mojo::MessageReceiverWithStatus> responder) override { |
| if (ImplRefTraits::IsNull(sink_)) |
| return false; |
| return SensorHalServerStubDispatch::AcceptWithResponder( |
| ImplRefTraits::GetRawPointer(&sink_), message, std::move(responder)); |
| } |
| |
| private: |
| ImplPointerType sink_; |
| }; |
| class SensorHalClientStubDispatch { |
| public: |
| static bool Accept(SensorHalClient* impl, mojo::Message* message); |
| static bool AcceptWithResponder( |
| SensorHalClient* impl, |
| mojo::Message* message, |
| std::unique_ptr<mojo::MessageReceiverWithStatus> responder); |
| }; |
| |
| template <typename ImplRefTraits = |
| mojo::RawPtrImplRefTraits<SensorHalClient>> |
| class SensorHalClientStub |
| : public mojo::MessageReceiverWithResponderStatus { |
| public: |
| using ImplPointerType = typename ImplRefTraits::PointerType; |
| |
| SensorHalClientStub() = default; |
| ~SensorHalClientStub() override = default; |
| |
| void set_sink(ImplPointerType sink) { sink_ = std::move(sink); } |
| ImplPointerType& sink() { return sink_; } |
| |
| bool Accept(mojo::Message* message) override { |
| if (ImplRefTraits::IsNull(sink_)) |
| return false; |
| return SensorHalClientStubDispatch::Accept( |
| ImplRefTraits::GetRawPointer(&sink_), message); |
| } |
| |
| bool AcceptWithResponder( |
| mojo::Message* message, |
| std::unique_ptr<mojo::MessageReceiverWithStatus> responder) override { |
| if (ImplRefTraits::IsNull(sink_)) |
| return false; |
| return SensorHalClientStubDispatch::AcceptWithResponder( |
| ImplRefTraits::GetRawPointer(&sink_), message, std::move(responder)); |
| } |
| |
| private: |
| ImplPointerType sink_; |
| }; |
| class SensorHalServerRequestValidator : public mojo::MessageReceiver { |
| public: |
| bool Accept(mojo::Message* message) override; |
| }; |
| class SensorHalClientRequestValidator : public mojo::MessageReceiver { |
| public: |
| bool Accept(mojo::Message* message) override; |
| }; |
| |
| |
| |
| |
| |
| } // cros::mojom |
| |
| namespace mojo { |
| |
| } // namespace mojo |
| |
| #endif // IIOSERVICE_MOJO_CROS_SENSOR_SERVICE_MOJOM_H_ |