// services/shape_detection/public/mojom/barcodedetection.mojom-params-data.h is auto generated by mojom_bindings_generator.py, do not edit

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

#ifndef SERVICES_SHAPE_DETECTION_PUBLIC_MOJOM_BARCODEDETECTION_MOJOM_PARAMS_DATA_H_
#define SERVICES_SHAPE_DETECTION_PUBLIC_MOJOM_BARCODEDETECTION_MOJOM_PARAMS_DATA_H_
#include "mojo/public/cpp/bindings/array_data_view.h"
#include "mojo/public/cpp/bindings/map_data_view.h"
#include "mojo/public/cpp/bindings/string_data_view.h"

#if defined(__clang__)
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wunused-private-field"
#endif

namespace mojo::internal {
class ValidationContext;
}


namespace shape_detection::mojom {
namespace internal {
class  BarcodeDetection_Detect_Params_Data {
 public:
  static bool Validate(const void* data,
                       mojo::internal::ValidationContext* validation_context);

  mojo::internal::StructHeader header_;
  mojo::internal::Pointer<::skia::mojom::internal::BitmapN32_Data> bitmap_data;

 private:
  friend class mojo::internal::MessageFragment<BarcodeDetection_Detect_Params_Data>;

  BarcodeDetection_Detect_Params_Data();
  ~BarcodeDetection_Detect_Params_Data() = delete;
};
static_assert(sizeof(BarcodeDetection_Detect_Params_Data) == 16,
              "Bad sizeof(BarcodeDetection_Detect_Params_Data)");
class  BarcodeDetection_Detect_ResponseParams_Data {
 public:
  static bool Validate(const void* data,
                       mojo::internal::ValidationContext* validation_context);

  mojo::internal::StructHeader header_;
  mojo::internal::Pointer<mojo::internal::Array_Data<mojo::internal::Pointer<internal::BarcodeDetectionResult_Data>>> results;

 private:
  friend class mojo::internal::MessageFragment<BarcodeDetection_Detect_ResponseParams_Data>;

  BarcodeDetection_Detect_ResponseParams_Data();
  ~BarcodeDetection_Detect_ResponseParams_Data() = delete;
};
static_assert(sizeof(BarcodeDetection_Detect_ResponseParams_Data) == 16,
              "Bad sizeof(BarcodeDetection_Detect_ResponseParams_Data)");

}  // namespace internal


class BarcodeDetection_Detect_ParamsDataView {
 public:
  BarcodeDetection_Detect_ParamsDataView() = default;

  BarcodeDetection_Detect_ParamsDataView(
      internal::BarcodeDetection_Detect_Params_Data* data,
      mojo::Message* message)
      : data_(data), message_(message) {}

  bool is_null() const { return !data_; }
  inline void GetBitmapDataDataView(
      ::skia::mojom::BitmapN32DataView* output);

  template <typename UserType>
  [[nodiscard]] bool ReadBitmapData(UserType* output) {
    
    auto* pointer = data_->bitmap_data.Get();
    return mojo::internal::Deserialize<::skia::mojom::BitmapN32DataView>(
        pointer, output, message_);
  }
 private:
  internal::BarcodeDetection_Detect_Params_Data* data_ = nullptr;
  mojo::Message* message_ = nullptr;
};


class BarcodeDetection_Detect_ResponseParamsDataView {
 public:
  BarcodeDetection_Detect_ResponseParamsDataView() = default;

  BarcodeDetection_Detect_ResponseParamsDataView(
      internal::BarcodeDetection_Detect_ResponseParams_Data* data,
      mojo::Message* message)
      : data_(data), message_(message) {}

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

  template <typename UserType>
  [[nodiscard]] bool ReadResults(UserType* output) {
    
    auto* pointer = data_->results.Get();
    return mojo::internal::Deserialize<mojo::ArrayDataView<::shape_detection::mojom::BarcodeDetectionResultDataView>>(
        pointer, output, message_);
  }
 private:
  internal::BarcodeDetection_Detect_ResponseParams_Data* data_ = nullptr;
  mojo::Message* message_ = nullptr;
};

inline void BarcodeDetection_Detect_ParamsDataView::GetBitmapDataDataView(
    ::skia::mojom::BitmapN32DataView* output) {
  auto pointer = data_->bitmap_data.Get();
  *output = ::skia::mojom::BitmapN32DataView(pointer, message_);
}


inline void BarcodeDetection_Detect_ResponseParamsDataView::GetResultsDataView(
    mojo::ArrayDataView<BarcodeDetectionResultDataView>* output) {
  auto pointer = data_->results.Get();
  *output = mojo::ArrayDataView<BarcodeDetectionResultDataView>(pointer, message_);
}



}  // shape_detection::mojom

#if defined(__clang__)
#pragma clang diagnostic pop
#endif

#endif  // SERVICES_SHAPE_DETECTION_PUBLIC_MOJOM_BARCODEDETECTION_MOJOM_PARAMS_DATA_H_