blob: 615f811907061322f5c010c1eb368b5c4af08c04 [file] [log] [blame]
// camera/mojo/camera_metadata.mojom-shared-internal.h is auto generated by mojom_bindings_generator.py, do not edit
// Copyright 2016 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef CAMERA_MOJO_CAMERA_METADATA_MOJOM_SHARED_INTERNAL_H_
#define CAMERA_MOJO_CAMERA_METADATA_MOJOM_SHARED_INTERNAL_H_
#include "mojo/public/cpp/bindings/lib/array_internal.h"
#include "mojo/public/cpp/bindings/lib/bindings_internal.h"
#include "mojo/public/cpp/bindings/lib/map_data_internal.h"
#include "mojo/public/cpp/bindings/lib/buffer.h"
#include "camera/mojo/camera_metadata_tags.mojom-shared-internal.h"
#include "mojo/public/cpp/bindings/lib/native_enum_data.h"
#include "mojo/public/interfaces/bindings/native_struct.mojom-shared-internal.h"
namespace mojo {
namespace internal {
class ValidationContext;
}
}
namespace cros::mojom {
namespace internal {
class CameraMetadataEntry_Data;
class CameraMetadata_Data;
struct EntryType_Data {
public:
static bool constexpr kIsExtensible = false;
static bool IsKnownValue(int32_t value) {
switch (value) {
case 0:
case 1:
case 2:
case 3:
case 4:
case 5:
case 6:
return true;
}
return false;
}
static bool Validate(int32_t value,
mojo::internal::ValidationContext* validation_context) {
if (kIsExtensible || IsKnownValue(value))
return true;
ReportValidationError(validation_context,
mojo::internal::VALIDATION_ERROR_UNKNOWN_ENUM_VALUE);
return false;
}
};
#pragma pack(push, 1)
class CameraMetadataEntry_Data {
public:
static bool Validate(const void* data,
mojo::internal::ValidationContext* validation_context);
mojo::internal::StructHeader header_;
uint32_t index;
int32_t tag;
int32_t type;
uint32_t count;
mojo::internal::Pointer<mojo::internal::Array_Data<uint8_t>> data;
private:
friend class mojo::internal::MessageFragment<CameraMetadataEntry_Data>;
CameraMetadataEntry_Data();
~CameraMetadataEntry_Data() = delete;
};
static_assert(sizeof(CameraMetadataEntry_Data) == 32,
"Bad sizeof(CameraMetadataEntry_Data)");
// Used by CameraMetadataEntry::WrapAsMessage to lazily serialize the struct.
template <typename UserType, typename DataView>
struct CameraMetadataEntry_UnserializedMessageContext
: public mojo::internal::UnserializedMessageContext {
public:
static const mojo::internal::UnserializedMessageContext::Tag kMessageTag;
CameraMetadataEntry_UnserializedMessageContext(
uint32_t message_name,
uint32_t message_flags,
UserType input)
: mojo::internal::UnserializedMessageContext(&kMessageTag, message_name, message_flags)
, user_data_(std::move(input)) {}
~CameraMetadataEntry_UnserializedMessageContext() override = default;
UserType TakeData() {
return std::move(user_data_);
}
private:
// mojo::internal::UnserializedMessageContext:
void Serialize(mojo::Message& message) override {
mojo::internal::MessageFragment<CameraMetadataEntry_Data> fragment(message);
mojo::internal::Serialize<DataView>(user_data_, fragment);
}
UserType user_data_;
};
template <typename UserType, typename DataView>
const mojo::internal::UnserializedMessageContext::Tag
CameraMetadataEntry_UnserializedMessageContext<UserType, DataView>::kMessageTag = {};
class CameraMetadata_Data {
public:
static bool Validate(const void* data,
mojo::internal::ValidationContext* validation_context);
mojo::internal::StructHeader header_;
uint32_t size;
uint32_t entry_count;
uint32_t entry_capacity;
uint32_t data_count;
uint32_t data_capacity;
uint8_t pad4_[4];
mojo::internal::Pointer<mojo::internal::Array_Data<mojo::internal::Pointer<internal::CameraMetadataEntry_Data>>> entries;
private:
friend class mojo::internal::MessageFragment<CameraMetadata_Data>;
CameraMetadata_Data();
~CameraMetadata_Data() = delete;
};
static_assert(sizeof(CameraMetadata_Data) == 40,
"Bad sizeof(CameraMetadata_Data)");
// Used by CameraMetadata::WrapAsMessage to lazily serialize the struct.
template <typename UserType, typename DataView>
struct CameraMetadata_UnserializedMessageContext
: public mojo::internal::UnserializedMessageContext {
public:
static const mojo::internal::UnserializedMessageContext::Tag kMessageTag;
CameraMetadata_UnserializedMessageContext(
uint32_t message_name,
uint32_t message_flags,
UserType input)
: mojo::internal::UnserializedMessageContext(&kMessageTag, message_name, message_flags)
, user_data_(std::move(input)) {}
~CameraMetadata_UnserializedMessageContext() override = default;
UserType TakeData() {
return std::move(user_data_);
}
private:
// mojo::internal::UnserializedMessageContext:
void Serialize(mojo::Message& message) override {
mojo::internal::MessageFragment<CameraMetadata_Data> fragment(message);
mojo::internal::Serialize<DataView>(user_data_, fragment);
}
UserType user_data_;
};
template <typename UserType, typename DataView>
const mojo::internal::UnserializedMessageContext::Tag
CameraMetadata_UnserializedMessageContext<UserType, DataView>::kMessageTag = {};
#pragma pack(pop)
} // namespace internal
} // cros::mojom
#endif // CAMERA_MOJO_CAMERA_METADATA_MOJOM_SHARED_INTERNAL_H_