// services/viz/public/mojom/compositing/texture_releaser.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_VIZ_PUBLIC_MOJOM_COMPOSITING_TEXTURE_RELEASER_MOJOM_PARAMS_DATA_H_
#define SERVICES_VIZ_PUBLIC_MOJOM_COMPOSITING_TEXTURE_RELEASER_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 viz::mojom {
namespace internal {
class  TextureReleaser_Release_Params_Data {
 public:
  static bool Validate(const void* data,
                       mojo::internal::ValidationContext* validation_context);

  mojo::internal::StructHeader header_;
  mojo::internal::Pointer<::gpu::mojom::internal::SyncToken_Data> sync_token;
  uint8_t is_lost : 1;
  uint8_t padfinal_[7];

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

  TextureReleaser_Release_Params_Data();
  ~TextureReleaser_Release_Params_Data() = delete;
};
static_assert(sizeof(TextureReleaser_Release_Params_Data) == 24,
              "Bad sizeof(TextureReleaser_Release_Params_Data)");

}  // namespace internal


class TextureReleaser_Release_ParamsDataView {
 public:
  TextureReleaser_Release_ParamsDataView() = default;

  TextureReleaser_Release_ParamsDataView(
      internal::TextureReleaser_Release_Params_Data* data,
      mojo::Message* message)
      : data_(data), message_(message) {}

  bool is_null() const { return !data_; }
  inline void GetSyncTokenDataView(
      ::gpu::mojom::SyncTokenDataView* output);

  template <typename UserType>
  [[nodiscard]] bool ReadSyncToken(UserType* output) {
    
    auto* pointer = data_->sync_token.Get();
    return mojo::internal::Deserialize<::gpu::mojom::SyncTokenDataView>(
        pointer, output, message_);
  }
  bool is_lost() const {
    return data_->is_lost;
  }
 private:
  internal::TextureReleaser_Release_Params_Data* data_ = nullptr;
  mojo::Message* message_ = nullptr;
};

inline void TextureReleaser_Release_ParamsDataView::GetSyncTokenDataView(
    ::gpu::mojom::SyncTokenDataView* output) {
  auto pointer = data_->sync_token.Get();
  *output = ::gpu::mojom::SyncTokenDataView(pointer, message_);
}



}  // viz::mojom

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

#endif  // SERVICES_VIZ_PUBLIC_MOJOM_COMPOSITING_TEXTURE_RELEASER_MOJOM_PARAMS_DATA_H_