// services/service_manager/public/mojom/interface_provider_spec.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_INTERFACE_PROVIDER_SPEC_MOJOM_DATA_VIEW_H_
#define SERVICES_SERVICE_MANAGER_PUBLIC_MOJOM_INTERFACE_PROVIDER_SPEC_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/interface_provider_spec.mojom-shared-internal.h"


namespace service_manager::mojom {
class InterfaceSetDataView;

class CapabilitySetDataView;

class InterfaceProviderSpecDataView;



}  // service_manager::mojom


namespace mojo {
namespace internal {

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

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

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

}  // namespace internal
}  // namespace mojo


namespace service_manager::mojom {


class InterfaceSetDataView {
 public:
  InterfaceSetDataView() = default;

  InterfaceSetDataView(
      internal::InterfaceSet_Data* data,
      mojo::Message* message)
      : data_(data), message_(message) {}

  bool is_null() const { return !data_; }
  inline void GetInterfacesDataView(
      mojo::ArrayDataView<mojo::StringDataView>* output);

  template <typename UserType>
  [[nodiscard]] bool ReadInterfaces(UserType* output) {
    
    auto* pointer = data_->interfaces.Get();
    return mojo::internal::Deserialize<mojo::ArrayDataView<mojo::StringDataView>>(
        pointer, output, message_);
  }
 private:
  internal::InterfaceSet_Data* data_ = nullptr;
  mojo::Message* message_ = nullptr;
};


class CapabilitySetDataView {
 public:
  CapabilitySetDataView() = default;

  CapabilitySetDataView(
      internal::CapabilitySet_Data* data,
      mojo::Message* message)
      : data_(data), message_(message) {}

  bool is_null() const { return !data_; }
  inline void GetCapabilitiesDataView(
      mojo::ArrayDataView<mojo::StringDataView>* output);

  template <typename UserType>
  [[nodiscard]] bool ReadCapabilities(UserType* output) {
    
    auto* pointer = data_->capabilities.Get();
    return mojo::internal::Deserialize<mojo::ArrayDataView<mojo::StringDataView>>(
        pointer, output, message_);
  }
 private:
  internal::CapabilitySet_Data* data_ = nullptr;
  mojo::Message* message_ = nullptr;
};


class InterfaceProviderSpecDataView {
 public:
  InterfaceProviderSpecDataView() = default;

  InterfaceProviderSpecDataView(
      internal::InterfaceProviderSpec_Data* data,
      mojo::Message* message)
      : data_(data), message_(message) {}

  bool is_null() const { return !data_; }
  inline void GetProvidesDataView(
      mojo::MapDataView<mojo::StringDataView, InterfaceSetDataView>* output);

  template <typename UserType>
  [[nodiscard]] bool ReadProvides(UserType* output) {
    
    auto* pointer = data_->provides.Get();
    return mojo::internal::Deserialize<mojo::MapDataView<mojo::StringDataView, ::service_manager::mojom::InterfaceSetDataView>>(
        pointer, output, message_);
  }
  inline void GetNeedsDataView(
      mojo::MapDataView<mojo::StringDataView, CapabilitySetDataView>* output);

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


}  // service_manager::mojom

#endif  // SERVICES_SERVICE_MANAGER_PUBLIC_MOJOM_INTERFACE_PROVIDER_SPEC_MOJOM_DATA_VIEW_H_