// services/service_manager/public/mojom/service.mojom-data-view.h is auto generated by mojom_bindings_generator.py, do not edit

// Copyright 2025 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

// This file defines XDataView for type traits and can be included in
// _mojom_traits.h definitions but otherwise please use .mojom-forward.h,
// .mojom-shared.h or .mojom.h.

// IWYU pragma: private
// IWYU pragma: friend "traits"

#ifndef SERVICES_SERVICE_MANAGER_PUBLIC_MOJOM_SERVICE_MOJOM_DATA_VIEW_H_
#define SERVICES_SERVICE_MANAGER_PUBLIC_MOJOM_SERVICE_MOJOM_DATA_VIEW_H_

#include <stdint.h>

#include <functional>
#include <iosfwd>
#include <type_traits>
#include <utility>
#include "mojo/public/cpp/bindings/array_data_view.h"
#include "mojo/public/cpp/bindings/string_data_view.h"
#include "mojo/public/cpp/bindings/lib/serialization.h"

#include "services/service_manager/public/mojom/service.mojom-shared-internal.h"
#include "services/service_manager/public/mojom/connector.mojom-shared.h"
#include "services/service_manager/public/mojom/interface_provider.mojom-shared.h"
#include "services/service_manager/public/mojom/interface_provider_spec.mojom-shared.h"
#include "services/service_manager/public/mojom/service_control.mojom-shared.h"


namespace service_manager::mojom {
class BindSourceInfoDataView;



}  // service_manager::mojom


namespace mojo {
namespace internal {

template <>
struct MojomTypeTraits<::service_manager::mojom::BindSourceInfoDataView> {
  using Data = ::service_manager::mojom::internal::BindSourceInfo_Data;
  using DataAsArrayElement = Pointer<Data>;
  static constexpr MojomTypeCategory category = MojomTypeCategory::kStruct;
};

}  // namespace internal
}  // namespace mojo


namespace service_manager::mojom {
// Interface base classes. They are used for type safety check.
class ServiceInterfaceBase {};

using ServicePtrDataView =
    mojo::InterfacePtrDataView<ServiceInterfaceBase>;
using ServiceRequestDataView =
    mojo::InterfaceRequestDataView<ServiceInterfaceBase>;
using ServiceAssociatedPtrInfoDataView =
    mojo::AssociatedInterfacePtrInfoDataView<ServiceInterfaceBase>;
using ServiceAssociatedRequestDataView =
    mojo::AssociatedInterfaceRequestDataView<ServiceInterfaceBase>;


class BindSourceInfoDataView {
 public:
  BindSourceInfoDataView() = default;

  BindSourceInfoDataView(
      internal::BindSourceInfo_Data* data,
      mojo::Message* message)
      : data_(data), message_(message) {}

  bool is_null() const { return !data_; }
  inline void GetIdentityDataView(
      ::service_manager::mojom::IdentityDataView* output);

  template <typename UserType>
  [[nodiscard]] bool ReadIdentity(UserType* output) {
    
    auto* pointer = data_->identity.Get();
    return mojo::internal::Deserialize<::service_manager::mojom::IdentityDataView>(
        pointer, output, message_);
  }
  inline void GetRequiredCapabilitiesDataView(
      ::service_manager::mojom::CapabilitySetDataView* output);

  template <typename UserType>
  [[nodiscard]] bool ReadRequiredCapabilities(UserType* output) {
    
    auto* pointer = data_->required_capabilities.Get();
    return mojo::internal::Deserialize<::service_manager::mojom::CapabilitySetDataView>(
        pointer, output, message_);
  }
 private:
  internal::BindSourceInfo_Data* data_ = nullptr;
  mojo::Message* message_ = nullptr;
};


}  // service_manager::mojom

#endif  // SERVICES_SERVICE_MANAGER_PUBLIC_MOJOM_SERVICE_MOJOM_DATA_VIEW_H_